summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-22 17:44:11 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-22 17:44:11 +0300
commit1995e723df5d5aef32b289c0122493ee6fe18b0e (patch)
treeb8dc80f75ac17732c80574fe40910d02e8b90a1b /src/gui/viewport.cpp
parent35263d0f161f59f2dec6586c61970eaf1ce2f6f1 (diff)
downloadManaVerse-1995e723df5d5aef32b289c0122493ee6fe18b0e.tar.gz
ManaVerse-1995e723df5d5aef32b289c0122493ee6fe18b0e.tar.bz2
ManaVerse-1995e723df5d5aef32b289c0122493ee6fe18b0e.tar.xz
ManaVerse-1995e723df5d5aef32b289c0122493ee6fe18b0e.zip
Move "map draw type" variable into settings.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index fb52607c7..5a2c9cc91 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -25,6 +25,7 @@
#include "actormanager.h"
#include "configuration.h"
#include "game.h"
+#include "settings.h"
#include "sdlshared.h"
#include "textmanager.h"
@@ -79,7 +80,6 @@ Viewport::Viewport() :
mMousePressY(0),
mPixelViewX(0),
mPixelViewY(0),
- mMapDrawType(MapType::NORMAL),
mCameraMode(0),
mLocalWalkTime(-1),
mCameraRelativeX(0),
@@ -241,14 +241,15 @@ void Viewport::draw(Graphics *graphics)
// Draw tiles and sprites
mMap->draw(graphics, mPixelViewX, mPixelViewY);
- if (mMapDrawType != MapType::NORMAL)
+ const MapType::MapType drawType = settings.mapDrawType;
+ if (drawType != MapType::NORMAL)
{
- if (mMapDrawType != MapType::SPECIAL4)
+ if (drawType != MapType::SPECIAL4)
{
mMap->drawCollision(graphics, mPixelViewX,
- mPixelViewY, mMapDrawType);
+ mPixelViewY, drawType);
}
- if (mMapDrawType == MapType::DEBUG)
+ if (drawType == MapType::DEBUG)
drawDebugPath(graphics);
}
@@ -1001,11 +1002,12 @@ void Viewport::mouseMoved(MouseEvent &event A_UNUSED)
void Viewport::toggleMapDrawType()
{
- mMapDrawType++;
- if (mMapDrawType > MapType::BLACKWHITE)
- mMapDrawType = MapType::NORMAL;
+ settings.mapDrawType = static_cast<MapType::MapType>(
+ static_cast<int>(settings.mapDrawType) + 1);
+ if (settings.mapDrawType > MapType::BLACKWHITE)
+ settings.mapDrawType = MapType::NORMAL;
if (mMap)
- mMap->setDrawLayersFlags(mMapDrawType);
+ mMap->setDrawLayersFlags(settings.mapDrawType);
}
void Viewport::toggleCameraMode()