[Scummvm-git-logs] scummvm master -> 7abe6c2d7b9151f450e474f6b1bec71e5c276117
mgerhardy
noreply at scummvm.org
Mon Dec 13 06:09:44 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
7abe6c2d7b TWINE: Add Debugger commands for playing music
Commit: 7abe6c2d7b9151f450e474f6b1bec71e5c276117
https://github.com/scummvm/scummvm/commit/7abe6c2d7b9151f450e474f6b1bec71e5c276117
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2021-12-13T07:09:40+01:00
Commit Message:
TWINE: Add Debugger commands for playing music
play_music and play_midi
Changed paths:
engines/twine/debugger/console.cpp
engines/twine/debugger/console.h
diff --git a/engines/twine/debugger/console.cpp b/engines/twine/debugger/console.cpp
index dfe303946b..08eb75d15a 100644
--- a/engines/twine/debugger/console.cpp
+++ b/engines/twine/debugger/console.cpp
@@ -32,6 +32,7 @@
#include "twine/scene/scene.h"
#include "twine/text.h"
#include "twine/twine.h"
+#include "twine/audio/music.h"
namespace TwinE {
@@ -42,6 +43,8 @@ TwinEConsole::TwinEConsole(TwinEEngine *engine) : _engine(engine), GUI::Debugger
registerCmd("give_gas", WRAP_METHOD(TwinEConsole, doGiveGas));
registerCmd("give_kashes", WRAP_METHOD(TwinEConsole, doGiveKashes));
registerCmd("play_video", WRAP_METHOD(TwinEConsole, doPlayVideo));
+ registerCmd("play_midi", WRAP_METHOD(TwinEConsole, doPlayMidi));
+ registerCmd("play_music", WRAP_METHOD(TwinEConsole, doPlayMusic));
registerCmd("change_scene", WRAP_METHOD(TwinEConsole, doChangeScene));
registerCmd("toggle_scenery_view", WRAP_METHOD(TwinEConsole, doToggleSceneryView));
registerCmd("magic_points", WRAP_METHOD(TwinEConsole, doAddMagicPoints));
@@ -350,6 +353,26 @@ bool TwinEConsole::doPlayVideo(int argc, const char **argv) {
return true;
}
+bool TwinEConsole::doPlayMidi(int argc, const char **argv) {
+ if (argc <= 1) {
+ debugPrintf("Expected to get a midi id as first parameter\n");
+ return true;
+ }
+ int newMidiIndex = atoi(argv[1]);
+ _engine->_music->playMidiMusic(newMidiIndex);
+ return true;
+}
+
+bool TwinEConsole::doPlayMusic(int argc, const char **argv) {
+ if (argc <= 1) {
+ debugPrintf("Expected to get a music track id as first parameter\n");
+ return true;
+ }
+ int newMusicTrackIndex = atoi(argv[1]);
+ _engine->_music->playTrackMusic(newMusicTrackIndex);
+ return true;
+}
+
bool TwinEConsole::doChangeScene(int argc, const char **argv) {
if (argc <= 1) {
debugPrintf("Expected to get a scene index as first parameter\n");
diff --git a/engines/twine/debugger/console.h b/engines/twine/debugger/console.h
index 57e0330265..48d91c862c 100644
--- a/engines/twine/debugger/console.h
+++ b/engines/twine/debugger/console.h
@@ -36,6 +36,8 @@ private:
bool doToggleSceneryView(int argc, const char **argv);
bool doPlayVideo(int argc, const char **argv);
+ bool doPlayMidi(int argc, const char **argv);
+ bool doPlayMusic(int argc, const char **argv);
bool doPrintGameFlag(int argc, const char **argv);
bool doPrintInventoryFlag(int argc, const char **argv);
bool doPrintHolomapFlag(int argc, const char **argv);
More information about the Scummvm-git-logs
mailing list