From 60745b8038b18d4b7b7198a03547676b92988426 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 4 Oct 2016 19:38:47 +0300 Subject: Move maplayerposition into enums directory. --- src/resources/map/map.cpp | 16 ++++++++++------ src/resources/map/map.h | 9 ++------- 2 files changed, 12 insertions(+), 13 deletions(-) (limited to 'src/resources/map') diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp index 2d6631aa5..f662bedac 100644 --- a/src/resources/map/map.cpp +++ b/src/resources/map/map.cpp @@ -352,7 +352,9 @@ void Map::draw(Graphics *restrict const graphics, static_cast(scrollY)); // Draw backgrounds - drawAmbientLayers(graphics, BACKGROUND_LAYERS, mOverlayDetail); + drawAmbientLayers(graphics, + MapLayerPosition::BACKGROUND_LAYERS, + mOverlayDetail); if (mDrawLayersFlags == MapType::BLACKWHITE && userPalette) { @@ -521,7 +523,9 @@ void Map::draw(Graphics *restrict const graphics, } } - drawAmbientLayers(graphics, FOREGROUND_LAYERS, mOverlayDetail); + drawAmbientLayers(graphics, + MapLayerPosition::FOREGROUND_LAYERS, + mOverlayDetail); BLOCK_END("Map::draw") } @@ -639,12 +643,12 @@ void Map::updateAmbientLayers(const float scrollX, } void Map::drawAmbientLayers(Graphics *restrict const graphics, - const LayerType type, + const MapLayerPositionT type, const int detail) const restrict2 { BLOCK_START("Map::drawAmbientLayers") // Detail 0 = no ambient effects except background image - if (detail <= 0 && type != BACKGROUND_LAYERS) + if (detail <= 0 && type != MapLayerPosition::BACKGROUND_LAYERS) { BLOCK_END("Map::drawAmbientLayers") return; @@ -654,10 +658,10 @@ void Map::drawAmbientLayers(Graphics *restrict const graphics, const AmbientLayerVector *restrict layers = nullptr; switch (type) { - case FOREGROUND_LAYERS: + case MapLayerPosition::FOREGROUND_LAYERS: layers = &mForegrounds; break; - case BACKGROUND_LAYERS: + case MapLayerPosition::BACKGROUND_LAYERS: layers = &mBackgrounds; break; default: diff --git a/src/resources/map/map.h b/src/resources/map/map.h index a1f8c9f5a..ef1a37afa 100644 --- a/src/resources/map/map.h +++ b/src/resources/map/map.h @@ -30,6 +30,7 @@ #include "enums/render/rendertype.h" #include "enums/resources/map/blocktype.h" +#include "enums/resources/map/maplayerposition.h" #include "enums/resources/map/maptype.h" #include "resources/memorycounter.h" @@ -381,12 +382,6 @@ class Map final : public Properties, void removeActor(const Actors::iterator &restrict iterator) restrict2; private: - enum LayerType - { - FOREGROUND_LAYERS = 0, - BACKGROUND_LAYERS - }; - /** * Updates scrolling of ambient layers. Has to be called each game tick. */ @@ -397,7 +392,7 @@ class Map final : public Properties, * Draws the foreground or background layers to the given graphics output. */ void drawAmbientLayers(Graphics *restrict const graphics, - const LayerType type, + const MapLayerPositionT type, const int detail) const restrict2 A_NONNULL(2); /** -- cgit v1.2.3-70-g09d2