diff options
author | Strangerke | 2016-04-24 23:39:39 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-05-10 09:54:21 +0200 |
commit | 441565db4d1e4a7934dd2cb580d0df35766222cc (patch) | |
tree | eacb9e17215571720f6f713232b3d2ea9ee6cfbc /engines | |
parent | 28d8a8be7cba9f1695650c4c5de93eee458ebe7d (diff) | |
download | scummvm-rg350-441565db4d1e4a7934dd2cb580d0df35766222cc.tar.gz scummvm-rg350-441565db4d1e4a7934dd2cb580d0df35766222cc.tar.bz2 scummvm-rg350-441565db4d1e4a7934dd2cb580d0df35766222cc.zip |
GNAP: Reduce code duplication in SceneCore
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gnap/gnap.cpp | 2 | ||||
-rw-r--r-- | engines/gnap/scenes/scenecore.cpp | 188 |
2 files changed, 9 insertions, 181 deletions
diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp index 371e7ef45f..389124bdcd 100644 --- a/engines/gnap/gnap.cpp +++ b/engines/gnap/gnap.cpp @@ -936,7 +936,6 @@ void GnapEngine::startSoundTimerB(int timerIndex) { } int GnapEngine::playSoundB() { - static const int kSoundIdsB[] = { 0x93D, 0x929, 0x92A, 0x92B, 0x92C, 0x92D, 0x92E, 0x92F, 0x930, 0x931, 0x932, 0x933, @@ -1791,7 +1790,6 @@ void GnapEngine::gnapUseDeviceOnPlatypuss() { kSeqSyncWait, 0, 75 * _gnapX - _gnapGridX, 48 * _gnapY - _gnapGridY); _gnapSequenceId = newSequenceId; _gnapSequenceDatNum = 1; - } void GnapEngine::doCallback(int callback) { diff --git a/engines/gnap/scenes/scenecore.cpp b/engines/gnap/scenes/scenecore.cpp index 33ba9111e7..c549a7aac9 100644 --- a/engines/gnap/scenes/scenecore.cpp +++ b/engines/gnap/scenes/scenecore.cpp @@ -454,35 +454,10 @@ void GnapEngine::runSceneLogic() { _newSceneNum = 8; break; case 1: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 4; - break; case 2: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 4; - break; case 3: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 4; - break; case 4: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 4; - break; case 5: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 4; - break; case 6: _scene->run(); delete _scene; @@ -508,41 +483,26 @@ void GnapEngine::runSceneLogic() { _newSceneNum = 10; break; case 10: + case 12: + case 13: _scene->run(); delete _scene; if (_newSceneNum == 55) _newSceneNum = 11; break; case 11: + case 15: _scene->run(); delete _scene; if (_newSceneNum == 55) _newSceneNum = 12; break; - case 12: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 11; - break; - case 13: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 11; - break; case 14: _scene->run(); delete _scene; if (_newSceneNum == 55) _newSceneNum = 13; break; - case 15: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 12; - break; case 16: _scene = new Scene16(this); _scene->init(); @@ -552,179 +512,49 @@ void GnapEngine::runSceneLogic() { delete _scene; break; case 17: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 20; - break; case 18: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 20; - break; - case 19: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 19; - break; - case 20: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 22; - break; case 21: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 20; - break; case 22: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 20; - break; case 23: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 20; - break; case 24: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 20; - break; case 25: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 20; - break; case 26: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 20; - break; case 27: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 20; - break; case 28: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 20; - break; case 29: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 20; - break; case 30: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 20; - break; case 31: _scene->run(); delete _scene; if (_newSceneNum == 55) _newSceneNum = 20; break; - case 32: + case 19: _scene->run(); delete _scene; if (_newSceneNum == 55) - _newSceneNum = 37; + _newSceneNum = 19; break; - case 33: + case 20: _scene->run(); delete _scene; if (_newSceneNum == 55) - _newSceneNum = 37; + _newSceneNum = 22; break; + case 32: + case 33: case 34: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 37; - break; case 35: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 37; - break; case 36: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 37; - break; case 37: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 37; - break; case 38: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 37; - break; case 39: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 37; - break; case 40: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 37; - break; case 41: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 37; - break; case 42: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 37; - break; case 43: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 37; - break; case 44: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 37; - break; case 45: - _scene->run(); - delete _scene; - if (_newSceneNum == 55) - _newSceneNum = 37; - break; case 46: _scene->run(); delete _scene; |