aboutsummaryrefslogtreecommitdiff
path: root/sword2/sync.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-03-17 09:03:15 +0000
committerTorbjörn Andersson2004-03-17 09:03:15 +0000
commit4c3a68027f7f84a58664f77c847d24ab5b9757e4 (patch)
treebf20e888b9ea1cc2045df84aad12ef1cd54ec7de /sword2/sync.cpp
parent03200025dfb030d887ff9b07d180a8f9e2f225bc (diff)
downloadscummvm-rg350-4c3a68027f7f84a58664f77c847d24ab5b9757e4.tar.gz
scummvm-rg350-4c3a68027f7f84a58664f77c847d24ab5b9757e4.tar.bz2
scummvm-rg350-4c3a68027f7f84a58664f77c847d24ab5b9757e4.zip
Use the same syntax for accessing script variables as BS1 does, i.e. now
it's Logic::_scriptVars[ID] instead of just ID. Apart from looking cool, it makes it much easier to tell the difference between variables and constants when looking at the code. Of course, this sort of sweeping changes is jolly good for introducing truly weird regressions, which is why I waited until after 0.6.0. svn-id: r13331
Diffstat (limited to 'sword2/sync.cpp')
-rw-r--r--sword2/sync.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/sword2/sync.cpp b/sword2/sync.cpp
index 0475bbd08b..c7011a185b 100644
--- a/sword2/sync.cpp
+++ b/sword2/sync.cpp
@@ -32,7 +32,7 @@ int32 Logic::fnSendSync(int32 *params) {
for (int i = 0; i < MAX_syncs; i++) {
if (_syncList[i].id == 0) {
- debug(5, " %d sending sync %d to %d", ID, params[1], params[0]);
+ debug(5, " %d sending sync %d to %d", _scriptVars[ID], params[1], params[0]);
_syncList[i].id = params[0];
_syncList[i].sync = params[1];
return IR_CONT;
@@ -66,7 +66,7 @@ bool Logic::getSync(void) {
// animation to be quit
for (int i = 0; i < MAX_syncs; i++) {
- if (_syncList[i].id == ID) {
+ if (_syncList[i].id == _scriptVars[ID]) {
// means sync found
return true;
}
@@ -83,15 +83,15 @@ int32 Logic::fnGetSync(int32 *params) {
// params: none
for (int i = 0; i < MAX_syncs; i++) {
- if (_syncList[i].id == ID) {
+ if (_syncList[i].id == _scriptVars[ID]) {
// return sync value waiting
- RESULT = _syncList[i].sync;
+ _scriptVars[RESULT] = _syncList[i].sync;
return IR_CONT;
}
}
// no sync found
- RESULT = 0;
+ _scriptVars[RESULT] = 0;
return IR_CONT;
}
@@ -100,13 +100,13 @@ int32 Logic::fnWaitSync(int32 *params) {
// params: none
- debug(5, "fnWaitSync: %d waits", ID);
+ debug(5, "fnWaitSync: %d waits", _scriptVars[ID]);
for (int i = 0; i < MAX_syncs; i++) {
- if (_syncList[i].id == ID) {
+ if (_syncList[i].id == _scriptVars[ID]) {
// return sync value waiting
debug(5, "fnWaitSync: go");
- RESULT = _syncList[i].sync;
+ _scriptVars[RESULT] = _syncList[i].sync;
return IR_CONT;
}
}