diff options
author | Eugene Sandulenko | 2013-12-28 23:42:06 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2013-12-28 23:42:06 +0200 |
commit | 3f8c39341c5f223fc5b06974ae16f28df99d779f (patch) | |
tree | 9f55d53a392aa1c78afcce593c0c86a265ed040a /engines/fullpipe | |
parent | 5822ce9659c341d3adb3c8c8483d1c6d2df914d8 (diff) | |
download | scummvm-rg350-3f8c39341c5f223fc5b06974ae16f28df99d779f.tar.gz scummvm-rg350-3f8c39341c5f223fc5b06974ae16f28df99d779f.tar.bz2 scummvm-rg350-3f8c39341c5f223fc5b06974ae16f28df99d779f.zip |
FULLPIPE: Correctly implement scene switching from command line
Diffstat (limited to 'engines/fullpipe')
-rw-r--r-- | engines/fullpipe/console.cpp | 8 | ||||
-rw-r--r-- | engines/fullpipe/constants.h | 43 | ||||
-rw-r--r-- | engines/fullpipe/fullpipe.h | 1 | ||||
-rw-r--r-- | engines/fullpipe/messagehandlers.cpp | 3 | ||||
-rw-r--r-- | engines/fullpipe/scenes.cpp | 19 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene24.cpp | 4 | ||||
-rw-r--r-- | engines/fullpipe/stateloader.cpp | 7 |
7 files changed, 75 insertions, 10 deletions
diff --git a/engines/fullpipe/console.cpp b/engines/fullpipe/console.cpp index 06235d3eab..2d27fc2ddd 100644 --- a/engines/fullpipe/console.cpp +++ b/engines/fullpipe/console.cpp @@ -39,8 +39,12 @@ bool Console::Cmd_Scene(int argc, const char **argv) { return true; } else { int scene = _vm->convertScene(atoi(argv[1])); - _vm->_gameLoader->loadScene(scene); - _vm->_gameLoader->gotoScene(scene, TrubaLeft); + _vm->_gameLoader->loadScene(726); + _vm->_gameLoader->gotoScene(726, TrubaLeft); + + if (scene != 726) + _vm->_gameLoader->preloadScene(726, _vm->getSceneEntrance(scene)); + return false; } } diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 5f45ba02c4..6b4c3c52aa 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -303,7 +303,6 @@ namespace Fullpipe { #define PIC_SC8_LADDERD 1106 #define PIC_SC10_DTRUBA 974 #define PIC_SC10_LADDER 995 -#define PIC_SCD_SEL 734 #define QU_BALL_WALKL 4920 #define QU_BALL_WALKR 4919 #define QU_CST_CLOSELUKE 820 @@ -566,6 +565,48 @@ namespace Fullpipe { #define ST_DRP24_EMPTY 3507 #define ST_WTR24_FLOWLOWER 1843 +// Debug scene +#define PIC_SCD_1 727 +#define PIC_SCD_2 728 +#define PIC_SCD_3 729 +#define PIC_SCD_4 730 +#define PIC_SCD_5 731 +#define PIC_SCD_6 732 +#define PIC_SCD_7 733 +#define PIC_SCD_8 756 +#define PIC_SCD_9 907 +#define PIC_SCD_10 981 +#define PIC_SCD_11 1098 +#define PIC_SCD_12 857 +#define PIC_SCD_13 1195 +#define PIC_SCD_14 1224 +#define PIC_SCD_15 1278 +#define PIC_SCD_16 1299 +#define PIC_SCD_17 1305 +#define PIC_SCD_18 1306 +#define PIC_SCD_19 1319 +#define PIC_SCD_20 1622 +#define PIC_SCD_21 1623 +#define PIC_SCD_22 1624 +#define PIC_SCD_23 1625 +#define PIC_SCD_24 1845 +#define PIC_SCD_25 1846 +#define PIC_SCD_26 1847 +#define PIC_SCD_27 1916 +#define PIC_SCD_28 2098 +#define PIC_SCD_29 2099 +#define PIC_SCD_30 2359 +#define PIC_SCD_31 2566 +#define PIC_SCD_32 2312 +#define PIC_SCD_33 2636 +#define PIC_SCD_34 2389 +#define PIC_SCD_35 2412 +#define PIC_SCD_36 2567 +#define PIC_SCD_37 2568 +#define PIC_SCD_38 2228 +#define PIC_SCD_FIN 5026 +#define PIC_SCD_SEL 734 + } // End of namespace Fullpipe #endif /* FULLPIPE_CONSTANTS_H */ diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index 5e4389af7b..0f3e057b5a 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -238,6 +238,7 @@ public: Scene *accessScene(int sceneId); void setSceneMusicParameters(GameVar *var); int convertScene(int scene); + int getSceneEntrance(int scene); int getSceneFromTag(int tag); NGIArchive *_currArchive; diff --git a/engines/fullpipe/messagehandlers.cpp b/engines/fullpipe/messagehandlers.cpp index a9872a5a23..3eb06686b6 100644 --- a/engines/fullpipe/messagehandlers.cpp +++ b/engines/fullpipe/messagehandlers.cpp @@ -42,7 +42,7 @@ void global_messageHandler_KickMetal() { } int global_messageHandler1(ExCommand *cmd) { - debug(0, "global_messageHandler1: %d %d", cmd->_messageKind, cmd->_messageNum); + debug(5, "global_messageHandler1: %d %d", cmd->_messageKind, cmd->_messageNum); if (cmd->_excFlags & 0x10000) { if (cmd->_messageNum == MV_MAN_TOLADDER) @@ -306,6 +306,7 @@ int global_messageHandler3(ExCommand *cmd) { case 17: switch (cmd->_messageNum) { case 61: + debug(0, "preload: { %d, %d },", cmd->_parentId, cmd->_keyCode); return g_fp->_gameLoader->preloadScene(cmd->_parentId, cmd->_keyCode); case 62: return g_fp->_gameLoader->gotoScene(cmd->_parentId, cmd->_keyCode); diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index a8e96a14fd..dca6e71130 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -209,19 +209,34 @@ static int scenes[] = { SC_1, SC_2, SC_3, SC_4, SC_5, SC_6, SC_7, SC_8, SC_9, SC_10, SC_11, SC_12, SC_13, SC_14, SC_15, SC_16, SC_17, SC_18, SC_19, SC_20, SC_21, SC_22, SC_23, SC_24, SC_25, SC_26, SC_27, SC_28, SC_29, SC_30, - SC_31, SC_32, SC_33, SC_34, SC_35, SC_36, SC_37, SC_38, SC_DBGMENU + SC_31, SC_32, SC_33, SC_34, SC_35, SC_36, SC_37, SC_38, SC_FINAL1, SC_DBGMENU +}; + +static int scenesD[] = { + PIC_SCD_1, PIC_SCD_2, PIC_SCD_3, PIC_SCD_4, PIC_SCD_5, PIC_SCD_6, PIC_SCD_7, PIC_SCD_8, PIC_SCD_9, PIC_SCD_10, + PIC_SCD_11, PIC_SCD_12, PIC_SCD_13, PIC_SCD_14, PIC_SCD_15, PIC_SCD_16, PIC_SCD_17, PIC_SCD_18, PIC_SCD_19, PIC_SCD_20, + PIC_SCD_21, PIC_SCD_22, PIC_SCD_23, PIC_SCD_24, PIC_SCD_25, PIC_SCD_26, PIC_SCD_27, PIC_SCD_28, PIC_SCD_29, PIC_SCD_30, + PIC_SCD_31, PIC_SCD_32, PIC_SCD_33, PIC_SCD_34, PIC_SCD_35, PIC_SCD_36, PIC_SCD_37, PIC_SCD_38, PIC_SCD_FIN, 0 }; int FullpipeEngine::convertScene(int scene) { if (!scene || scene >= SC_1) return scene; - if (scene < 1 || scene > 39) + if (scene < 1 || scene > 40) return SC_1; return scenes[scene - 1]; } +int FullpipeEngine::getSceneEntrance(int scene) { + for (int i = 0; i < 41; i++) + if (scenes[i] == scene) + return scenesD[i]; + + return 0; +} + int FullpipeEngine::getSceneFromTag(int tag) { for (int i = 0; i < ARRAYSIZE(scenes); i++) { if (scenes[i] == tag) diff --git a/engines/fullpipe/scenes/scene24.cpp b/engines/fullpipe/scenes/scene24.cpp index 7ab0d94296..08ac645ca2 100644 --- a/engines/fullpipe/scenes/scene24.cpp +++ b/engines/fullpipe/scenes/scene24.cpp @@ -106,8 +106,8 @@ int sceneHandler24(ExCommand *cmd) { if (x < g_fp->_sceneRect.left + 200) { g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left; } - if (x > g_fp->_sceneRect.right - 200) - g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right; + if (x > g_fp->_sceneRect.right - 200 - 1) + g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right; } if (g_vars->scene24_waterIsOn && !g_vars->scene24_water->_movement) { diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp index 6a56ffd662..9c54947b35 100644 --- a/engines/fullpipe/stateloader.cpp +++ b/engines/fullpipe/stateloader.cpp @@ -82,8 +82,11 @@ bool FullpipeEngine::loadGam(const char *fname, int scene) { setMusicAllowed(_gameLoader->_gameVar->getSubVarAsInt("MUSIC_ALLOWED")); if (scene) { - _gameLoader->loadScene(scene); - _gameLoader->gotoScene(scene, TrubaLeft); + _gameLoader->loadScene(726); + _gameLoader->gotoScene(726, TrubaLeft); + + if (scene != 726) + _gameLoader->preloadScene(726, getSceneEntrance(scene)); } else { if (_flgPlayIntro) { _gameLoader->loadScene(SC_INTRO1); |