X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Ftilemap.cpp;h=e845a2dbf60233dca857fde416e1766712f2583f;hb=4a54087f52d6a8a2e5b4c498e772685bb0885991;hp=578bb51c9d9f652b849786e0bde11f332048c9d2;hpb=37e3ad0ee2ec05d6bfebf611d45046b49fa33387;p=supertux.git diff --git a/src/object/tilemap.cpp b/src/object/tilemap.cpp index 578bb51c9..e845a2dbf 100644 --- a/src/object/tilemap.cpp +++ b/src/object/tilemap.cpp @@ -30,10 +30,10 @@ #include "tile.h" #include "resources.h" #include "tile_manager.h" -#include "app/globals.h" #include "lisp/lisp.h" #include "lisp/writer.h" #include "object_factory.h" +#include "main.h" TileMap::TileMap() : solid(false), speed(1), width(0), height(0), layer(LAYER_TILES), @@ -152,8 +152,8 @@ TileMap::draw(DrawingContext& context) if(start_x < 0) start_x = 0; float start_y = roundf(context.get_translation().y); if(start_y < 0) start_y = 0; - float end_x = std::min(start_x + screen->w, float(width * 32)); - float end_y = std::min(start_y + screen->h, float(height * 32)); + float end_x = std::min(start_x + SCREEN_WIDTH, float(width * 32)); + float end_y = std::min(start_y + SCREEN_HEIGHT, float(height * 32)); start_x -= int(start_x) % 32; start_y -= int(start_y) % 32; int tsx = int(start_x / 32); // tilestartindex x @@ -169,6 +169,7 @@ TileMap::draw(DrawingContext& context) } } +#if 0 if (debug_grid) { for (pos.x = start_x; pos.x < end_x; pos.x += 32) @@ -183,6 +184,7 @@ TileMap::draw(DrawingContext& context) Color(225, 225, 225), LAYER_GUI-50); } } +#endif context.pop_transform(); }