aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/gob/scenery.cpp9
-rw-r--r--engines/gob/scenery.h4
-rw-r--r--engines/gob/scenery_v1.cpp13
-rw-r--r--engines/gob/scenery_v2.cpp4
4 files changed, 20 insertions, 10 deletions
diff --git a/engines/gob/scenery.cpp b/engines/gob/scenery.cpp
index 281049edb7..f15c25d30a 100644
--- a/engines/gob/scenery.cpp
+++ b/engines/gob/scenery.cpp
@@ -32,9 +32,7 @@
#include "gob/draw.h"
#include "gob/game.h"
#include "gob/global.h"
-#include "gob/util.h"
#include "gob/parse.h"
-#include "gob/cdrom.h"
namespace Gob {
@@ -393,13 +391,6 @@ int16 Scenery::loadAnim(char search) {
uint32 layerPos;
extData = 0;
- if (_vm->_cdrom->_cdPlaying) {
- while (_vm->_cdrom->getTrackPos() != -1)
- _vm->_util->longDelay(50);
-
- _vm->_cdrom->_cdPlaying = false;
- }
-
_vm->_inter->evalExpr(&sceneryIndex);
picsCount = _vm->_inter->load16();
resId = _vm->_inter->load16();
diff --git a/engines/gob/scenery.h b/engines/gob/scenery.h
index a7d581a5bf..a5769bb37a 100644
--- a/engines/gob/scenery.h
+++ b/engines/gob/scenery.h
@@ -129,10 +129,10 @@ public:
void freeStatic(int16 index);
void renderStatic(int16 scenery, int16 layer);
void updateStatic(int16 orderFrom);
- int16 loadAnim(char search);
void freeAnim(int16 animation);
void interStoreParams(void);
+ virtual int16 loadAnim(char search);
virtual void updateAnim(int16 layer, int16 frame, int16 animation,
int16 flags, int16 drawDeltaX, int16 drawDeltaY, char doDraw) = 0;
@@ -145,6 +145,7 @@ protected:
class Scenery_v1 : public Scenery {
public:
+ virtual int16 loadAnim(char search);
virtual void updateAnim(int16 layer, int16 frame, int16 animation,
int16 flags, int16 drawDeltaX, int16 drawDeltaY, char doDraw);
@@ -154,6 +155,7 @@ public:
class Scenery_v2 : public Scenery_v1 {
public:
+ virtual int16 loadAnim(char search);
virtual void updateAnim(int16 layer, int16 frame, int16 animation,
int16 flags, int16 drawDeltaX, int16 drawDeltaY, char doDraw);
diff --git a/engines/gob/scenery_v1.cpp b/engines/gob/scenery_v1.cpp
index e5a64f2321..5912d96100 100644
--- a/engines/gob/scenery_v1.cpp
+++ b/engines/gob/scenery_v1.cpp
@@ -29,12 +29,25 @@
#include "gob/anim.h"
#include "gob/draw.h"
#include "gob/game.h"
+#include "gob/util.h"
+#include "gob/cdrom.h"
namespace Gob {
Scenery_v1::Scenery_v1(GobEngine *vm) : Scenery(vm) {
}
+int16 Scenery_v1::loadAnim(char search) {
+ if (_vm->_cdrom->_cdPlaying) {
+ while (_vm->_cdrom->getTrackPos() != -1)
+ _vm->_util->longDelay(50);
+
+ _vm->_cdrom->_cdPlaying = false;
+ }
+
+ return Scenery::loadAnim(search);
+}
+
// flags & 1 - do capture all area animation is occupying
// flags & 4 == 0 - calculate animation final size
// flags & 2 != 0 - don't check with "toRedraw"'s
diff --git a/engines/gob/scenery_v2.cpp b/engines/gob/scenery_v2.cpp
index 6ceb5a88ae..5bac467501 100644
--- a/engines/gob/scenery_v2.cpp
+++ b/engines/gob/scenery_v2.cpp
@@ -35,6 +35,10 @@ namespace Gob {
Scenery_v2::Scenery_v2(GobEngine *vm) : Scenery_v1(vm) {
}
+int16 Scenery_v2::loadAnim(char search) {
+ return Scenery::loadAnim(search);
+}
+
// flags & 1 - do capture all area animation is occupying
// flags & 4 == 0 - calculate animation final size
// flags & 2 != 0 - don't check with "toRedraw"'s