aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjohndoe1232011-09-16 20:37:24 +0000
committerWillem Jan Palenstijn2013-05-08 20:39:39 +0200
commitfad64afa441b686b721fcba6084b083fa4436529 (patch)
tree8af4c76f6a8c8fc39d3f499fb9a1cfbd067af733
parentc30e16628e01b5be671330b24ed73d1294205f6b (diff)
downloadscummvm-rg350-fad64afa441b686b721fcba6084b083fa4436529.tar.gz
scummvm-rg350-fad64afa441b686b721fcba6084b083fa4436529.tar.bz2
scummvm-rg350-fad64afa441b686b721fcba6084b083fa4436529.zip
NEVERHOOD: Remove unused resource preloading stuff (probably resource preloading is not needed since the original game ran off slow double/quad-speed cd drives and preloading reduced stuttering while playing back then)
- Add Klayman animation speedup
-rw-r--r--engines/neverhood/gamemodule.cpp41
-rw-r--r--engines/neverhood/klayman.cpp19
-rw-r--r--engines/neverhood/klayman.h2
-rw-r--r--engines/neverhood/module.cpp13
-rw-r--r--engines/neverhood/module.h3
-rw-r--r--engines/neverhood/module1000.cpp8
-rw-r--r--engines/neverhood/module1200.cpp4
-rw-r--r--engines/neverhood/module1300.cpp34
-rw-r--r--engines/neverhood/module1400.cpp12
-rw-r--r--engines/neverhood/module1700.cpp10
-rw-r--r--engines/neverhood/module1800.cpp30
-rw-r--r--engines/neverhood/module2000.cpp8
-rw-r--r--engines/neverhood/module2200.cpp170
-rw-r--r--engines/neverhood/module2300.cpp16
-rw-r--r--engines/neverhood/module3000.cpp35
-rw-r--r--engines/neverhood/sprite.h1
16 files changed, 197 insertions, 209 deletions
diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp
index 6ef58e4fae..efd191eb0c 100644
--- a/engines/neverhood/gamemodule.cpp
+++ b/engines/neverhood/gamemodule.cpp
@@ -238,20 +238,17 @@ uint32 GameModule::handleMessage(int messageNum, const MessageParam &param, Enti
_someFlag1 = true;
return messageResult;
case 0x1009:
- _field24 = -1;
- _field26 = -1;
- _field28 = -1;
- _field20 = param.asInteger();
+ _moduleResult = param.asInteger();
_done = true;
return messageResult;
case 0x100A:
- _field24 = (int16)param.asInteger();
+ // Unused resource preloading message
return messageResult;
case 0x101F:
_field2C = true;
return messageResult;
case 0x1023:
- _field26 = (int16)param.asInteger();
+ // Unused resource preloading message
return messageResult;
}
return messageResult;
@@ -310,7 +307,7 @@ void GameModule::createModule1200(int which) {
void GameModule::updateModule1200() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
error("// TODO createModule2600(0);");
// TODO createModule2600(0);
// TODO _childObject->handleUpdate();
@@ -329,7 +326,7 @@ void GameModule::createModule1300(int which) {
void GameModule::updateModule1300() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
// TODO _gameState.clear();
// TODO GameModule_handleKeyEscape
} else {
@@ -347,7 +344,7 @@ void GameModule::createModule1400(int which) {
void GameModule::updateModule1400() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
error("WEIRD!");
} else {
// TODO createModule1600(1);
@@ -378,8 +375,8 @@ void GameModule::createModule1700(int which) {
void GameModule::updateModule1700() {
if (!updateChild()) {
- debug("Module1700 done; _field20 = %d", _field20);
- if (_field20 == 1) {
+ debug("Module1700 done; _moduleResult = %d", _moduleResult);
+ if (_moduleResult == 1) {
// TODO createModule2900(3);
// TODO _childObject->handleUpdate();
} else {
@@ -397,13 +394,13 @@ void GameModule::createModule1800(int which) {
void GameModule::updateModule1800() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
// TODO GameState_clear();
// TODO GameModule_handleKeyEscape();
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
// TODO createModule2700(0);
// TODO _childObject->handleUpdate();
- } else if (_field20 == 3) {
+ } else if (_moduleResult == 3) {
// TODO createModule3000(3);
// TODO _childObject->handleUpdate();
} else {
@@ -447,13 +444,13 @@ void GameModule::createModule2300(int which) {
void GameModule::updateModule2300() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createModule2200(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createModule1200(0);
- } else if (_field20 == 3) {
+ } else if (_moduleResult == 3) {
// TODO createModule2400(0);
- } else if (_field20 == 4) {
+ } else if (_moduleResult == 4) {
// TODO createModule3000(0);
} else {
createModule1000(1);
@@ -474,15 +471,15 @@ void GameModule::createModule3000(int which) {
void GameModule::updateModule3000() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
// TODO createModule1900(0);
// TODO _childObject->handleUpdate();
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
// WEIRD: Sets the errorFlag
- } else if (_field20 == 3) {
+ } else if (_moduleResult == 3) {
createModule1800(3);
_childObject->handleUpdate();
- } else if (_field20 == 4) {
+ } else if (_moduleResult == 4) {
// TODO createModule3000(0);
// TODO _childObject->handleUpdate();
} else {
diff --git a/engines/neverhood/klayman.cpp b/engines/neverhood/klayman.cpp
index 7102870f1e..b5d266e30f 100644
--- a/engines/neverhood/klayman.cpp
+++ b/engines/neverhood/klayman.cpp
@@ -1340,15 +1340,13 @@ void Klayman::sub41FC40() {
}
uint32 Klayman::handleMessage41E3C0(int messageNum, const MessageParam &param, Entity *sender) {
+ int16 speedUpFrameIndex;
switch (messageNum) {
case 0x1008:
- debug("case 0x1008");
-#if 0 // TODO
- if (_frameIndex < getHashListIndexByString("SpeedUp")) {
- setFileHash(0xAC20C012, getHashListIndexByString("SpeedUp"), -1)
- _y = 435;
+ speedUpFrameIndex = getFrameIndex(kKlaymanSpeedUpHash);
+ if (_frameIndex < speedUpFrameIndex) {
+ setFileHash(0xAC20C012, speedUpFrameIndex, -1);
}
-#endif
return 0;
case 0x100D:
if (param.asInteger() == 0x32180101) {
@@ -2371,16 +2369,15 @@ uint32 KmScene1002::handleMessage449BA0(int messageNum, const MessageParam &para
}
uint32 KmScene1002::handleMessage449C90(int messageNum, const MessageParam &param, Entity *sender) {
+ int16 speedUpFrameIndex;
uint32 messageResult = handleMessage41D480(messageNum, param, sender);
switch (messageNum) {
case 0x1008:
- debug("case 0x1008");
-#if 0 // TODO
- if (_frameIndex < getHashListIndexByString("SpeedUp")) {
- setFileHash(0x35AA8059, getHashListIndexByString("SpeedUp"), -1)
+ speedUpFrameIndex = getFrameIndex(kKlaymanSpeedUpHash);
+ if (_frameIndex < speedUpFrameIndex) {
+ setFileHash(0x35AA8059, speedUpFrameIndex, -1);
_y = 435;
}
-#endif
messageResult = 0;
break;
case 0x100D:
diff --git a/engines/neverhood/klayman.h b/engines/neverhood/klayman.h
index a25176eefd..3f15b8fb28 100644
--- a/engines/neverhood/klayman.h
+++ b/engines/neverhood/klayman.h
@@ -34,6 +34,8 @@ namespace Neverhood {
class Klayman;
+const uint32 kKlaymanSpeedUpHash = 0x004A2148;
+
struct KlaymanTableItem {
int value;
void (Klayman::*callback)();
diff --git a/engines/neverhood/module.cpp b/engines/neverhood/module.cpp
index 6d49838c49..78775ceba1 100644
--- a/engines/neverhood/module.cpp
+++ b/engines/neverhood/module.cpp
@@ -28,7 +28,7 @@ namespace Neverhood {
Module::Module(NeverhoodEngine *vm, Module *parentModule)
: Entity(vm, 0), _parentModule(parentModule), _childObject(NULL),
- _done(false), _field24(-1), _field26(-1), _field28(-1) {
+ _done(false) {
SetMessageHandler(&Module::handleMessage);
@@ -50,20 +50,13 @@ uint32 Module::handleMessage(int messageNum, const MessageParam &param, Entity *
sendMessage(_parentModule, 8, 0);
return 0;
case 0x1009:
- _field24 = -1;
- _field26 = -1;
- _field28 = -1;
- _field20 = param.asInteger();
+ _moduleResult = param.asInteger();
_done = true;
return 0;
case 0x100A:
- _field24 = (int16)param.asInteger();
- return 0;
case 0x1023:
- _field26 = (int16)param.asInteger();
- return 0;
case 0x1024:
- _field28 = (int16)param.asInteger();
+ // Unused resource preloading messages
return 0;
default:
if (_childObject && sender == _parentModule)
diff --git a/engines/neverhood/module.h b/engines/neverhood/module.h
index a37fd522aa..2f272d71b6 100644
--- a/engines/neverhood/module.h
+++ b/engines/neverhood/module.h
@@ -47,8 +47,7 @@ protected:
Module *_parentModule;
Entity *_childObject;
bool _done;
- int16 _field24, _field26, _field28;
- uint32 _field20;
+ uint32 _moduleResult;
uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
NavigationScene *navigationScene();
void createNavigationScene(uint32 navigationListId, int navigationIndex, const byte *itemsTypes = NULL);
diff --git a/engines/neverhood/module1000.cpp b/engines/neverhood/module1000.cpp
index 51e1d1959d..8185430d16 100644
--- a/engines/neverhood/module1000.cpp
+++ b/engines/neverhood/module1000.cpp
@@ -102,7 +102,7 @@ void Module1000::createScene1005(int which) {
void Module1000::updateScene1001() {
if (!updateChild()) {
- if (_field20 == 2) {
+ if (_moduleResult == 2) {
createScene1003(0);
_childObject->handleUpdate();
} else {
@@ -114,9 +114,9 @@ void Module1000::updateScene1001() {
void Module1000::updateScene1002() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
sendMessage(_parentModule, 0x1009, 0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene1004(0);
_childObject->handleUpdate();
} else {
@@ -135,7 +135,7 @@ void Module1000::updateScene1003() {
void Module1000::updateScene1004() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene1005(0);
_childObject->handleUpdate();
} else {
diff --git a/engines/neverhood/module1200.cpp b/engines/neverhood/module1200.cpp
index fa0bea0e94..9e198cc67c 100644
--- a/engines/neverhood/module1200.cpp
+++ b/engines/neverhood/module1200.cpp
@@ -80,10 +80,10 @@ void Module1200::createScene1203(int which) {
void Module1200::updateScene1201() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene1202(0);
_childObject->handleUpdate();
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
if (getGlobalVar(0x0A18CA33) && !getGlobalVar(0x2A02C07B)) {
createScene1203(-1);
} else {
diff --git a/engines/neverhood/module1300.cpp b/engines/neverhood/module1300.cpp
index 149af4a071..189ee2c2ff 100644
--- a/engines/neverhood/module1300.cpp
+++ b/engines/neverhood/module1300.cpp
@@ -284,7 +284,7 @@ void Module1300::createScene1318(int which) {
void Module1300::updateScene1302() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene1305(0);
} else {
createScene1308(1);
@@ -316,15 +316,15 @@ void Module1300::updateScene1305() {
void Module1300::updateScene1306() {
if (!updateChild()) {
- if (_field20 == 2) {
+ if (_moduleResult == 2) {
createScene1309(0);
_childObject->handleUpdate();
- } else if (_field20 == 3) {
+ } else if (_moduleResult == 3) {
createScene1303(0);
_childObject->handleUpdate();
- } else if (_field20 == 0) {
+ } else if (_moduleResult == 0) {
sendMessage(_parentModule, 0x1009, 0);
- } else if (_field20 == 1) {
+ } else if (_moduleResult == 1) {
createScene1311(-1);
_childObject->handleUpdate();
}
@@ -340,11 +340,11 @@ void Module1300::updateScene1307() {
void Module1300::updateScene1308() {
if (!updateChild()) {
- if (_field20 == 0) {
+ if (_moduleResult == 0) {
createScene1314(0);
- } else if (_field20 == 1) {
+ } else if (_moduleResult == 1) {
createScene1302(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene1307(0);
}
_childObject->handleUpdate();
@@ -373,9 +373,9 @@ void Module1300::updateScene1311() {
void Module1300::updateScene1312() {
if (!updateChild()) {
- if (_field20 == 0) {
+ if (_moduleResult == 0) {
createScene1313(0);
- } else if (_field20 == 1) {
+ } else if (_moduleResult == 1) {
createScene1312(1);
}
_childObject->handleUpdate();
@@ -384,7 +384,7 @@ void Module1300::updateScene1312() {
void Module1300::updateScene1313() {
if (!updateChild()) {
- switch (_field20) {
+ switch (_moduleResult) {
case 0:
createScene1315(1);
break;
@@ -404,9 +404,9 @@ void Module1300::updateScene1313() {
void Module1300::updateScene1314() {
if (!updateChild()) {
- if (_field20 == 0) {
+ if (_moduleResult == 0) {
createScene1313(2);
- } else if (_field20 == 1) {
+ } else if (_moduleResult == 1) {
createScene1308(0);
}
_childObject->handleUpdate();
@@ -415,9 +415,9 @@ void Module1300::updateScene1314() {
void Module1300::updateScene1315() {
if (!updateChild()) {
- if (_field20 == 0) {
+ if (_moduleResult == 0) {
createScene1313(3);
- } else if (_field20 == 1) {
+ } else if (_moduleResult == 1) {
createScene1310(-1);
}
_childObject->handleUpdate();
@@ -426,9 +426,9 @@ void Module1300::updateScene1315() {
void Module1300::updateScene1316() {
if (!updateChild()) {
- if (_field20 == 0) {
+ if (_moduleResult == 0) {
createScene1313(4);
- } else if (_field20 == 1) {
+ } else if (_moduleResult == 1) {
createScene1304(0);
}
_childObject->handleUpdate();
diff --git a/engines/neverhood/module1400.cpp b/engines/neverhood/module1400.cpp
index edc47f5a56..7f55272228 100644
--- a/engines/neverhood/module1400.cpp
+++ b/engines/neverhood/module1400.cpp
@@ -122,10 +122,10 @@ void Module1400::createScene1407(int which) {
void Module1400::updateScene1401() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene1402(0);
_childObject->handleUpdate();
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene1404(0);
_childObject->handleUpdate();
} else {
@@ -136,10 +136,10 @@ void Module1400::updateScene1401() {
void Module1400::updateScene1402() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene1403(0);
_childObject->handleUpdate();
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene1407(-1);
_childObject->handleUpdate();
} else {
@@ -158,10 +158,10 @@ void Module1400::updateScene1403() {
void Module1400::updateScene1404() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene1405(0);
_childObject->handleUpdate();
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene1406(-1);
_childObject->handleUpdate();
} else {
diff --git a/engines/neverhood/module1700.cpp b/engines/neverhood/module1700.cpp
index 528161ea2b..0aea8d1f24 100644
--- a/engines/neverhood/module1700.cpp
+++ b/engines/neverhood/module1700.cpp
@@ -114,10 +114,10 @@ void Module1700::updateScene1701() {
void Module1700::updateScene1702() {
if (!updateChild()) {
- if (_field20 == 0) {
+ if (_moduleResult == 0) {
createScene1703(0);
_childObject->handleUpdate();
- } else if (_field20 == 1) {
+ } else if (_moduleResult == 1) {
createScene1702(1);
_childObject->handleUpdate();
}
@@ -126,13 +126,13 @@ void Module1700::updateScene1702() {
void Module1700::updateScene1703() {
if (!updateChild()) {
- if (_field20 == 0) {
+ if (_moduleResult == 0) {
createScene1704(-1);
_childObject->handleUpdate();
- } else if (_field20 == 1) {
+ } else if (_moduleResult == 1) {
createScene1702(1);
_childObject->handleUpdate();
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
if (!_soundResource.isPlaying()) {
// TODO _soundResource.setVolume(60);
_soundResource.play(0x58B45E58);
diff --git a/engines/neverhood/module1800.cpp b/engines/neverhood/module1800.cpp
index d3dc4b6e9e..31a156461d 100644
--- a/engines/neverhood/module1800.cpp
+++ b/engines/neverhood/module1800.cpp
@@ -147,13 +147,13 @@ void Module1800::createScene1809(int which) {
void Module1800::updateScene1801() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene1805(0);
_childObject->handleUpdate();
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene1802(-1);
_childObject->handleUpdate();
- } else if (_field20 == 3) {
+ } else if (_moduleResult == 3) {
createScene1804(0);
_childObject->handleUpdate();
}
@@ -185,15 +185,15 @@ void Module1800::updateScene1802() {
void Module1800::updateScene1803() {
if (!updateChild()) {
- if (_field20 == 2) {
+ if (_moduleResult == 2) {
createScene1801(2);
_childObject->handleUpdate();
- } else if (_field20 == 3) {
+ } else if (_moduleResult == 3) {
sendMessage(_parentModule, 0x1009, 0);
- } else if (_field20 == 6) {
+ } else if (_moduleResult == 6) {
createScene1809(-1);
_childObject->handleUpdate();
- } else if (_field20 == 7) {
+ } else if (_moduleResult == 7) {
sendMessage(_parentModule, 0x1009, 3);
}
}
@@ -201,9 +201,9 @@ void Module1800::updateScene1803() {
void Module1800::updateScene1804() {
if (!updateChild()) {
- if (_field20 == 0) {
+ if (_moduleResult == 0) {
createScene1804b(-1);
- } else if (_field20 == 1) {
+ } else if (_moduleResult == 1) {
createScene1801(1);
}
_childObject->handleUpdate();
@@ -212,13 +212,13 @@ void Module1800::updateScene1804() {
void Module1800::updateScene1805() {
if (!updateChild()) {
- if (_field20 == 0) {
+ if (_moduleResult == 0) {
createScene1807(-1);
- } else if (_field20 == 1) {
+ } else if (_moduleResult == 1) {
createScene1806(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene1801(3);
- } else if (_field20 == 3) {
+ } else if (_moduleResult == 3) {
createScene1805(3);
}
_childObject->handleUpdate();
@@ -227,9 +227,9 @@ void Module1800::updateScene1805() {
void Module1800::updateScene1806() {
if (!updateChild()) {
- if (_field20 == 0) {
+ if (_moduleResult == 0) {
sendMessage(_parentModule, 0x1009, 2);
- } else if (_field20 == 1) {
+ } else if (_moduleResult == 1) {
createScene1805(3);
_childObject->handleUpdate();
}
diff --git a/engines/neverhood/module2000.cpp b/engines/neverhood/module2000.cpp
index 130235512c..bedc9d4b08 100644
--- a/engines/neverhood/module2000.cpp
+++ b/engines/neverhood/module2000.cpp
@@ -84,7 +84,7 @@ void Module2000::createScene2003(int which) {
void Module2000::updateScene2001() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
sendMessage(_parentModule, 0x1009, 0);
} else {
createScene2002(0);
@@ -94,15 +94,15 @@ void Module2000::updateScene2001() {
void Module2000::updateScene2002() {
if (!updateChild()) {
- if (_field20 == 0) {
+ if (_moduleResult == 0) {
if (getGlobalVar(0x98109F12)) {
createScene2002(0);
} else {
createScene2003(-1);
}
- } else if (_field20 == 1) {
+ } else if (_moduleResult == 1) {
createScene2002(1);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2001(0);
}
}
diff --git a/engines/neverhood/module2200.cpp b/engines/neverhood/module2200.cpp
index 321fab1484..2db0eb4bb9 100644
--- a/engines/neverhood/module2200.cpp
+++ b/engines/neverhood/module2200.cpp
@@ -499,9 +499,9 @@ void Module2200::createScene2248(int which) {
void Module2200::updateScene2201() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2203(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2202(0);
} else {
sendMessage(_parentModule, 0x1009, 0);
@@ -517,9 +517,9 @@ void Module2200::updateScene2202() {
void Module2200::updateScene2203() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2205(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2204(0);
} else {
createScene2201(1);
@@ -536,9 +536,9 @@ void Module2200::updateScene2204() {
void Module2200::updateScene2205() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2206(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2205(2);
} else {
createScene2203(1);
@@ -549,11 +549,11 @@ void Module2200::updateScene2205() {
void Module2200::updateScene2206() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2247(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2207(0);
- } else if (_field20 == 3) {
+ } else if (_moduleResult == 3) {
createScene2209(0);
} else {
createScene2205(1);
@@ -701,9 +701,9 @@ void Module2200::updateScene2209() {
void Module2200::updateScene2210() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2211(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2247(1);
@@ -714,9 +714,9 @@ void Module2200::updateScene2210() {
void Module2200::updateScene2211() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2212(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2210(1);
@@ -727,9 +727,9 @@ void Module2200::updateScene2211() {
void Module2200::updateScene2212() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2213(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2211(1);
@@ -740,9 +740,9 @@ void Module2200::updateScene2212() {
void Module2200::updateScene2213() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2214(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2212(1);
@@ -753,9 +753,9 @@ void Module2200::updateScene2213() {
void Module2200::updateScene2214() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2215(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2213(1);
@@ -766,9 +766,9 @@ void Module2200::updateScene2214() {
void Module2200::updateScene2215() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2216(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2214(1);
@@ -779,9 +779,9 @@ void Module2200::updateScene2215() {
void Module2200::updateScene2216() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2217(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2215(1);
@@ -792,9 +792,9 @@ void Module2200::updateScene2216() {
void Module2200::updateScene2217() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2218(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2216(1);
@@ -805,9 +805,9 @@ void Module2200::updateScene2217() {
void Module2200::updateScene2218() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2219(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2217(1);
@@ -818,9 +818,9 @@ void Module2200::updateScene2218() {
void Module2200::updateScene2219() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2220(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2218(1);
@@ -831,9 +831,9 @@ void Module2200::updateScene2219() {
void Module2200::updateScene2220() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2221(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2219(1);
@@ -844,9 +844,9 @@ void Module2200::updateScene2220() {
void Module2200::updateScene2221() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2222(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2220(1);
@@ -857,9 +857,9 @@ void Module2200::updateScene2221() {
void Module2200::updateScene2222() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2223(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2221(1);
@@ -870,9 +870,9 @@ void Module2200::updateScene2222() {
void Module2200::updateScene2223() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2224(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2222(1);
@@ -883,9 +883,9 @@ void Module2200::updateScene2223() {
void Module2200::updateScene2224() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2225(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2223(1);
@@ -896,9 +896,9 @@ void Module2200::updateScene2224() {
void Module2200::updateScene2225() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2226(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2224(1);
@@ -909,9 +909,9 @@ void Module2200::updateScene2225() {
void Module2200::updateScene2226() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2227(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2225(1);
@@ -922,9 +922,9 @@ void Module2200::updateScene2226() {
void Module2200::updateScene2227() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2228(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2226(1);
@@ -935,9 +935,9 @@ void Module2200::updateScene2227() {
void Module2200::updateScene2228() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2229(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2227(1);
@@ -948,9 +948,9 @@ void Module2200::updateScene2228() {
void Module2200::updateScene2229() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2230(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2228(1);
@@ -961,9 +961,9 @@ void Module2200::updateScene2229() {
void Module2200::updateScene2230() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2231(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2229(1);
@@ -974,9 +974,9 @@ void Module2200::updateScene2230() {
void Module2200::updateScene2231() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2232(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2230(1);
@@ -987,9 +987,9 @@ void Module2200::updateScene2231() {
void Module2200::updateScene2232() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2233(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2231(1);
@@ -1000,9 +1000,9 @@ void Module2200::updateScene2232() {
void Module2200::updateScene2233() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2234(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2232(1);
@@ -1013,9 +1013,9 @@ void Module2200::updateScene2233() {
void Module2200::updateScene2234() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2235(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2233(1);
@@ -1026,9 +1026,9 @@ void Module2200::updateScene2234() {
void Module2200::updateScene2235() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2243(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2234(1);
@@ -1039,9 +1039,9 @@ void Module2200::updateScene2235() {
void Module2200::updateScene2236() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2237(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2246(1);
@@ -1052,9 +1052,9 @@ void Module2200::updateScene2236() {
void Module2200::updateScene2237() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2238(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2236(1);
@@ -1065,9 +1065,9 @@ void Module2200::updateScene2237() {
void Module2200::updateScene2238() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2239(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2237(1);
@@ -1078,9 +1078,9 @@ void Module2200::updateScene2238() {
void Module2200::updateScene2239() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2240(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2238(1);
@@ -1091,9 +1091,9 @@ void Module2200::updateScene2239() {
void Module2200::updateScene2240() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2241(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2239(1);
@@ -1104,9 +1104,9 @@ void Module2200::updateScene2240() {
void Module2200::updateScene2241() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2242(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2240(1);
@@ -1117,10 +1117,10 @@ void Module2200::updateScene2241() {
void Module2200::updateScene2242() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2248(0);
_childObject->handleUpdate();
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
_childObject->handleUpdate();
} else {
@@ -1132,9 +1132,9 @@ void Module2200::updateScene2242() {
void Module2200::updateScene2243() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2244(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2235(1);
@@ -1145,9 +1145,9 @@ void Module2200::updateScene2243() {
void Module2200::updateScene2244() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2245(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2243(1);
@@ -1158,9 +1158,9 @@ void Module2200::updateScene2244() {
void Module2200::updateScene2245() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2246(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2244(1);
@@ -1171,9 +1171,9 @@ void Module2200::updateScene2245() {
void Module2200::updateScene2246() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2236(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2245(1);
@@ -1184,9 +1184,9 @@ void Module2200::updateScene2246() {
void Module2200::updateScene2247() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2210(0);
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2208(0);
} else {
createScene2206(1);
diff --git a/engines/neverhood/module2300.cpp b/engines/neverhood/module2300.cpp
index 60f8134929..ce9250a9b6 100644
--- a/engines/neverhood/module2300.cpp
+++ b/engines/neverhood/module2300.cpp
@@ -126,7 +126,7 @@ void Module2300::createScene2305(int which) {
void Module2300::updateScene2301() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2302(4);
_childObject->handleUpdate();
} else {
@@ -137,19 +137,19 @@ void Module2300::updateScene2301() {
void Module2300::updateScene2302() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene2301(0);
_childObject->handleUpdate();
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene2303(1);
_childObject->handleUpdate();
- } else if (_field20 == 3) {
+ } else if (_moduleResult == 3) {
createScene2302(3);
_childObject->handleUpdate();
- } else if (_field20 == 4) {
+ } else if (_moduleResult == 4) {
createScene2304(1);
_childObject->handleUpdate();
- } else if (_field20 == 5) {
+ } else if (_moduleResult == 5) {
sendMessage(_parentModule, 0x1009, 3);
} else {
sendMessage(_parentModule, 0x1009, 4);
@@ -176,7 +176,7 @@ void Module2300::updateScene2302() {
void Module2300::updateScene2303() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
sendMessage(_parentModule, 0x1009, 3);
} else {
createScene2302(5);
@@ -187,7 +187,7 @@ void Module2300::updateScene2303() {
void Module2300::updateScene2304() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
sendMessage(_parentModule, 0x1009, 2);
} else {
createScene2302(1);
diff --git a/engines/neverhood/module3000.cpp b/engines/neverhood/module3000.cpp
index bccc72352b..cfcacaf693 100644
--- a/engines/neverhood/module3000.cpp
+++ b/engines/neverhood/module3000.cpp
@@ -269,14 +269,14 @@ void Module3000::updateScene3002() {
delete _childObject;
_childObject = NULL;
if (!getGlobalVar(0x01BA1A52)) {
- if (_field20 == 0) {
+ if (_moduleResult == 0) {
createScene3010(-1);
_childObject->handleUpdate();
- } else if (_field20 == 1) {
+ } else if (_moduleResult == 1) {
sendMessage(_parentModule, 0x1009, 0);
}
} else {
- if (_field20 == 0) {
+ if (_moduleResult == 0) {
if (areaType == 2) {
createScene3003(0);
_childObject->handleUpdate();
@@ -284,7 +284,7 @@ void Module3000::updateScene3002() {
//createScene3002b(-1);
_childObject->handleUpdate();
}
- } else if (_field20 == 1) {
+ } else if (_moduleResult == 1) {
sendMessage(_parentModule, 0x1009, 0);
}
}
@@ -328,10 +328,10 @@ void Module3000::updateScene3003() {
_soundVolume = 0;
// TODO Sound1ChList_setVolume(0x90F0D1C3, 0);
}
- if (_field20 == 0) {
+ if (_moduleResult == 0) {
createScene3004(0);
_childObject->handleUpdate();
- } else if (_field20 == 1) {
+ } else if (_moduleResult == 1) {
setGlobalVar(0x01BA1A52, 0);
createScene3002(1);
_childObject->handleUpdate();
@@ -363,10 +363,10 @@ void Module3000::updateScene3003() {
void Module3000::updateScene3004() {
if (!updateChild()) {
- if (_field20 == 1) {
+ if (_moduleResult == 1) {
createScene3005(0);
_childObject->handleUpdate();
- } else if (_field20 == 3) {
+ } else if (_moduleResult == 3) {
createScene3011(-1);
_childObject->handleUpdate();
} else if (getGlobalVar(0x09221A62)) {
@@ -400,12 +400,12 @@ void Module3000::updateScene3004() {
void Module3000::updateScene3005() {
if (!updateChild()) {
- if (_field20 == 0) {
+ if (_moduleResult == 0) {
sendMessage(_parentModule, 0x1009, 1);
- } else if (_field20 == 1) {
+ } else if (_moduleResult == 1) {
createScene3008(-1);
_childObject->handleUpdate();
- } else if (_field20 == 2) {
+ } else if (_moduleResult == 2) {
createScene3004(3);
_childObject->handleUpdate();
}
@@ -414,9 +414,9 @@ void Module3000::updateScene3005() {
void Module3000::updateScene3006() {
if (!updateChild()) {
- if (_field20 == 0) {
+ if (_moduleResult == 0) {
createScene3007(0);
- } else if (_field20 == 1) {
+ } else if (_moduleResult == 1) {
createScene3004(0);
}
_childObject->handleUpdate();
@@ -449,7 +449,7 @@ void Module3000::updateScene3007() {
void Module3000::updateScene3009() {
if (!updateChild()) {
_flag = getGlobalVar(0x10938830); // CHECKME
- if (_field20 != 1) {
+ if (_moduleResult != 1) {
// TODO: Sound1ChList_setSoundValuesMulti(dword_4B7FC8, true, 0, 0, 0, 0):
createScene3005(1);
_childObject->handleUpdate();
@@ -466,13 +466,12 @@ void Module3000::updateScene3009() {
void Module3000::updateScene3010() {
if (!updateChild()) {
- if (_field20 == 0 || _field20 == 2) {
+ if (_moduleResult == 0 || _moduleResult == 2) {
createScene3002(0);
- _childObject->handleUpdate();
- } else if (_field20 == 1) {
+ } else if (_moduleResult == 1) {
createScene3002b(-1);
- _childObject->handleUpdate();
}
+ _childObject->handleUpdate();
}
}
diff --git a/engines/neverhood/sprite.h b/engines/neverhood/sprite.h
index ff1830469d..f17b2d4216 100644
--- a/engines/neverhood/sprite.h
+++ b/engines/neverhood/sprite.h
@@ -114,6 +114,7 @@ public:
void clearRepl();
uint32 getCurrAnimFileHash() const { return _currAnimFileHash; }
int16 getFrameIndex() const { return _frameIndex; }
+ int16 getFrameIndex(uint32 frameHash) { return _animResource.getFrameIndex(frameHash); }
void setNewHashListIndex(int value) { _newHashListIndex = value; }
void setFileHash(uint32 fileHash, int16 frameIndex3, int16 frameIndex4);
protected: