aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/neverhood/console.cpp48
-rw-r--r--engines/neverhood/console.h2
-rw-r--r--engines/neverhood/module.h1
-rw-r--r--engines/neverhood/navigationscene.cpp1
-rw-r--r--engines/neverhood/navigationscene.h2
-rw-r--r--engines/neverhood/scene.cpp6
-rw-r--r--engines/neverhood/scene.h7
-rw-r--r--engines/neverhood/smackerscene.h1
8 files changed, 57 insertions, 11 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]);
diff --git a/engines/neverhood/console.h b/engines/neverhood/console.h
index 77dde231dc..70260a96af 100644
--- a/engines/neverhood/console.h
+++ b/engines/neverhood/console.h
@@ -37,7 +37,7 @@ public:
private:
NeverhoodEngine *_vm;
- bool Cmd_Room(int argc, const char **argv);
+ bool Cmd_Scene(int argc, const char **argv);
bool Cmd_Surfaces(int argc, const char **argv);
bool Cmd_Cheat(int argc, const char **argv);
bool Cmd_Dumpvars(int argc, const char **argv);
diff --git a/engines/neverhood/module.h b/engines/neverhood/module.h
index ba1e1fa3db..8ab2159030 100644
--- a/engines/neverhood/module.h
+++ b/engines/neverhood/module.h
@@ -48,6 +48,7 @@ public:
Module(NeverhoodEngine *vm, Module *parentModule);
virtual ~Module();
virtual void draw();
+ SceneType getSceneType() { return _sceneType; }
Entity *_childObject;
protected:
diff --git a/engines/neverhood/navigationscene.cpp b/engines/neverhood/navigationscene.cpp
index 51ab96ef37..a15c00de07 100644
--- a/engines/neverhood/navigationscene.cpp
+++ b/engines/neverhood/navigationscene.cpp
@@ -35,6 +35,7 @@ NavigationScene::NavigationScene(NeverhoodEngine *vm, Module *parentModule, uint
_isWalkingForward(false), _isTurning(false), _smackerFileHash(0), _interactive(true), _leaveSceneAfter(false) {
_navigationList = _vm->_staticData->getNavigationList(navigationListId);
+ _navigationListId = navigationListId;
if (_navigationIndex < 0) {
_navigationIndex = (int)getGlobalVar(V_NAVIGATION_INDEX);
diff --git a/engines/neverhood/navigationscene.h b/engines/neverhood/navigationscene.h
index ebe9a3597c..c17446811c 100644
--- a/engines/neverhood/navigationscene.h
+++ b/engines/neverhood/navigationscene.h
@@ -38,10 +38,12 @@ public:
bool isWalkingForward() const { return _isWalkingForward; }
bool isTurning() const { return _isTurning; }
int getFrameNumber() const { return _smackerPlayer->getFrameNumber(); }
+ uint32 getNavigationListId() const { return _navigationListId; }
protected:
SmackerPlayer *_smackerPlayer;
bool _smackerDone;
NavigationList *_navigationList;
+ uint32 _navigationListId; // used for debugging
int _navigationIndex;
uint32 _smackerFileHash;
bool _interactive;
diff --git a/engines/neverhood/scene.cpp b/engines/neverhood/scene.cpp
index 8a0e3d5556..0b2e9c6b75 100644
--- a/engines/neverhood/scene.cpp
+++ b/engines/neverhood/scene.cpp
@@ -51,6 +51,8 @@ Scene::Scene(NeverhoodEngine *vm, Module *parentModule)
_isMessageListBusy = false;
_messageValue = -1;
+ _backgroundFileHash = _cursorFileHash = 0;
+
SetUpdateHandler(&Scene::update);
SetMessageHandler(&Scene::handleMessage);
@@ -188,6 +190,7 @@ Background *Scene::addBackground(Background *background) {
void Scene::setBackground(uint32 fileHash) {
_background = addBackground(new Background(_vm, fileHash, 0, 0));
+ _backgroundFileHash = fileHash;
}
void Scene::changeBackground(uint32 fileHash) {
@@ -216,14 +219,17 @@ void Scene::insertScreenMouse(uint32 fileHash, const NRect *mouseRect) {
if (mouseRect)
rect = *mouseRect;
insertMouse(new Mouse(_vm, fileHash, rect));
+ _cursorFileHash = fileHash;
}
void Scene::insertPuzzleMouse(uint32 fileHash, int16 x1, int16 x2) {
insertMouse(new Mouse(_vm, fileHash, x1, x2));
+ _cursorFileHash = fileHash;
}
void Scene::insertNavigationMouse(uint32 fileHash, int type) {
insertMouse(new Mouse(_vm, fileHash, type));
+ _cursorFileHash = fileHash;
}
void Scene::showMouse(bool visible) {
diff --git a/engines/neverhood/scene.h b/engines/neverhood/scene.h
index cd44ba7bb1..f60e291395 100644
--- a/engines/neverhood/scene.h
+++ b/engines/neverhood/scene.h
@@ -162,6 +162,10 @@ public:
T* createSprite(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6) {
return new T(_vm, arg1, arg2, arg3, arg4, arg5, arg6);
}
+
+ uint32 getBackgroundFileHash() const { return _backgroundFileHash; }
+ uint32 getCursorFileHash() const { return _cursorFileHash; }
+
protected:
Module *_parentModule;
Common::Array<Entity*> _entities;
@@ -197,6 +201,9 @@ protected:
HitRectList *_hitRects;
Common::Array<Sprite*> _collisionSprites;
+ // Used for debugging
+ uint32 _backgroundFileHash, _cursorFileHash; // for StaticScene and all Scene* classes
+
void (Entity::*_savedUpdateHandlerCb)();
uint32 (Entity::*_savedMessageHandlerCb)(int messageNum, const MessageParam &param, Entity *sender);
int _messageValue;
diff --git a/engines/neverhood/smackerscene.h b/engines/neverhood/smackerscene.h
index 7ed2e0262b..8e5084512f 100644
--- a/engines/neverhood/smackerscene.h
+++ b/engines/neverhood/smackerscene.h
@@ -36,6 +36,7 @@ public:
void setFileHash(uint32 fileHash);
void setFileHashList(const uint32 *fileHashList);
void nextVideo();
+ uint32 getSmackerFileHash() const { return _fileHash[0]; }
protected:
bool _doubleSurface;
bool _canSkip;