summaryrefslogtreecommitdiff
path: root/src/level.cpp
diff options
context:
space:
mode:
authorcflip <cflip@cflip.net>2022-02-27 13:42:13 -0700
committercflip <cflip@cflip.net>2022-02-27 13:42:54 -0700
commitacc2836e12b021283b95d4db4337f4413c304be2 (patch)
tree60af5ab8b7b5fb89dd3a1b800e29b68112ee6206 /src/level.cpp
parent5e35269921281f38f77fcfe2150c937290cafe46 (diff)
Add highlight on hovered tiles
Diffstat (limited to 'src/level.cpp')
-rw-r--r--src/level.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/level.cpp b/src/level.cpp
index 1e71799..54cf7f0 100644
--- a/src/level.cpp
+++ b/src/level.cpp
@@ -1,8 +1,8 @@
#include "level.h"
#include "util.h"
-Level::Level(int width, int height)
- : m_width(width), m_height(height), m_tileSprites("../res/tiles.png")
+Level::Level(int width, int height, Bitmap& tileSprites)
+ : m_width(width), m_height(height), m_tileSprites(tileSprites)
{
m_tiles = new uint8_t[width * height];
memset(m_tiles, 0, width * height);
@@ -55,7 +55,7 @@ void Level::draw(Bitmap& bitmap, int xo, int yo)
ty = 3;
}
- bitmap.blit(m_tileSprites, xx, yy, tx * 24, ty * 24, TileSize, TileSize);
+ bitmap.blit(m_tileSprites, xx, yy, tx * TileSize, ty * TileSize, TileSize, TileSize);
}
}
}