aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/pregob/pregob.cpp
diff options
context:
space:
mode:
authorSven Hesse2012-06-29 19:34:14 +0200
committerSven Hesse2012-07-30 01:44:43 +0200
commit412ae53854dc2ef352a3f3e990f0d2b56d97ad7e (patch)
tree819d646f01c5c080f0e97dae0f3a56aeb10bfef8 /engines/gob/pregob/pregob.cpp
parentaae8c607596d9ce228935c01297902381c8b442c (diff)
downloadscummvm-rg350-412ae53854dc2ef352a3f3e990f0d2b56d97ad7e.tar.gz
scummvm-rg350-412ae53854dc2ef352a3f3e990f0d2b56d97ad7e.tar.bz2
scummvm-rg350-412ae53854dc2ef352a3f3e990f0d2b56d97ad7e.zip
GOB: Add PreGob animation utility functions
Diffstat (limited to 'engines/gob/pregob/pregob.cpp')
-rw-r--r--engines/gob/pregob/pregob.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/engines/gob/pregob/pregob.cpp b/engines/gob/pregob/pregob.cpp
index 1c3fb8221c..b9c36d7cf8 100644
--- a/engines/gob/pregob/pregob.cpp
+++ b/engines/gob/pregob/pregob.cpp
@@ -29,6 +29,7 @@
#include "gob/palanim.h"
#include "gob/draw.h"
#include "gob/video.h"
+#include "gob/aniobject.h"
#include "gob/pregob/pregob.h"
@@ -181,4 +182,24 @@ bool PreGob::hasInput() {
return checkInput(mouseX, mouseY, mouseButtons) || (mouseButtons != kMouseButtonsNone);
}
+void PreGob::clearAnim(ANIObject &ani) {
+ int16 left, top, right, bottom;
+
+ if (ani.clear(*_vm->_draw->_backSurface, left, top, right, bottom))
+ _vm->_draw->dirtiedRect(_vm->_draw->_backSurface, left, top, right, bottom);
+}
+
+void PreGob::drawAnim(ANIObject &ani) {
+ int16 left, top, right, bottom;
+
+ if (ani.draw(*_vm->_draw->_backSurface, left, top, right, bottom))
+ _vm->_draw->dirtiedRect(_vm->_draw->_backSurface, left, top, right, bottom);
+ ani.advance();
+}
+
+void PreGob::redrawAnim(ANIObject &ani) {
+ clearAnim(ani);
+ drawAnim(ani);
+}
+
} // End of namespace Gob