Added a debug subcommand to enable a hotspot's position to be changed

svn-id: r36095
This commit is contained in:
Paul Gilbert 2009-01-27 10:27:07 +00:00
parent f9d0d2a44a
commit 6ef26264f4

View file

@ -291,7 +291,7 @@ bool Debugger::cmd_hotspot(int argc, const char **argv) {
Hotspot *h; Hotspot *h;
if (argc < 2) { if (argc < 2) {
DebugPrintf("hotspot <hotspot_id> ['paths' | 'schedule' | 'actions' | 'activate' | 'deactivate']\n"); DebugPrintf("hotspot <hotspot_id> ['paths' | 'schedule' | 'actions' | 'activate' | 'deactivate' | 'setpos']\n");
return true; return true;
} }
hs = res.getHotspot(strToInt(argv[1])); hs = res.getHotspot(strToInt(argv[1]));
@ -372,6 +372,14 @@ bool Debugger::cmd_hotspot(int argc, const char **argv) {
pData.upFrame, pData.downFrame, pData.leftFrame, pData.rightFrame); pData.upFrame, pData.downFrame, pData.leftFrame, pData.rightFrame);
DebugPrintf("Current frame = %d of %d\n", h->frameNumber(), h->numFrames()); DebugPrintf("Current frame = %d of %d\n", h->frameNumber(), h->numFrames());
} }
else if (strcmp(argv[2], "setpos") == 0) {
// Set the hotspot position
if (argc >= 5)
h->setPosition(strToInt(argv[3]), strToInt(argv[4]));
if (argc >= 6)
h->setRoomNumber(strToInt(argv[5]));
DebugPrintf("Done.\n");
}
} }
DebugPrintf("\n"); DebugPrintf("\n");