summaryrefslogtreecommitdiff
path: root/src/resources/map/maplayer.cpp
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/maplayer.cpp
parentacb8d0c088c2d4368b73b3c1c1d7eb13bad49aa0 (diff)
downloadplus-6e052536a2dfb7f877a356477bc86c904aae1e71.tar.gz
plus-6e052536a2dfb7f877a356477bc86c904aae1e71.tar.bz2
plus-6e052536a2dfb7f877a356477bc86c904aae1e71.tar.xz
plus-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/maplayer.cpp')
-rw-r--r--src/resources/map/maplayer.cpp36
1 files changed, 21 insertions, 15 deletions
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)