diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-09-14 01:11:56 +0800 |
---|---|---|
committer | Yohann Ferreira <yohann.ferreira@orange.fr> | 2011-09-16 07:10:20 +0800 |
commit | d4584d81599f90b54cbc0fdd1c55b8ab0d5f0d68 (patch) | |
tree | 545100f845387ad515358c4f5d00c50fa5450ad5 | |
parent | d6248271842aa6edc26135568d92150f69491292 (diff) | |
download | mana-d4584d81599f90b54cbc0fdd1c55b8ab0d5f0d68.tar.gz mana-d4584d81599f90b54cbc0fdd1c55b8ab0d5f0d68.tar.bz2 mana-d4584d81599f90b54cbc0fdd1c55b8ab0d5f0d68.tar.xz mana-d4584d81599f90b54cbc0fdd1c55b8ab0d5f0d68.zip |
Renamed Map::DebugFlags enumerators
Their name is a bit more clear with DEBUG prefix rather than MAP
prefix. They're already scoped in the Map class anyway.
MAP_NORMAL was changed to DEBUG_NONE to represent no debug flags.
Acked-by: Bertram
-rw-r--r-- | src/gui/debugwindow.cpp | 18 | ||||
-rw-r--r-- | src/gui/viewport.cpp | 10 | ||||
-rw-r--r-- | src/map.cpp | 14 | ||||
-rw-r--r-- | src/map.h | 26 |
4 files changed, 34 insertions, 34 deletions
diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp index f1b24a49..06d50d5c 100644 --- a/src/gui/debugwindow.cpp +++ b/src/gui/debugwindow.cpp @@ -181,23 +181,23 @@ public: int flags = 0; if (mGrid->isSelected()) - flags |= Map::MAP_GRID; + flags |= Map::DEBUG_GRID; if (mCollisionTiles->isSelected()) - flags |= Map::MAP_COLLISION_TILES; + flags |= Map::DEBUG_COLLISION_TILES; if (mBeingCollisionRadius->isSelected()) - flags |= Map::MAP_BEING_COLLISION_RADIUS; + flags |= Map::DEBUG_BEING_COLLISION_RADIUS; if (mBeingPosition->isSelected()) - flags |= Map::MAP_BEING_POSITION; + flags |= Map::DEBUG_BEING_POSITION; if (mBeingPath->isSelected()) - flags |= Map::MAP_BEING_PATH; + flags |= Map::DEBUG_BEING_PATH; if (mMousePath->isSelected()) - flags |= Map::MAP_MOUSE_PATH; + flags |= Map::DEBUG_MOUSE_PATH; if (mSpecial1->isSelected()) - flags |= Map::MAP_SPECIAL1; + flags |= Map::DEBUG_SPECIAL1; if (mSpecial2->isSelected()) - flags |= Map::MAP_SPECIAL2; + flags |= Map::DEBUG_SPECIAL2; if (mSpecial3->isSelected()) - flags |= Map::MAP_SPECIAL3; + flags |= Map::DEBUG_SPECIAL3; viewport->setShowDebugPath(flags); } diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 945be7de..1fa60808 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -201,7 +201,7 @@ void Viewport::draw(gcn::Graphics *gcnGraphics) if (mDebugFlags) { - if (mDebugFlags & (Map::MAP_GRID | Map::MAP_COLLISION_TILES)) + if (mDebugFlags & (Map::DEBUG_GRID | Map::DEBUG_COLLISION_TILES)) { mMap->drawCollision(graphics, (int) mPixelViewX, (int) mPixelViewY, mDebugFlags); @@ -294,7 +294,7 @@ void Viewport::_followMouse() void Viewport::_drawDebugPath(Graphics *graphics) { - if (mDebugFlags & Map::MAP_MOUSE_PATH) + if (mDebugFlags & Map::DEBUG_MOUSE_PATH) { // Get the current mouse position SDL_GetMouseState(&mMouseX, &mMouseY); @@ -359,7 +359,7 @@ void Viewport::_drawDebugPath(Graphics *graphics) const Vector &beingPos = being->getPosition(); graphics->setColor(gcn::Color(128, 128, 0, 150)); - if (mDebugFlags & Map::MAP_BEING_COLLISION_RADIUS) + if (mDebugFlags & Map::DEBUG_BEING_COLLISION_RADIUS) { const int radius = being->getCollisionRadius(); graphics->fillRectangle(gcn::Rectangle( @@ -370,10 +370,10 @@ void Viewport::_drawDebugPath(Graphics *graphics) radius * 2, radius * 2)); } - if (mDebugFlags & Map::MAP_BEING_PATH) + if (mDebugFlags & Map::DEBUG_BEING_PATH) _drawPath(graphics, being->getPath(), gcn::Color(0, 0, 255, 150)); - if (mDebugFlags & Map::MAP_BEING_POSITION) + if (mDebugFlags & Map::DEBUG_BEING_POSITION) { // Draw the absolute x, y position using a cross. graphics->setColor(gcn::Color(0, 0, 255, 255)); diff --git a/src/map.cpp b/src/map.cpp index 3e5e8e12..525f5a20 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -158,7 +158,7 @@ void MapLayer::draw(Graphics *graphics, } } - if (!(debugFlags & Map::MAP_SPECIAL3)) + if (!(debugFlags & Map::DEBUG_SPECIAL3)) { const int py0 = pixelY + dy; @@ -169,7 +169,7 @@ void MapLayer::draw(Graphics *graphics, { const int px = (x * mMap->getTileWidth()) + dx; const int py = py0 - img->getHeight(); - if (!(debugFlags & (Map::MAP_SPECIAL1 | Map::MAP_SPECIAL2)) + if (!(debugFlags & (Map::DEBUG_SPECIAL1 | Map::DEBUG_SPECIAL2)) || img->getHeight() <= mMap->getTileHeight()) { int width = 0; @@ -222,7 +222,7 @@ Map::Map(int width, int height, int tileWidth, int tileHeight): mTileWidth(tileWidth), mTileHeight(tileHeight), mMaxTileHeight(tileHeight), mMaxTileWidth(tileWidth), - mDebugFlags(MAP_NORMAL), + mDebugFlags(DEBUG_NONE), mOnClosedList(1), mOnOpenList(2), mLastScrollX(0.0f), mLastScrollY(0.0f) { @@ -370,7 +370,7 @@ void Map::draw(Graphics *graphics, int scrollX, int scrollY) bool overFringe = false; - if (mDebugFlags & MAP_SPECIAL3) + if (mDebugFlags & DEBUG_SPECIAL3) { for (; layeri != mLayers.end(); ++layeri) { @@ -387,7 +387,7 @@ void Map::draw(Graphics *graphics, int scrollX, int scrollY) { for (; layeri != mLayers.end() && !overFringe; ++layeri) { - if ((*layeri)->isFringeLayer() && (mDebugFlags & MAP_SPECIAL2)) + if ((*layeri)->isFringeLayer() && (mDebugFlags & DEBUG_SPECIAL2)) overFringe = true; (*layeri)->draw(graphics, @@ -443,7 +443,7 @@ void Map::drawCollision(Graphics *graphics, int scrollX, int scrollY, { graphics->setColor(gcn::Color(0, 0, 0, 64)); - if (debugFlags & MAP_GRID) + if (debugFlags & DEBUG_GRID) { graphics->drawRectangle(gcn::Rectangle( x * mTileWidth - scrollX, @@ -451,7 +451,7 @@ void Map::drawCollision(Graphics *graphics, int scrollX, int scrollY, mTileWidth + 1, mTileHeight + 1)); } - if (!(debugFlags & MAP_COLLISION_TILES)) + if (!(debugFlags & DEBUG_COLLISION_TILES)) continue; if (!getWalk(x, y, BLOCKMASK_WALL)) @@ -123,7 +123,7 @@ class MapLayer int endX, int endY, int scrollX, int scrollY, const Actors &actors, - int mDebugFlags) const; + int debugFlags) const; bool isFringeLayer() { return mIsFringeLayer; } @@ -162,16 +162,16 @@ class Map : public Properties enum DebugFlags { - MAP_NORMAL = 0x0, - MAP_GRID = 0x1, - MAP_COLLISION_TILES = 0x2, - MAP_BEING_COLLISION_RADIUS = 0x4, - MAP_BEING_POSITION = 0x8, - MAP_BEING_PATH = 0x10, - MAP_MOUSE_PATH = 0x20, - MAP_SPECIAL1 = 0x40, - MAP_SPECIAL2 = 0x80, - MAP_SPECIAL3 = 0x100 + DEBUG_NONE = 0x0, + DEBUG_GRID = 0x1, + DEBUG_COLLISION_TILES = 0x2, + DEBUG_BEING_COLLISION_RADIUS = 0x4, + DEBUG_BEING_POSITION = 0x8, + DEBUG_BEING_PATH = 0x10, + DEBUG_MOUSE_PATH = 0x20, + DEBUG_SPECIAL1 = 0x40, + DEBUG_SPECIAL2 = 0x80, + DEBUG_SPECIAL3 = 0x100 }; /** @@ -324,9 +324,9 @@ class Map : public Properties void addAnimation(int gid, TileAnimation *animation) { mTileAnimations[gid] = animation; } - void setDebugFlags(int n) {mDebugFlags = n;} + void setDebugFlags(int flags) { mDebugFlags = flags; } - int getDebugFlags() const {return mDebugFlags;} + int getDebugFlags() const { return mDebugFlags; } /** * Gets the tile animation for a specific gid |