From 6d9936d160b197fe68c5bb21972b197fb1b64ba4 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Wed, 25 May 2011 19:33:31 +0200 Subject: Refining switches in the debug view Reviewed-by: Bjorn --- src/map.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/map.cpp') diff --git a/src/map.cpp b/src/map.cpp index 8b1d7b26..0ffdb2ac 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -153,7 +153,7 @@ void MapLayer::draw(Graphics *graphics, int startX, int startY, } } - if (debugFlags != Map::MAP_SPECIAL3) + if (!(debugFlags & Map::MAP_SPECIAL3)) { const int py0 = y32 + dy; @@ -164,8 +164,7 @@ void MapLayer::draw(Graphics *graphics, int startX, int startY, { const int px = (x * 32) + dx; const int py = py0 - img->getHeight(); - if ((debugFlags != Map::MAP_SPECIAL - && debugFlags != Map::MAP_SPECIAL2) + if (!(debugFlags & (Map::MAP_SPECIAL1 | Map::MAP_SPECIAL2)) || img->getHeight() <= 32) { int width = 0; @@ -217,7 +216,7 @@ Map::Map(int width, int height, int tileWidth, int tileHeight): mWidth(width), mHeight(height), mTileWidth(tileWidth), mTileHeight(tileHeight), mMaxTileHeight(height), - mDebugFlags(MAP_NORMAL), + mDebugFlags(0), mOnClosedList(1), mOnOpenList(2), mLastScrollX(0.0f), mLastScrollY(0.0f) { @@ -363,7 +362,7 @@ void Map::draw(Graphics *graphics, int scrollX, int scrollY) bool overFringe = false; - if (mDebugFlags == MAP_SPECIAL3) + if (mDebugFlags & MAP_SPECIAL3) { for (; layeri != mLayers.end(); ++layeri) { @@ -380,7 +379,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 & MAP_SPECIAL2)) overFringe = true; (*layeri)->draw(graphics, @@ -436,7 +435,7 @@ void Map::drawCollision(Graphics *graphics, int scrollX, int scrollY, { graphics->setColor(gcn::Color(0, 0, 0, 64)); - if (debugFlags < MAP_SPECIAL) + if (debugFlags & MAP_GRID) { graphics->drawRectangle(gcn::Rectangle( x * mTileWidth - scrollX, @@ -444,6 +443,9 @@ void Map::drawCollision(Graphics *graphics, int scrollX, int scrollY, 33, 33)); } + if (!(debugFlags & MAP_COLLISION_TILES)) + continue; + if (!getWalk(x, y, BLOCKMASK_WALL)) { graphics->setColor(gcn::Color(0, 0, 200, 64)); -- cgit v1.2.3-70-g09d2