aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorSven Hesse2012-07-08 00:19:48 +0200
committerSven Hesse2012-07-30 01:44:45 +0200
commit20a96733a5f982e427a9143ded14e2af418ac6df (patch)
treea8252febeb6337f129ebd69cfd6d2768b27e117e /engines
parentbaec4d87781d24786f0b76e83efee3bca7f9afea (diff)
downloadscummvm-rg350-20a96733a5f982e427a9143ded14e2af418ac6df.tar.gz
scummvm-rg350-20a96733a5f982e427a9143ded14e2af418ac6df.tar.bz2
scummvm-rg350-20a96733a5f982e427a9143ded14e2af418ac6df.zip
GOB: Add CMPFile::recolor() and ANIFile::recolor()
Diffstat (limited to 'engines')
-rw-r--r--engines/gob/anifile.cpp5
-rw-r--r--engines/gob/anifile.h3
-rw-r--r--engines/gob/cmpfile.cpp5
-rw-r--r--engines/gob/cmpfile.h2
4 files changed, 15 insertions, 0 deletions
diff --git a/engines/gob/anifile.cpp b/engines/gob/anifile.cpp
index e6bf30f4d7..085ac800cd 100644
--- a/engines/gob/anifile.cpp
+++ b/engines/gob/anifile.cpp
@@ -289,4 +289,9 @@ void ANIFile::drawLayer(Surface &dest, uint16 layer, uint16 part,
_layers[layer]->draw(dest, part, x, y, transp);
}
+void ANIFile::recolor(uint8 from, uint8 to) {
+ for (LayerArray::iterator l = _layers.begin(); l != _layers.end(); ++l)
+ (*l)->recolor(from, to);
+}
+
} // End of namespace Gob
diff --git a/engines/gob/anifile.h b/engines/gob/anifile.h
index b6d9c735b5..c930aafc6b 100644
--- a/engines/gob/anifile.h
+++ b/engines/gob/anifile.h
@@ -92,6 +92,9 @@ public:
/** Draw an animation frame. */
void draw(Surface &dest, uint16 animation, uint16 frame, int16 x, int16 y) const;
+ /** Recolor the animation sprites. */
+ void recolor(uint8 from, uint8 to);
+
private:
typedef Common::Array<CMPFile *> LayerArray;
typedef Common::Array<Animation> AnimationArray;
diff --git a/engines/gob/cmpfile.cpp b/engines/gob/cmpfile.cpp
index 1cd1375879..d304958f76 100644
--- a/engines/gob/cmpfile.cpp
+++ b/engines/gob/cmpfile.cpp
@@ -250,4 +250,9 @@ uint16 CMPFile::addSprite(uint16 left, uint16 top, uint16 right, uint16 bottom)
return _coordinates->add(left, top, right, bottom);
}
+void CMPFile::recolor(uint8 from, uint8 to) {
+ if (_surface)
+ _surface->recolor(from, to);
+}
+
} // End of namespace Gob
diff --git a/engines/gob/cmpfile.h b/engines/gob/cmpfile.h
index 2b669e4d38..9c858238af 100644
--- a/engines/gob/cmpfile.h
+++ b/engines/gob/cmpfile.h
@@ -70,6 +70,8 @@ public:
uint16 addSprite(uint16 left, uint16 top, uint16 right, uint16 bottom);
+ void recolor(uint8 from, uint8 to);
+
private:
GobEngine *_vm;