aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/graphics.h
diff options
context:
space:
mode:
authorNicola Mettifogo2008-01-28 17:28:16 +0000
committerNicola Mettifogo2008-01-28 17:28:16 +0000
commit56eed45317dd643528b3980ff7f899fbf0be7bc4 (patch)
treea8bb8cc0e0ff47815d85ca37ad1e04bb8db1661a /engines/parallaction/graphics.h
parent3c2c16c705b41e0186cd203bc303a0902bf3059e (diff)
downloadscummvm-rg350-56eed45317dd643528b3980ff7f899fbf0be7bc4.tar.gz
scummvm-rg350-56eed45317dd643528b3980ff7f899fbf0be7bc4.tar.bz2
scummvm-rg350-56eed45317dd643528b3980ff7f899fbf0be7bc4.zip
Move low level background management into Gfx.
svn-id: r30681
Diffstat (limited to 'engines/parallaction/graphics.h')
-rw-r--r--engines/parallaction/graphics.h57
1 files changed, 56 insertions, 1 deletions
diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h
index 1af1d1e8ea..2791285320 100644
--- a/engines/parallaction/graphics.h
+++ b/engines/parallaction/graphics.h
@@ -152,6 +152,41 @@ public:
};
+
+struct PathBuffer {
+ // handles a 1-bit depth buffer used for masking non-walkable areas
+
+ uint16 w;
+ uint16 internalWidth;
+ uint16 h;
+ uint size;
+ byte *data;
+
+public:
+ PathBuffer() : w(0), internalWidth(0), h(0), size(0), data(0) {
+ }
+
+ void create(uint16 width, uint16 height) {
+ w = width;
+ internalWidth = w >> 3;
+ h = height;
+ size = (internalWidth * h);
+ data = (byte*)calloc(size, 1);
+ }
+
+ void free() {
+ ::free(data);
+ data = 0;
+ w = 0;
+ h = 0;
+ internalWidth = 0;
+ size = 0;
+ }
+
+ inline byte getValue(uint16 x, uint16 y);
+};
+
+
class Palette {
byte _data[768];
@@ -290,9 +325,25 @@ public:
void release();
};
-
typedef Common::List<GfxObj*> GfxObjList;
+struct BackgroundInfo {
+ uint width;
+ uint height;
+
+ Graphics::Surface bg;
+ MaskBuffer mask;
+ PathBuffer path;
+
+ Palette palette;
+};
+
+
+enum {
+ kBackgroundLocation = 1,
+ kBackgroundSlide = 2
+};
+
class Gfx {
public:
@@ -315,6 +366,10 @@ public:
void drawGfxObjects(Graphics::Surface &surf);
void sortAnimations();
+ BackgroundInfo *_backgroundInfo;
+ void freeBackground();
+ void setBackground(uint type, const char* name, const char* mask, const char* path);
+
public:
// balloons and text