diff options
author | Filippos Karapetis | 2013-09-14 12:39:12 +0300 |
---|---|---|
committer | Filippos Karapetis | 2013-09-14 12:39:58 +0300 |
commit | 1f7780bef53b11ebd1d59e8a5e4ea53d59cad948 (patch) | |
tree | d2fc37fc81cf853e8f163c42b027954d20650153 /engines/neverhood/console.cpp | |
parent | cdeb55777d4279cfb332a3a68ac91cafdff7f48b (diff) | |
download | scummvm-rg350-1f7780bef53b11ebd1d59e8a5e4ea53d59cad948.tar.gz scummvm-rg350-1f7780bef53b11ebd1d59e8a5e4ea53d59cad948.tar.bz2 scummvm-rg350-1f7780bef53b11ebd1d59e8a5e4ea53d59cad948.zip |
NEVERHOOD: Rename the "room" command to "scene" and enhance it
The naming has been changed from "room" to "scene", in order to keep it
consistent with the rest of the engine. The scene command now also
displays resource information about the current scene when invoked
without parameters
Diffstat (limited to 'engines/neverhood/console.cpp')
-rw-r--r-- | engines/neverhood/console.cpp | 48 |
1 files changed, 38 insertions, 10 deletions
diff --git a/engines/neverhood/console.cpp b/engines/neverhood/console.cpp index fc85f88332..a2ceed8a2e 100644 --- a/engines/neverhood/console.cpp +++ b/engines/neverhood/console.cpp @@ -24,7 +24,9 @@ #include "gui/debugger.h" #include "neverhood/neverhood.h" #include "neverhood/gamemodule.h" +#include "neverhood/navigationscene.h" #include "neverhood/scene.h" +#include "neverhood/smackerscene.h" #include "neverhood/sound.h" #include "neverhood/modules/module1600.h" @@ -35,23 +37,49 @@ Console::Console(NeverhoodEngine *vm) : GUI::Debugger(), _vm(vm) { DCmd_Register("checkresource", WRAP_METHOD(Console, Cmd_CheckResource)); DCmd_Register("dumpresource", WRAP_METHOD(Console, Cmd_DumpResource)); DCmd_Register("dumpvars", WRAP_METHOD(Console, Cmd_Dumpvars)); - DCmd_Register("room", WRAP_METHOD(Console, Cmd_Room)); - DCmd_Register("surfaces", WRAP_METHOD(Console, Cmd_Surfaces)); DCmd_Register("playsound", WRAP_METHOD(Console, Cmd_PlaySound)); + DCmd_Register("scene", WRAP_METHOD(Console, Cmd_Scene)); + DCmd_Register("surfaces", WRAP_METHOD(Console, Cmd_Surfaces)); } Console::~Console() { } -bool Console::Cmd_Room(int argc, const char **argv) { - int currentModule = _vm->_gameModule->getCurrentModuleNum(); - int previousModule = _vm->_gameModule->getPreviousModuleNum(); - int scene = _vm->gameState().sceneNum; - - DebugPrintf("Current module: %d, previous module: %d, scene %d\n", currentModule, previousModule, scene); - +bool Console::Cmd_Scene(int argc, const char **argv) { if (argc != 3) { - DebugPrintf("Use room <module> <scene> to change rooms\n"); + int currentModule = _vm->_gameModule->getCurrentModuleNum(); + int previousModule = _vm->_gameModule->getPreviousModuleNum(); + int scenenNum = _vm->gameState().sceneNum; + SceneType sceneType = ((GameModule *)_vm->_gameModule->_childObject)->getSceneType(); + + const char *sceneTypes[] = { "normal", "smacker", "navigation" }; + + DebugPrintf("Current module: %d, previous module: %d, scene %d (%s scene)\n", currentModule, previousModule, scenenNum, sceneTypes[sceneType]); + + if (sceneType == kSceneTypeNormal) { + Scene *scene = (Scene *)((GameModule *)_vm->_gameModule->_childObject)->_childObject; + // Normal scenes have a background and a cursor file hash + DebugPrintf("Background hash: 0x%x, cursor hash: 0x%x\n", scene->getBackgroundFileHash(), scene->getCursorFileHash()); + } else if (sceneType == kSceneTypeSmacker) { + SmackerScene *scene = (SmackerScene *)((GameModule *)_vm->_gameModule->_childObject)->_childObject; + // Smacker scenes have a file hash, or a list of hashes + // TODO: Only the first file hash is shown - any additional hashes, found in + // scenes with a list of hashes (two scenes in module 1100 and the making of + // video) aren't shown yet + DebugPrintf("File hash: 0x%x\n", scene->getSmackerFileHash()); + } else if (sceneType == kSceneTypeNavigation) { + NavigationScene *scene = (NavigationScene *)((GameModule *)_vm->_gameModule->_childObject)->_childObject; + // Navigation scenes have a navigation list and its index + NavigationList *navigationList = _vm->_staticData->getNavigationList(scene->getNavigationListId()); + int navigationIndex = scene->getGlobalVar(V_NAVIGATION_INDEX); + NavigationItem curNavigation = (*navigationList)[navigationIndex]; + DebugPrintf("Navigation list ID: 0x%x, index: %d\n", scene->getNavigationListId(), navigationIndex); + DebugPrintf("File hash: 0x%x, cursor hash: 0x%x, Smacker hashes: [left: 0x%x, middle: 0x%x, right: 0x%x\n", + curNavigation.fileHash, curNavigation.mouseCursorFileHash, + curNavigation.leftSmackerFileHash, curNavigation.middleSmackerFileHash, curNavigation.rightSmackerFileHash); + } + + DebugPrintf("Use %s <module> <scene> to change scenes\n", argv[0]); DebugPrintf("Modules are incremental by 100, from 1000 to 3000\n"); } else { int newModule = atoi(argv[1]); |