aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2017-01-08 20:20:47 +0200
committerFilippos Karapetis2017-01-08 20:24:39 +0200
commit4dc6aa2d93a3e166891713549d73c4e40fe9f4f2 (patch)
tree1284d83e82aef27f6bbf21314bac22285f2f30aa
parentf3ea11f402102f88750e98dd5b55779695ff832f (diff)
downloadscummvm-rg350-4dc6aa2d93a3e166891713549d73c4e40fe9f4f2.tar.gz
scummvm-rg350-4dc6aa2d93a3e166891713549d73c4e40fe9f4f2.tar.bz2
scummvm-rg350-4dc6aa2d93a3e166891713549d73c4e40fe9f4f2.zip
CHEWY: Add console command to change scenes
-rw-r--r--engines/chewy/console.cpp15
-rw-r--r--engines/chewy/console.h1
-rw-r--r--engines/chewy/scene.cpp2
-rw-r--r--engines/chewy/scene.h3
4 files changed, 20 insertions, 1 deletions
diff --git a/engines/chewy/console.cpp b/engines/chewy/console.cpp
index cb2d5e21c1..6fbd99278f 100644
--- a/engines/chewy/console.cpp
+++ b/engines/chewy/console.cpp
@@ -26,6 +26,7 @@
#include "chewy/console.h"
#include "chewy/graphics.h"
#include "chewy/resource.h"
+#include "chewy/scene.h"
#include "chewy/sound.h"
#include "chewy/text.h"
@@ -43,6 +44,7 @@ Console::Console(ChewyEngine *vm) : GUI::Debugger(), _vm(vm) {
registerCmd("error_message", WRAP_METHOD(Console, Cmd_ErrorMessage));
registerCmd("dialog", WRAP_METHOD(Console, Cmd_Dialog));
registerCmd("text", WRAP_METHOD(Console, Cmd_Text));
+ registerCmd("scene", WRAP_METHOD(Console, Cmd_Scene));
}
Console::~Console() {
@@ -235,4 +237,17 @@ bool Console::Cmd_Text(int argc, const char **argv) {
return true;
}
+bool Console::Cmd_Scene(int argc, const char **argv) {
+ if (argc < 2) {
+ debugPrintf("Current scene is: %d\n", _vm->_scene->getCurScene());
+ debugPrintf("Use scene <scene num> to change the scene\n");
+ return true;
+ }
+
+ int sceneNum = atoi(argv[1]);
+ _vm->_scene->change(sceneNum);
+
+ return false;
+}
+
} // End of namespace Chewy
diff --git a/engines/chewy/console.h b/engines/chewy/console.h
index 4953480644..ae2be15f30 100644
--- a/engines/chewy/console.h
+++ b/engines/chewy/console.h
@@ -48,6 +48,7 @@ private:
bool Cmd_ErrorMessage(int argc, const char **argv);
bool Cmd_Dialog(int argc, const char **argv);
bool Cmd_Text(int argc, const char **argv);
+ bool Cmd_Scene(int argc, const char **argv);
};
} // End of namespace Chewy
diff --git a/engines/chewy/scene.cpp b/engines/chewy/scene.cpp
index c6c12fc3ff..0f12219078 100644
--- a/engines/chewy/scene.cpp
+++ b/engines/chewy/scene.cpp
@@ -177,7 +177,7 @@ void Scene::loadSceneInfo() {
for (int i = 0; i < MAX_HOTSPOTS; i++) {
_sceneInfo->hotspotDescRes[i] = indexFile.readUint16LE();
- if (_sceneInfo->hotspotDescRes[i] < kATSTextMax) {
+ if (_sceneInfo->hotspotDescRes[i] < 12) {
// TODO: Hotspot description IDs are off... investigate why
_sceneInfo->hotspotDesc[i] = text->getText(_curScene + kADSTextMax, _sceneInfo->hotspotDescRes[i])->text;
} else {
diff --git a/engines/chewy/scene.h b/engines/chewy/scene.h
index 24692c8486..c5b87ac7ae 100644
--- a/engines/chewy/scene.h
+++ b/engines/chewy/scene.h
@@ -37,6 +37,9 @@ public:
void change(uint scene);
void draw();
void updateMouse(Common::Point coords);
+ uint getCurScene() const {
+ return _curScene;
+ }
private:
void loadSceneInfo();