aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/nebular/nebular_scenes3.cpp24
-rw-r--r--engines/mads/nebular/nebular_scenes3.h12
2 files changed, 28 insertions, 8 deletions
diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp
index ff965ed5cb..ba1af6ed0b 100644
--- a/engines/mads/nebular/nebular_scenes3.cpp
+++ b/engines/mads/nebular/nebular_scenes3.cpp
@@ -492,6 +492,8 @@ Scene307::Scene307(MADSEngine *vm) : Scene3xx(vm) {
_prisonerTimer = 0;
_subQuote2 = "";
+
+ _forceField.init();
}
void Scene307::synchronize(Common::Serializer &s) {
@@ -1188,9 +1190,8 @@ void Scene307::actions() {
/*------------------------------------------------------------------------*/
-void Scene308::setup() {
- setPlayerSpritesPrefix();
- setAAName();
+Scene308::Scene308(MADSEngine *vm) : Scene3xx(vm) {
+ _forceField.init();
}
void Scene308::synchronize(Common::Serializer &s) {
@@ -1199,6 +1200,12 @@ void Scene308::synchronize(Common::Serializer &s) {
_forceField.synchronize(s);
}
+
+void Scene308::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
void Scene308::enter() {
_globals._spriteIndexes[1] = _scene->_sprites.addSprites("*SC003x0");
_globals._spriteIndexes[0] = _scene->_sprites.addSprites("*SC003x1");
@@ -1324,6 +1331,7 @@ Scene309::Scene309(MADSEngine *vm) : Scene3xx(vm) {
}
_lastFrame = -1;
+ _forceField.init();
}
void Scene309::synchronize(Common::Serializer &s) {
@@ -1523,9 +1531,8 @@ void Scene309::step() {
/*------------------------------------------------------------------------*/
-void Scene310::setup() {
- setPlayerSpritesPrefix();
- setAAName();
+Scene310::Scene310(MADSEngine *vm) : Scene3xx(vm) {
+ _forceField.init();
}
void Scene310::synchronize(Common::Serializer &s) {
@@ -1534,6 +1541,11 @@ void Scene310::synchronize(Common::Serializer &s) {
_forceField.synchronize(s);
}
+void Scene310::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
void Scene310::enter() {
_globals._spriteIndexes[1] = _scene->_sprites.addSprites("*SC003x0");
_globals._spriteIndexes[0] = _scene->_sprites.addSprites("*SC003x1");
diff --git a/engines/mads/nebular/nebular_scenes3.h b/engines/mads/nebular/nebular_scenes3.h
index d44a81520a..9efd38e9a4 100644
--- a/engines/mads/nebular/nebular_scenes3.h
+++ b/engines/mads/nebular/nebular_scenes3.h
@@ -39,6 +39,14 @@ typedef struct {
int _seqId[40];
uint32 _timer;
+ void init() {
+ _flag = false;
+ _vertical = _horizontal = -1;
+ _timer = 0;
+ for (int i = 0; i < 40; ++i)
+ _seqId[i] = -1;
+ }
+
void synchronize(Common::Serializer &s) {
s.syncAsByte(_flag);
s.syncAsSint32LE(_vertical);
@@ -167,7 +175,7 @@ private:
ForceField _forceField;
public:
- Scene308(MADSEngine *vm) : Scene3xx(vm) {}
+ Scene308(MADSEngine *vm);
virtual void synchronize(Common::Serializer &s);
virtual void setup();
@@ -196,7 +204,7 @@ private:
ForceField _forceField;
public:
- Scene310(MADSEngine *vm) : Scene3xx(vm) {}
+ Scene310(MADSEngine *vm);
virtual void synchronize(Common::Serializer &s);
virtual void setup();