|
@@ -5,7 +5,7 @@
|
|
|
using namespace WalrusRPG;
|
|
using namespace WalrusRPG;
|
|
|
using namespace WalrusRPG::Utils;
|
|
using namespace WalrusRPG::Utils;
|
|
|
|
|
|
|
|
-TILERENDERER::TileRenderer(unsigned short *_tilesheet, unsigned tile_width,
|
|
|
|
|
|
|
+TILERENDERER::TileRenderer(WalrusRPG::Graphics::Texture _tilesheet, unsigned tile_width,
|
|
|
unsigned tile_height)
|
|
unsigned tile_height)
|
|
|
: tilesheet(_tilesheet), tile_width(tile_width), tile_height(tile_height)
|
|
: tilesheet(_tilesheet), tile_width(tile_width), tile_height(tile_height)
|
|
|
{
|
|
{
|
|
@@ -13,7 +13,7 @@ TILERENDERER::TileRenderer(unsigned short *_tilesheet, unsigned tile_width,
|
|
|
|
|
|
|
|
void TILERENDERER::render(const unsigned id, const Rect &rect)
|
|
void TILERENDERER::render(const unsigned id, const Rect &rect)
|
|
|
{
|
|
{
|
|
|
- unsigned num_tiles_x = tilesheet[0] / tile_width;
|
|
|
|
|
|
|
+ unsigned num_tiles_x = tilesheet.get_dimensions().width / tile_width;
|
|
|
// unsigned num_tiles_y = sheet_height / tile_height;
|
|
// unsigned num_tiles_y = sheet_height / tile_height;
|
|
|
Graphics::put_sprite(tilesheet, rect.x, rect.y,
|
|
Graphics::put_sprite(tilesheet, rect.x, rect.y,
|
|
|
Rect(tile_width * (id % num_tiles_x),
|
|
Rect(tile_width * (id % num_tiles_x),
|