summaryrefslogtreecommitdiff
path: root/src/map.h
diff options
context:
space:
mode:
authorPhilipp Sehmisch <crush@themanaworld.org>2009-12-25 16:06:38 +0100
committerPhilipp Sehmisch <crush@themanaworld.org>2009-12-25 16:06:38 +0100
commita31fce06e41ac33ca6ed12065644b314ceb4bcb3 (patch)
treefbe96aa70e14522e21223d92e892e1138363e9f5 /src/map.h
parent4f14fde764bf0624700e88f9fa7d5d84d543aaec (diff)
downloadMana-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.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/map.h b/src/map.h
index b4a8c7af..f69d3d33 100644
--- a/src/map.h
+++ b/src/map.h
@@ -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