summaryrefslogtreecommitdiff
path: root/src/map.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-07-12 03:55:01 +0300
committerAndrei Karas <akaras@inbox.ru>2011-07-16 22:47:14 +0300
commitd0e6d477d245610288ab622ecf47426a9dcbc400 (patch)
treee998d168d8eb4397602021b3b1411f80cc1466a9 /src/map.h
parent68b1e0ec82321757f2a29792d38d7eabb7d2cf98 (diff)
downloadplus-d0e6d477d245610288ab622ecf47426a9dcbc400.tar.gz
plus-d0e6d477d245610288ab622ecf47426a9dcbc400.tar.bz2
plus-d0e6d477d245610288ab622ecf47426a9dcbc400.tar.xz
plus-d0e6d477d245610288ab622ecf47426a9dcbc400.zip
Add tiles caching for software mode.
Diffstat (limited to 'src/map.h')
-rw-r--r--src/map.h54
1 files changed, 47 insertions, 7 deletions
diff --git a/src/map.h b/src/map.h
index 290145f05..6832ed008 100644
--- a/src/map.h
+++ b/src/map.h
@@ -41,6 +41,7 @@
class Animation;
class AmbientLayer;
class Graphics;
+class GraphicsVertexes;
class MapLayer;
class Particle;
class SimpleAnimation;
@@ -49,8 +50,22 @@ class SpecialLayer;
class MapItem;
class ObjectsLayer;
+struct ImageVertexes;
+
typedef std::vector<Tileset*> Tilesets;
typedef std::vector<MapLayer*> Layers;
+typedef std::vector<ImageVertexes*> MepRowImages;
+
+class MapRowVertexes
+{
+ public:
+ MapRowVertexes()
+ { }
+
+ ~MapRowVertexes();
+
+ MepRowImages images;
+};
/**
* A meta tile stores additional information about a location on a tile map.
@@ -156,11 +171,29 @@ class MapLayer: public ConfigListener
* The given actors are only drawn when this layer is the fringe
* layer.
*/
- void draw(Graphics *graphics,
- int startX, int startY,
- int endX, int endY,
- int scrollX, int scrollY,
- int mDebugFlags) const;
+ void drawOGL(Graphics *graphics,
+ int startX, int startY,
+ int endX, int endY,
+ int scrollX, int scrollY,
+ int mDebugFlags);
+
+ void drawSDL(Graphics *graphics,
+ int startX, int startY,
+ int endX, int endY,
+ int scrollX, int scrollY,
+ int mDebugFlags);
+
+ void updateOGL(Graphics *graphics,
+ int startX, int startY,
+ int endX, int endY,
+ int scrollX, int scrollY,
+ int mDebugFlags);
+
+ void updateSDL(Graphics *graphics,
+ int startX, int startY,
+ int endX, int endY,
+ int scrollX, int scrollY,
+ int mDebugFlags);
void drawFringe(Graphics *graphics,
int startX, int startY,
@@ -204,6 +237,8 @@ class MapLayer: public ConfigListener
// int *mTilesCount;
SpecialLayer *mSpecialLayer;
SpecialLayer *mTempLayer;
+ typedef std::vector<MapRowVertexes*> MapRows;
+ MapRows mTempRows;
};
/**
@@ -533,8 +568,8 @@ class Map : public Properties, public ConfigListener
// Overlay data
std::vector<AmbientLayer*> mBackgrounds;
std::vector<AmbientLayer*> mForegrounds;
- float mLastScrollX;
- float mLastScrollY;
+ float mLastAScrollX;
+ float mLastAScrollY;
// bool mSpritesUpdated;
// Particle effect data
@@ -567,6 +602,11 @@ class Map : public Properties, public ConfigListener
SpecialLayer *mTempLayer;
ObjectsLayer *mObjects;
MapLayer *mFringeLayer;
+
+ int mLastX;
+ int mLastY;
+ int mLastScrollX;
+ int mLastScrollY;
};