[Scummvm-git-logs] scummvm master -> 75e9a91dab2b329989b5de79f158c6a98c217d62

bluegr noreply at scummvm.org
Fri Jun 3 22:01:10 UTC 2022


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:
75e9a91dab CHEWY: Readd console debug commands for playing sound, speech and music


Commit: 75e9a91dab2b329989b5de79f158c6a98c217d62
    https://github.com/scummvm/scummvm/commit/75e9a91dab2b329989b5de79f158c6a98c217d62
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-04T01:00:45+03:00

Commit Message:
CHEWY: Readd console debug commands for playing sound, speech and music

Changed paths:
    engines/chewy/console.cpp
    engines/chewy/console.h


diff --git a/engines/chewy/console.cpp b/engines/chewy/console.cpp
index cd53c144817..6230edb9b4e 100644
--- a/engines/chewy/console.cpp
+++ b/engines/chewy/console.cpp
@@ -23,6 +23,7 @@
 #include "chewy/console.h"
 #include "chewy/globals.h"
 #include "chewy/chewy.h"
+#include "chewy/sound.h"
 #include "chewy/video/video_player.h"
 
 namespace Chewy {
@@ -46,7 +47,10 @@ static int strToInt(const char *s) {
 Console::Console() : GUI::Debugger() {
 	registerCmd("room", WRAP_METHOD(Console, Cmd_GotoRoom));
 	registerCmd("item", WRAP_METHOD(Console, Cmd_Item));
-	registerCmd("video", WRAP_METHOD(Console, Cmd_PlayVideo));
+	registerCmd("play_sound", WRAP_METHOD(Console, Cmd_PlaySound));
+	registerCmd("play_speech", WRAP_METHOD(Console, Cmd_PlaySpeech));
+	registerCmd("play_music", WRAP_METHOD(Console, Cmd_PlayMusic));
+	registerCmd("play_video", WRAP_METHOD(Console, Cmd_PlayVideo));
 	registerCmd("walk", WRAP_METHOD(Console, Cmd_WalkAreas));
 	registerCmd("text", WRAP_METHOD(Console, Cmd_Text));
 }
@@ -82,6 +86,43 @@ bool Console::Cmd_Item(int argc, const char **argv) {
 	return true;
 }
 
+bool Console::Cmd_PlaySound(int argc, const char **argv) {
+	if (argc < 2) {
+		debugPrintf("Usage: play_sound <number>\n");
+		return true;
+	}
+
+	int resNum = atoi(argv[1]);
+	g_engine->_sound->playSound(resNum);
+
+	return true;
+}
+
+bool Console::Cmd_PlaySpeech(int argc, const char **argv) {
+	if (argc < 2) {
+		debugPrintf("Usage: play_speech <number>\n");
+		return true;
+	}
+
+	int resNum = atoi(argv[1]);
+	g_engine->_sound->playSpeech(resNum, false);
+
+	return true;
+}
+
+bool Console::Cmd_PlayMusic(int argc, const char **argv) {
+	if (argc < 2) {
+		debugPrintf("Usage: play_music <number>\n");
+		return true;
+	}
+
+	int resNum = atoi(argv[1]);
+	g_engine->_sound->stopMusic();
+	g_engine->_sound->playMusic(resNum);
+
+	return true;
+}
+
 bool Console::Cmd_PlayVideo(int argc, const char **argv) {
 	if (argc < 2) {
 		debugPrintf("Usage: play_video <number>\n");
diff --git a/engines/chewy/console.h b/engines/chewy/console.h
index 41263119396..736eabf09bd 100644
--- a/engines/chewy/console.h
+++ b/engines/chewy/console.h
@@ -30,6 +30,9 @@ class Console : public GUI::Debugger {
 protected:
 	bool Cmd_GotoRoom(int argc, const char **argv);
 	bool Cmd_Item(int argc, const char **argv);
+	bool Cmd_PlaySound(int argc, const char **argv);
+	bool Cmd_PlaySpeech(int argc, const char **argv);
+	bool Cmd_PlayMusic(int argc, const char **argv);
 	bool Cmd_PlayVideo(int argc, const char **argv);
 	bool Cmd_WalkAreas(int argc, const char **argv);
 	bool Cmd_Text(int argc, const char **argv);




More information about the Scummvm-git-logs mailing list