MOHAWK: LB: Add a console command to change the cursor

This commit is contained in:
Cameron Cawley 2019-12-31 15:04:16 +00:00 committed by Filippos Karapetis
parent ff3f7170f8
commit 4d9ec631f1
2 changed files with 13 additions and 0 deletions

View File

@ -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 <value>\n");
return true;
}
_vm->_cursor->setCursor((uint16)atoi(argv[1]));
return true;
}
#ifdef ENABLE_CSTIME
CSTimeConsole::CSTimeConsole(MohawkEngine_CSTime *vm) : GUI::Debugger(), _vm(vm) {

View File

@ -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