aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Hesse2009-06-22 10:15:52 +0000
committerSven Hesse2009-06-22 10:15:52 +0000
commitb6a26911a3a65e47a56e97d5e43c3ec0ae3f825c (patch)
tree691807c0375aaa9361d3920a8c6840c966c27729
parent82568c66b1a5408050dbc2e2b659a0a92aa35ef2 (diff)
downloadscummvm-rg350-b6a26911a3a65e47a56e97d5e43c3ec0ae3f825c.tar.gz
scummvm-rg350-b6a26911a3a65e47a56e97d5e43c3ec0ae3f825c.tar.bz2
scummvm-rg350-b6a26911a3a65e47a56e97d5e43c3ec0ae3f825c.zip
Giving CollisionArea a full-blown Script pointer instead the data pointer
svn-id: r41757
-rw-r--r--engines/gob/game.h3
-rw-r--r--engines/gob/game_v1.cpp3
-rw-r--r--engines/gob/game_v2.cpp3
-rw-r--r--engines/gob/game_v6.cpp25
4 files changed, 12 insertions, 22 deletions
diff --git a/engines/gob/game.h b/engines/gob/game.h
index 26881c2253..44aca51fd1 100644
--- a/engines/gob/game.h
+++ b/engines/gob/game.h
@@ -48,8 +48,7 @@ public:
uint16 funcEnter;
uint16 funcLeave;
uint16 funcSub;
- byte *totFileData;
- uint32 totSize;
+ Script *script;
} PACKED_STRUCT;
#define szGame_TotTextItem (2 + 2)
diff --git a/engines/gob/game_v1.cpp b/engines/gob/game_v1.cpp
index b456e5aaeb..f038c7edc3 100644
--- a/engines/gob/game_v1.cpp
+++ b/engines/gob/game_v1.cpp
@@ -280,8 +280,7 @@ int16 Game_v1::addNewCollision(int16 id, uint16 left, uint16 top,
ptr->funcEnter = funcEnter;
ptr->funcLeave = funcLeave;
ptr->funcSub = funcSub;
- ptr->totFileData = 0;
- ptr->totSize = 0;
+ ptr->script = 0;
return i;
}
diff --git a/engines/gob/game_v2.cpp b/engines/gob/game_v2.cpp
index b9cda4832a..ace842f18e 100644
--- a/engines/gob/game_v2.cpp
+++ b/engines/gob/game_v2.cpp
@@ -331,8 +331,7 @@ int16 Game_v2::addNewCollision(int16 id, uint16 left, uint16 top,
ptr->funcEnter = funcEnter;
ptr->funcLeave = funcLeave;
ptr->funcSub = funcSub;
- ptr->totFileData = 0;
- ptr->totSize = 0;
+ ptr->script = 0;
return i;
}
diff --git a/engines/gob/game_v6.cpp b/engines/gob/game_v6.cpp
index 7396901943..b472b58ca1 100644
--- a/engines/gob/game_v6.cpp
+++ b/engines/gob/game_v6.cpp
@@ -148,8 +148,7 @@ int16 Game_v6::addNewCollision(int16 id, uint16 left, uint16 top,
ptr->funcEnter = funcEnter;
ptr->funcLeave = funcLeave;
ptr->funcSub = funcSub;
- ptr->totFileData = _script->getData();
- ptr->totSize = _script->getSize();
+ ptr->script = _script;
return i;
}
@@ -925,20 +924,13 @@ void Game_v6::setCollisions(byte arg_0) {
if (collArea->flags & 0x80)
continue;
- byte *totFileData = collArea->totFileData;
- uint32 totSize = collArea->totSize;
+ Script *curScript = _script;
- if (!totFileData || (totSize == 0)) {
- totFileData = _script->getData();
- totSize = _script->getSize();
- }
-
- uint32 savedPos = _script->pos();
- byte *savedData = _script->getData();
- uint32 savedSize = _script->getSize();
+ _script = collArea->script;
+ if (!_script)
+ _script = curScript;
- _script->cuckoo(totFileData, totSize);
- _script->seek(collArea->funcSub);
+ _script->call(collArea->funcSub);
int16 left = _script->readValExpr();
int16 top = _script->readValExpr();
@@ -982,8 +974,9 @@ void Game_v6::setCollisions(byte arg_0) {
if ((collArea->id & 0xF000) == 0xA000)
collArea->flags = flags;
- _script->cuckoo(savedData, savedSize);
- _script->seek(savedPos);
+ _script->pop();
+
+ _script = curScript;
}
}