Skip to content

Commit

Permalink
TSAGE: Added sound debugger command
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Jul 27, 2011
1 parent 0034257 commit 4778bf9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions engines/tsage/debugger.cpp
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion engines/tsage/debugger.h
Expand Up @@ -42,8 +42,8 @@ class Debugger : public GUI::Debugger {
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
Expand Down

0 comments on commit 4778bf9

Please sign in to comment.