mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-20 00:45:10 +00:00
TITANIC: Added sound command to debugger
This commit is contained in:
parent
0b18b0b1b5
commit
6044ba16ce
@ -36,6 +36,7 @@ Debugger::Debugger(TitanicEngine *vm) : GUI::Debugger(), _vm(vm) {
|
||||
registerCmd("pet", WRAP_METHOD(Debugger, cmdPET));
|
||||
registerCmd("item", WRAP_METHOD(Debugger, cmdItem));
|
||||
registerCmd("movie", WRAP_METHOD(Debugger, cmdMovie));
|
||||
registerCmd("sound", WRAP_METHOD(Debugger, cmdSound));
|
||||
}
|
||||
|
||||
int Debugger::strToInt(const char *s) {
|
||||
@ -294,4 +295,23 @@ bool Debugger::cmdMovie(int argc, const char **argv) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Debugger::cmdSound(int argc, const char **argv) {
|
||||
if (argc == 2) {
|
||||
Common::String name = argv[1];
|
||||
const char *ch = strchr(argv[1], '!');
|
||||
if (ch)
|
||||
name.setChar('#', ch - argv[1]);
|
||||
if (!name.contains("#"))
|
||||
name = "z#" + name;
|
||||
|
||||
CGameManager *gameManager = g_vm->_window->_gameManager;
|
||||
CProximity prox;
|
||||
gameManager->_sound.playSound(name, prox);
|
||||
return false;
|
||||
} else {
|
||||
debugPrintf("sound <name>\n");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
@ -94,6 +94,11 @@ private:
|
||||
* Shows a movie
|
||||
*/
|
||||
bool cmdMovie(int argc, const char **argv);
|
||||
|
||||
/**
|
||||
* Play a sound
|
||||
*/
|
||||
bool cmdSound(int argc, const char **argv);
|
||||
protected:
|
||||
TitanicEngine *_vm;
|
||||
public:
|
||||
|
Loading…
x
Reference in New Issue
Block a user