diff options
author | Philipp Sehmisch <crush@themanaworld.org> | 2009-12-25 16:06:38 +0100 |
---|---|---|
committer | Philipp Sehmisch <crush@themanaworld.org> | 2009-12-25 16:06:38 +0100 |
commit | a31fce06e41ac33ca6ed12065644b314ceb4bcb3 (patch) | |
tree | fbe96aa70e14522e21223d92e892e1138363e9f5 /src/map.h | |
parent | 4f14fde764bf0624700e88f9fa7d5d84d543aaec (diff) | |
download | mana-a31fce06e41ac33ca6ed12065644b314ceb4bcb3.tar.gz mana-a31fce06e41ac33ca6ed12065644b314ceb4bcb3.tar.bz2 mana-a31fce06e41ac33ca6ed12065644b314ceb4bcb3.tar.xz mana-a31fce06e41ac33ca6ed12065644b314ceb4bcb3.zip |
Added support for map background images which work exactly like overlays, just that they are drawn before the tiles instead of afterwards. Renamed overlays to foregrounds (but kept backward compatibility intact)
Diffstat (limited to 'src/map.h')
-rw-r--r-- | src/map.h | 26 |
1 files changed, 20 insertions, 6 deletions
@@ -29,7 +29,7 @@ #include "properties.h" class Animation; -class AmbientOverlay; +class AmbientLayer; class Graphics; class Image; class MapLayer; @@ -172,10 +172,10 @@ class Map : public Properties ~Map(); /** - * Initialize map overlays. Should be called after all the properties + * Initialize ambient layers. Has to be called after all the properties * are set. */ - void initializeOverlays(); + void initializeAmbientLayers(); /** * Updates animations. Called as needed. @@ -295,10 +295,22 @@ class Map : public Properties TileAnimation *getAnimationForGid(int gid) const; private: + + enum LayerType + { + FOREGROUND_LAYERS, + BACKGROUND_LAYERS + }; + /** - * Draws the overlay graphic to the given graphics output. + * Updates scrolling of ambient layers. Has to be called each game tick. */ - void drawOverlay(Graphics *graphics, float scrollX, float scrollY, + void updateAmbientLayers(float scrollX, float scrollY); + + /** + * Draws the foreground or background layers to the given graphics output. + */ + void drawAmbientLayers(Graphics *graphics, LayerType type, float scrollX, float scrollY, int detail); /** @@ -323,7 +335,8 @@ class Map : public Properties int mOnClosedList, mOnOpenList; // Overlay data - std::list<AmbientOverlay*> mOverlays; + std::list<AmbientLayer*> mBackgrounds; + std::list<AmbientLayer*> mForegrounds; float mLastScrollX; float mLastScrollY; @@ -337,6 +350,7 @@ class Map : public Properties std::list<ParticleEffectData> particleEffects; std::map<int, TileAnimation*> mTileAnimations; + }; #endif |