diff options
author | johndoe123 | 2011-09-16 20:02:07 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:39:39 +0200 |
commit | c30e16628e01b5be671330b24ed73d1294205f6b (patch) | |
tree | fa959f5c2ed76fbb7d74f7e79880af98b9156656 /engines/neverhood/module2300.cpp | |
parent | 5d63bef6a25a990603444026a8cb033108410019 (diff) | |
download | scummvm-rg350-c30e16628e01b5be671330b24ed73d1294205f6b.tar.gz scummvm-rg350-c30e16628e01b5be671330b24ed73d1294205f6b.tar.bz2 scummvm-rg350-c30e16628e01b5be671330b24ed73d1294205f6b.zip |
NEVERHOOD: Add Module::updateChild and use it (in most places)
Diffstat (limited to 'engines/neverhood/module2300.cpp')
-rw-r--r-- | engines/neverhood/module2300.cpp | 88 |
1 files changed, 31 insertions, 57 deletions
diff --git a/engines/neverhood/module2300.cpp b/engines/neverhood/module2300.cpp index 19861ac7ca..60f8134929 100644 --- a/engines/neverhood/module2300.cpp +++ b/engines/neverhood/module2300.cpp @@ -125,11 +125,7 @@ void Module2300::createScene2305(int which) { } void Module2300::updateScene2301() { - _childObject->handleUpdate(); - if (_done) { - _done = false; - delete _childObject; - _childObject = NULL; + if (!updateChild()) { if (_field20 == 1) { createScene2302(4); _childObject->handleUpdate(); @@ -140,28 +136,7 @@ void Module2300::updateScene2301() { } void Module2300::updateScene2302() { - _childObject->handleUpdate(); -#if 0 // TODO - NavigationScene *navigationScene = (NavigationScene*)_childObject; - if (_flag && navigationScene->getSoundFlag1() && navigationScene->getNavigationIndex() == 4 && - navigationScene->getSmackerPlayer() && navigationScene->getSmackerPlayer()->getFrameNumber() % 2) { - _volume++; - Sound1ChList_setVolume(0x90F0D1C3, _volume); - } -#endif -#if 0 // TODO - if (navigationScene->getSoundFlag1() && navigationScene->getNavigationIndex() == 0 && - navigationScene->getSmackerPlayer() && navigationScene->getSmackerPlayer()->getFrameNumber() == 50) { - Sound1ChList_sub_407C70(0x1A214010, 0x48498E46, 0x50399F64); - Sound1ChList_setVolume(0x48498E46, 70); - Sound1ChList_setVolume(0x50399F64, 70); - } -#endif - if (_done) { - debug("SCENE 2302 DONE; _field20 = %d", _field20); - _done = false; - delete _childObject; - _childObject = NULL; + if (!updateChild()) { if (_field20 == 1) { createScene2301(0); _childObject->handleUpdate(); @@ -179,15 +154,28 @@ void Module2300::updateScene2302() { } else { sendMessage(_parentModule, 0x1009, 4); } + } else { +#if 0 // TODO + NavigationScene *navigationScene = (NavigationScene*)_childObject; + if (_flag && navigationScene->getSoundFlag1() && navigationScene->getNavigationIndex() == 4 && + navigationScene->getSmackerPlayer() && navigationScene->getSmackerPlayer()->getFrameNumber() % 2) { + _volume++; + Sound1ChList_setVolume(0x90F0D1C3, _volume); + } +#endif +#if 0 // TODO + if (navigationScene->getSoundFlag1() && navigationScene->getNavigationIndex() == 0 && + navigationScene->getSmackerPlayer() && navigationScene->getSmackerPlayer()->getFrameNumber() == 50) { + Sound1ChList_sub_407C70(0x1A214010, 0x48498E46, 0x50399F64); + Sound1ChList_setVolume(0x48498E46, 70); + Sound1ChList_setVolume(0x50399F64, 70); + } +#endif } } void Module2300::updateScene2303() { - _childObject->handleUpdate(); - if (_done) { - _done = false; - delete _childObject; - _childObject = NULL; + if (!updateChild()) { if (_field20 == 1) { sendMessage(_parentModule, 0x1009, 3); } else { @@ -195,44 +183,30 @@ void Module2300::updateScene2303() { _childObject->handleUpdate(); } } - if (_field24 >= 0) { - if (_field24 == 1) { - // TODO _resourceTable1.setResourceList(ex_sub_479D00(0), true); - // TODO _resourceTable2.loadResources(); - } - _field24 = -1; - } } void Module2300::updateScene2304() { - _childObject->handleUpdate(); -#if 0 // TODO - NavigationScene *navigationScene = (NavigationScene*)_childObject; - if (_flag && navigationScene->getSoundFlag1() && navigationScene->getSmackerPlayer() && - navigationScene->getSmackerPlayer()->getFrameNumber() % 2) { - _volume--; - Sound1ChList_setVolume(0x90F0D1C3, _volume); - } -#endif - if (_done) { - _done = false; - delete _childObject; - _childObject = NULL; + if (!updateChild()) { if (_field20 == 1) { sendMessage(_parentModule, 0x1009, 2); } else { createScene2302(1); _childObject->handleUpdate(); } + } else { +#if 0 // TODO + NavigationScene *navigationScene = (NavigationScene*)_childObject; + if (_flag && navigationScene->getSoundFlag1() && navigationScene->getSmackerPlayer() && + navigationScene->getSmackerPlayer()->getFrameNumber() % 2) { + _volume--; + Sound1ChList_setVolume(0x90F0D1C3, _volume); + } +#endif } } void Module2300::updateScene2305() { - _childObject->handleUpdate(); - if (_done) { - _done = false; - delete _childObject; - _childObject = NULL; + if (!updateChild()) { // TODO Sound1ChList_sub_4080B0(false); createScene2302(2); _childObject->handleUpdate(); |