TSAGE: Added sound debugger command

This commit is contained in:
Paul Gilbert 2011-07-27 22:24:06 +10:00
parent 0034257976
commit 4778bf99eb
2 changed files with 15 additions and 1 deletions

View File

@ -38,6 +38,7 @@ Debugger::Debugger() : GUI::Debugger() {
DCmd_Register("listobjects", WRAP_METHOD(Debugger, Cmd_ListObjects));
DCmd_Register("moveobject", WRAP_METHOD(Debugger, Cmd_MoveObject));
DCmd_Register("hotspots", WRAP_METHOD(Debugger, Cmd_Hotspots));
DCmd_Register("sound", WRAP_METHOD(Debugger, Cmd_Sound));
}
static int strToInt(const char *s) {
@ -434,5 +435,18 @@ bool Debugger::Cmd_Hotspots(int argc, const char **argv) {
return false;
}
/**
* Play the specified sound
*/
bool Debugger::Cmd_Sound(int argc, const char **argv) {
if (argc != 2) {
DebugPrintf("Usage: %s <sound number>\n", argv[0]);
return true;
}
int soundNum = strToInt(argv[1]);
_globals->_soundHandler.play(soundNum);
return false;
}
} // End of namespace tSage

View File

@ -42,8 +42,8 @@ protected:
bool Cmd_ClearFlag(int argc, const char **argv);
bool Cmd_ListObjects(int argc, const char **argv);
bool Cmd_MoveObject(int argc, const char **argv);
bool Cmd_Hotspots(int argc, const char **argv);
bool Cmd_Sound(int argc, const char **argv);
};
} // End of namespace tSage