AGOS: Enhance 'music' debugger command with optional track number

This commit is contained in:
Eugene Sandulenko 2024-05-28 14:46:43 +02:00
parent bde3fe3f77
commit dc5c2f9946
No known key found for this signature in database
GPG Key ID: 014D387312D34F08

View File

@ -54,15 +54,18 @@ bool Debugger::Cmd_PlayMusic(int argc, const char **argv) {
if (_vm->getGameType() == GType_PP) {
// TODO
} else if (_vm->getGameType() == GType_SIMON2) {
uint track = 0;
if (argc > 2)
track = atoi(argv[2]);
_vm->loadMusic(music);
_vm->_midi->play();
_vm->_midi->play(track);
} else {
_vm->playMusic(music, 0);
}
} else
debugPrintf("Music out of range (0 - %d)\n", _vm->_numMusic);
} else
debugPrintf("Syntax: music <musicnum>\n");
debugPrintf("Syntax: music <musicnum> [<tracknum>]\n");
return true;
}