summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2011-05-25 19:33:31 +0200
committerStefan Dombrowski <stefan@uni-bonn.de>2011-05-25 19:33:31 +0200
commit6d9936d160b197fe68c5bb21972b197fb1b64ba4 (patch)
tree6d432d9a359b63c281fca4fad8d98014d378364e /src/map.cpp
parented330a647d303152256f12917f18ece19332f683 (diff)
downloadmana-6d9936d160b197fe68c5bb21972b197fb1b64ba4.tar.gz
mana-6d9936d160b197fe68c5bb21972b197fb1b64ba4.tar.bz2
mana-6d9936d160b197fe68c5bb21972b197fb1b64ba4.tar.xz
mana-6d9936d160b197fe68c5bb21972b197fb1b64ba4.zip
Refining switches in the debug view
Reviewed-by: Bjorn
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp16
1 files changed, 9 insertions, 7 deletions
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));