aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/console.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mohawk/console.cpp')
-rw-r--r--engines/mohawk/console.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp
index 05012bec3d..e7dc84606c 100644
--- a/engines/mohawk/console.cpp
+++ b/engines/mohawk/console.cpp
@@ -700,14 +700,25 @@ bool LivingBooksConsole::Cmd_DrawImage(int argc, const char **argv) {
}
bool LivingBooksConsole::Cmd_ChangePage(int argc, const char **argv) {
- if (argc == 1) {
- DebugPrintf("Usage: changePage <page> [<mode>]\n");
+ if (argc < 2 || argc > 3) {
+ DebugPrintf("Usage: changePage <page>[.<subpage>] [<mode>]\n");
return true;
}
- if (_vm->tryLoadPageStart(argc == 2 ? _vm->getCurMode() : (LBMode)atoi(argv[2]), atoi(argv[1])))
- return false;
- DebugPrintf("no such page %d\n", atoi(argv[1]));
+ int page, subpage = 0;
+ if (sscanf(argv[1], "%d.%d", &page, &subpage) == 0) {
+ DebugPrintf("Usage: changePage <page>[.<subpage>] [<mode>]\n");
+ return true;
+ }
+ LBMode mode = argc == 2 ? _vm->getCurMode() : (LBMode)atoi(argv[2]);
+ if (subpage == 0) {
+ if (_vm->tryLoadPageStart(mode, page))
+ return false;
+ } else {
+ if (_vm->loadPage(mode, page, subpage))
+ return false;
+ }
+ DebugPrintf("no such page %d.%d\n", page, subpage);
return true;
}