From 4d9ec631f122721ee0a4533461c9042b1dc6c11e Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Tue, 31 Dec 2019 15:04:16 +0000 Subject: MOHAWK: LB: Add a console command to change the cursor --- engines/mohawk/console.cpp | 12 ++++++++++++ engines/mohawk/console.h | 1 + 2 files changed, 13 insertions(+) diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp index 1cb6c8daee..2bbb525870 100644 --- a/engines/mohawk/console.cpp +++ b/engines/mohawk/console.cpp @@ -21,6 +21,7 @@ */ #include "mohawk/console.h" +#include "mohawk/cursors.h" #include "mohawk/livingbooks.h" #include "mohawk/resource.h" #include "mohawk/sound.h" @@ -754,6 +755,7 @@ LivingBooksConsole::LivingBooksConsole(MohawkEngine_LivingBooks *vm) : GUI::Debu registerCmd("stopSound", WRAP_METHOD(LivingBooksConsole, Cmd_StopSound)); registerCmd("drawImage", WRAP_METHOD(LivingBooksConsole, Cmd_DrawImage)); registerCmd("changePage", WRAP_METHOD(LivingBooksConsole, Cmd_ChangePage)); + registerCmd("changeCursor", WRAP_METHOD(LivingBooksConsole, Cmd_ChangeCursor)); } LivingBooksConsole::~LivingBooksConsole() { @@ -811,6 +813,16 @@ bool LivingBooksConsole::Cmd_ChangePage(int argc, const char **argv) { return true; } +bool LivingBooksConsole::Cmd_ChangeCursor(int argc, const char **argv) { + if (argc == 1) { + debugPrintf("Usage: changeCursor \n"); + return true; + } + + _vm->_cursor->setCursor((uint16)atoi(argv[1])); + return true; +} + #ifdef ENABLE_CSTIME CSTimeConsole::CSTimeConsole(MohawkEngine_CSTime *vm) : GUI::Debugger(), _vm(vm) { diff --git a/engines/mohawk/console.h b/engines/mohawk/console.h index 88db580ca8..0e24857158 100644 --- a/engines/mohawk/console.h +++ b/engines/mohawk/console.h @@ -106,6 +106,7 @@ private: bool Cmd_StopSound(int argc, const char **argv); bool Cmd_DrawImage(int argc, const char **argv); bool Cmd_ChangePage(int argc, const char **argv); + bool Cmd_ChangeCursor(int argc, const char **argv); }; #ifdef ENABLE_CSTIME -- cgit v1.2.3