From af706670e76cb59829f0e5f4e316ea424a8f53e7 Mon Sep 17 00:00:00 2001 From: Paul Merrill Date: Sat, 16 Jul 2011 17:05:25 -0700 Subject: [PATCH] area: fix compiler warnings --- src/area.cpp | 16 +++++++++------- src/entity.h | 6 +++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/area.cpp b/src/area.cpp index 381274d..a6bf4c5 100644 --- a/src/area.cpp +++ b/src/area.cpp @@ -207,8 +207,8 @@ coordcube_t Area::visibleTiles() const GameWindow* window = GameWindow::getWindow(); Gosu::Graphics* graphics = &window->graphics(); - int tileWidth = tilesets[0].tileDim.x; - int tileHeight = tilesets[0].tileDim.y; + long tileWidth = tilesets[0].tileDim.x; + long tileHeight = tilesets[0].tileDim.y; int windowWidth = graphics->width(); int windowHeight = graphics->height(); coord_t off = viewportOffset(); @@ -218,8 +218,10 @@ coordcube_t Area::visibleTiles() const tiles.y1 = -off.y / tileHeight; tiles.z1 = 0; - tiles.x2 = ceil((windowWidth - off.x) / (double)tileWidth); - tiles.y2 = ceil((windowHeight - off.y) / (double)tileHeight); + tiles.x2 = (long)ceil((double)(windowWidth - off.x) / + (double)tileWidth); + tiles.y2 = (long)ceil((double)(windowHeight - off.y) / + (double)tileHeight); tiles.z2 = 1; return tiles; } @@ -227,9 +229,9 @@ coordcube_t Area::visibleTiles() const bool Area::tileTypeOnScreen(const Area::TileType& search) const { coordcube_t tiles = visibleTiles(); - for (unsigned z = tiles.z1; z != tiles.z2; z++) { - for (unsigned y = tiles.y1; y != tiles.y2; y++) { - for (unsigned x = tiles.x1; x != tiles.x2; x++) { + for (long z = tiles.z1; z != tiles.z2; z++) { + for (long y = tiles.y1; y != tiles.y2; y++) { + for (long x = tiles.x1; x != tiles.x2; x++) { const Tile& tile = map[z][y][x]; const TileType* type = tile.type; if (type == &search) diff --git a/src/entity.h b/src/entity.h index 0628dd2..1060082 100644 --- a/src/entity.h +++ b/src/entity.h @@ -9,7 +9,6 @@ #include -#include #include #include @@ -71,9 +70,9 @@ public: // nearby Tiles. Doesn't change x,y,z position. void setArea(Area* area); +protected: SampleRef getSound(const std::string& name); -protected: bool processDescriptor(); bool processSprite(const xmlNode* sprite); bool processPhases(const xmlNode* phases); @@ -93,11 +92,12 @@ protected: Resourcer* rc; - boost::unordered_map sounds; boost::unordered_map imgs; ImageRef img; bool redraw; + boost::unordered_map sounds; + bool moving; coord_t dest; double speed; -- 2.11.4.GIT