mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 21:59:17 +00:00
TITANIC: Added frame debugger command for setting objects' movie frames
This commit is contained in:
parent
a97fe8f89f
commit
72b033ca2d
@ -44,6 +44,7 @@ Debugger::Debugger(TitanicEngine *vm) : GUI::Debugger(), _vm(vm) {
|
||||
registerCmd("movie", WRAP_METHOD(Debugger, cmdMovie));
|
||||
registerCmd("sound", WRAP_METHOD(Debugger, cmdSound));
|
||||
registerCmd("cheat", WRAP_METHOD(Debugger, cmdCheat));
|
||||
registerCmd("frame", WRAP_METHOD(Debugger, cmdFrame));
|
||||
}
|
||||
|
||||
int Debugger::strToInt(const char *s) {
|
||||
@ -346,4 +347,22 @@ bool Debugger::cmdCheat(int argc, const char **argv) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Debugger::cmdFrame(int argc, const char **argv) {
|
||||
if (argc == 3) {
|
||||
CGameObject *obj = dynamic_cast<CGameObject *>(
|
||||
g_vm->_window->_project->findByName(argv[1]));
|
||||
|
||||
if (obj) {
|
||||
obj->loadFrame(strToInt(argv[2]));
|
||||
return false;
|
||||
} else {
|
||||
debugPrintf("Object not found\n");
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
debugPrintf("frame <object> <frame number>");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
@ -115,6 +115,11 @@ private:
|
||||
* Change to the cheat room
|
||||
*/
|
||||
bool cmdCheat(int argc, const char **argv);
|
||||
|
||||
/**
|
||||
* Set the movie frame for a given object
|
||||
*/
|
||||
bool cmdFrame(int argc, const char **argv);
|
||||
protected:
|
||||
TitanicEngine *_vm;
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user