summaryrefslogtreecommitdiff
path: root/src/resources/map
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-09 11:49:46 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-09 11:49:46 +0300
commit6e052536a2dfb7f877a356477bc86c904aae1e71 (patch)
treecfe31d967d591a99609eea758bb2823769ab9edb /src/resources/map
parentacb8d0c088c2d4368b73b3c1c1d7eb13bad49aa0 (diff)
downloadmanaverse-6e052536a2dfb7f877a356477bc86c904aae1e71.tar.gz
manaverse-6e052536a2dfb7f877a356477bc86c904aae1e71.tar.bz2
manaverse-6e052536a2dfb7f877a356477bc86c904aae1e71.tar.xz
manaverse-6e052536a2dfb7f877a356477bc86c904aae1e71.zip
Add empty map mode without collisions.
Mode can be switched from yellow bar. Also renamed map draw type related variables and methods.
Diffstat (limited to 'src/resources/map')
-rw-r--r--src/resources/map/map.cpp18
-rw-r--r--src/resources/map/map.h10
-rw-r--r--src/resources/map/maplayer.cpp36
-rw-r--r--src/resources/map/maplayer.h8
-rw-r--r--src/resources/map/maptype.h3
5 files changed, 42 insertions, 33 deletions
diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp
index 3d13ba2e5..e588d12bc 100644
--- a/src/resources/map/map.cpp
+++ b/src/resources/map/map.cpp
@@ -89,7 +89,7 @@ Map::Map(const int width, const int height,
mTilesets(),
mActors(),
mHasWarps(false),
- mDebugFlags(MapType::NORMAL),
+ mDrawLayersFlags(MapType::NORMAL),
mOnClosedList(1),
mOnOpenList(2),
mBackgrounds(),
@@ -340,7 +340,7 @@ void Map::draw(Graphics *const graphics, int scrollX, int scrollY)
// Draw backgrounds
drawAmbientLayers(graphics, BACKGROUND_LAYERS, mOverlayDetail);
- if (mDebugFlags == MapType::BLACKWHITE && userPalette)
+ if (mDrawLayersFlags == MapType::BLACKWHITE && userPalette)
{
graphics->setColor(userPalette->getColorWithAlpha(
UserPalette::WALKABLE_HIGHLIGHT));
@@ -378,14 +378,16 @@ void Map::draw(Graphics *const graphics, int scrollX, int scrollY)
}
#endif
- if (mDebugFlags == MapType::SPECIAL3 || mDebugFlags == MapType::BLACKWHITE)
+ if (mDrawLayersFlags == MapType::SPECIAL3
+ || mDrawLayersFlags == MapType::SPECIAL4
+ || mDrawLayersFlags == MapType::BLACKWHITE)
{
if (mFringeLayer)
{
mFringeLayer->setSpecialLayer(mSpecialLayer);
mFringeLayer->setTempLayer(mTempLayer);
mFringeLayer->drawFringe(graphics, startX, startY, endX, endY,
- scrollX, scrollY, &mActors, mDebugFlags, mActorFixY);
+ scrollX, scrollY, &mActors, mDrawLayersFlags, mActorFixY);
}
}
else
@@ -403,11 +405,11 @@ void Map::draw(Graphics *const graphics, int scrollX, int scrollY)
{
layer->setSpecialLayer(mSpecialLayer);
layer->setTempLayer(mTempLayer);
- if (mDebugFlags == MapType::SPECIAL2)
+ if (mDrawLayersFlags == MapType::SPECIAL2)
overFringe = true;
layer->drawFringe(graphics, startX, startY, endX, endY,
- scrollX, scrollY, &mActors, mDebugFlags, mActorFixY);
+ scrollX, scrollY, &mActors, mDrawLayersFlags, mActorFixY);
}
else
{
@@ -419,7 +421,7 @@ void Map::draw(Graphics *const graphics, int scrollX, int scrollY)
if (updateFlag)
{
layer->updateOGL(graphics, startX, startY,
- endX, endY, scrollX, scrollY, mDebugFlags);
+ endX, endY, scrollX, scrollY, mDrawLayersFlags);
}
layer->drawOGL(graphics);
@@ -428,7 +430,7 @@ void Map::draw(Graphics *const graphics, int scrollX, int scrollY)
#endif
{
layer->draw(graphics, startX, startY, endX, endY,
- scrollX, scrollY, mDebugFlags);
+ scrollX, scrollY, mDrawLayersFlags);
}
}
}
diff --git a/src/resources/map/map.h b/src/resources/map/map.h
index e8be23ca4..cf2d0c1e9 100644
--- a/src/resources/map/map.h
+++ b/src/resources/map/map.h
@@ -217,11 +217,11 @@ class Map final : public Properties, public ConfigListener
void addAnimation(const int gid, TileAnimation *const animation)
{ mTileAnimations[gid] = animation; }
- void setDebugFlags(const int n)
- { mDebugFlags = n; }
+ void setDrawLayersFlags(const int n)
+ { mDrawLayersFlags = n; }
- int getDebugFlags() const A_WARN_UNUSED
- { return mDebugFlags; }
+ int getDrawLayersFlags() const A_WARN_UNUSED
+ { return mDrawLayersFlags; }
void addExtraLayer();
@@ -380,7 +380,7 @@ class Map final : public Properties, public ConfigListener
bool mHasWarps;
// debug flags
- int mDebugFlags;
+ int mDrawLayersFlags;
// Pathfinding members
unsigned int mOnClosedList;
diff --git a/src/resources/map/maplayer.cpp b/src/resources/map/maplayer.cpp
index 2b8d4b514..308e27c86 100644
--- a/src/resources/map/maplayer.cpp
+++ b/src/resources/map/maplayer.cpp
@@ -92,7 +92,7 @@ void MapLayer::setTile(const int x, const int y, Image *const img)
void MapLayer::draw(Graphics *const graphics,
int startX, int startY, int endX, int endY,
const int scrollX, const int scrollY,
- const int debugFlags) const
+ const int layerDrawFlags) const
{
if (!player_node)
return;
@@ -114,8 +114,9 @@ void MapLayer::draw(Graphics *const graphics,
const int dx = (mX * mapTileSize) - scrollX;
const int dy = (mY * mapTileSize) - scrollY + mapTileSize;
- const bool flag = (debugFlags != MapType::SPECIAL
- && debugFlags != MapType::SPECIAL2);
+ const bool flag = (layerDrawFlags != MapType::SPECIAL
+ && layerDrawFlags != MapType::SPECIAL2
+ && layerDrawFlags != MapType::SPECIAL4);
for (int y = startY; y < endY; y++)
{
@@ -185,7 +186,7 @@ void MapLayer::updateSDL(const Graphics *const graphics,
int startX, int startY,
int endX, int endY,
const int scrollX, const int scrollY,
- const int debugFlags)
+ const int layerDrawFlags)
{
BLOCK_START("MapLayer::updateSDL")
delete_all(mTempRows);
@@ -207,8 +208,9 @@ void MapLayer::updateSDL(const Graphics *const graphics,
const int dx = (mX * mapTileSize) - scrollX;
const int dy = (mY * mapTileSize) - scrollY + mapTileSize;
- const bool flag = (debugFlags != MapType::SPECIAL
- && debugFlags != MapType::SPECIAL2);
+ const bool flag = (layerDrawFlags != MapType::SPECIAL
+ && layerDrawFlags != MapType::SPECIAL2
+ && layerDrawFlags != MapType::SPECIAL4);
for (int y = startY; y < endY; y++)
{
@@ -250,7 +252,7 @@ void MapLayer::updateOGL(Graphics *const graphics,
int startX, int startY,
int endX, int endY,
const int scrollX, const int scrollY,
- const int debugFlags)
+ const int layerDrawFlags)
{
BLOCK_START("MapLayer::updateOGL")
delete_all(mTempRows);
@@ -272,8 +274,9 @@ void MapLayer::updateOGL(Graphics *const graphics,
const int dx = (mX * mapTileSize) - scrollX;
const int dy = (mY * mapTileSize) - scrollY + mapTileSize;
- const bool flag = (debugFlags != MapType::SPECIAL
- && debugFlags != MapType::SPECIAL2);
+ const bool flag = (layerDrawFlags != MapType::SPECIAL
+ && layerDrawFlags != MapType::SPECIAL2
+ && layerDrawFlags != MapType::SPECIAL4);
MapRowVertexes *const row = new MapRowVertexes();
mTempRows.push_back(row);
@@ -365,7 +368,7 @@ void MapLayer::drawFringe(Graphics *const graphics, int startX, int startY,
int endX, int endY,
const int scrollX, const int scrollY,
const Actors *const actors,
- const int debugFlags, const int yFix) const
+ const int layerDrawFlags, const int yFix) const
{
BLOCK_START("MapLayer::drawFringe")
if (!player_node || !mSpecialLayer || !mTempLayer)
@@ -413,8 +416,9 @@ void MapLayer::drawFringe(Graphics *const graphics, int startX, int startY,
}
BLOCK_END("MapLayer::drawFringe drawmobs")
- if (debugFlags == MapType::SPECIAL3
- || debugFlags == MapType::BLACKWHITE)
+ if (layerDrawFlags == MapType::SPECIAL3
+ || layerDrawFlags == MapType::SPECIAL4
+ || layerDrawFlags == MapType::BLACKWHITE)
{
if (y < specialHeight)
{
@@ -463,8 +467,9 @@ void MapLayer::drawFringe(Graphics *const graphics, int startX, int startY,
{
const int px = x32 + dx;
const int py = py0 - img->mBounds.h;
- if ((debugFlags != MapType::SPECIAL
- && debugFlags != MapType::SPECIAL2)
+ if ((layerDrawFlags != MapType::SPECIAL
+ && layerDrawFlags != MapType::SPECIAL2
+ && layerDrawFlags != MapType::SPECIAL4)
|| img->mBounds.h <= mapTileSize)
{
int width = 0;
@@ -522,7 +527,8 @@ void MapLayer::drawFringe(Graphics *const graphics, int startX, int startY,
}
// Draw any remaining actors
- if (debugFlags != MapType::SPECIAL3)
+ if (layerDrawFlags != MapType::SPECIAL3
+ && layerDrawFlags != MapType::SPECIAL4)
{
BLOCK_START("MapLayer::drawFringe drawmobs")
while (ai != ai_end)
diff --git a/src/resources/map/maplayer.h b/src/resources/map/maplayer.h
index e82aa5870..f91134c77 100644
--- a/src/resources/map/maplayer.h
+++ b/src/resources/map/maplayer.h
@@ -89,7 +89,7 @@ class MapLayer final: public ConfigListener
void draw(Graphics *const graphics,
int startX, int startY, int endX, int endY,
const int scrollX, const int scrollY,
- const int mDebugFlags) const;
+ const int layerDrawFlags) const;
void drawSDL(Graphics *const graphics);
@@ -100,21 +100,21 @@ class MapLayer final: public ConfigListener
int startX, int startY,
int endX, int endY,
const int scrollX, const int scrollY,
- const int mDebugFlags);
+ const int layerDrawFlags);
#endif
void updateSDL(const Graphics *const graphics,
int startX, int startY,
int endX, int endY,
const int scrollX, const int scrollY,
- const int mDebugFlags);
+ const int layerDrawFlags);
void drawFringe(Graphics *const graphics,
int startX, int startY,
int endX, int endY,
const int scrollX, const int scrollY,
const Actors *const actors,
- const int mDebugFlags, const int yFix) const;
+ const int layerDrawFlags, const int yFix) const;
bool isFringeLayer() const A_WARN_UNUSED
{ return mIsFringeLayer; }
diff --git a/src/resources/map/maptype.h b/src/resources/map/maptype.h
index 9580cdd1f..9894fe631 100644
--- a/src/resources/map/maptype.h
+++ b/src/resources/map/maptype.h
@@ -32,7 +32,8 @@ namespace MapType
SPECIAL = 2,
SPECIAL2 = 3,
SPECIAL3 = 4,
- BLACKWHITE = 5
+ SPECIAL4 = 5,
+ BLACKWHITE = 6
};
}