From acc2836e12b021283b95d4db4337f4413c304be2 Mon Sep 17 00:00:00 2001 From: cflip Date: Sun, 27 Feb 2022 13:42:13 -0700 Subject: Add highlight on hovered tiles --- src/level.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/level.cpp') 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); } } } -- cgit v1.2.3