aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/console.cpp19
-rw-r--r--engines/sci/console.h1
-rw-r--r--engines/sci/graphics/paint32.cpp8
-rw-r--r--engines/sci/graphics/paint32.h1
-rw-r--r--engines/sci/graphics/robot.cpp5
-rw-r--r--engines/sci/graphics/robot.h1
6 files changed, 35 insertions, 0 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 943be4bfa7..1ff0a1550c 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -121,6 +121,7 @@ Console::Console(SciEngine *engine) : GUI::Debugger(),
DCmd_Register("draw_cel", WRAP_METHOD(Console, cmdDrawCel));
#ifdef ENABLE_SCI32
DCmd_Register("draw_robot", WRAP_METHOD(Console, cmdDrawRobot));
+ DCmd_Register("play_robot_audio", WRAP_METHOD(Console, cmdPlayRobotAudio));
#endif
DCmd_Register("undither", WRAP_METHOD(Console, cmdUndither));
DCmd_Register("pic_visualize", WRAP_METHOD(Console, cmdPicVisualize));
@@ -1527,6 +1528,24 @@ bool Console::cmdDrawRobot(int argc, const char **argv) {
}
return true;
}
+
+bool Console::cmdPlayRobotAudio(int argc, const char **argv) {
+ if (argc < 2) {
+ DebugPrintf("Draws frames from a robot resource\n");
+ DebugPrintf("Usage: %s <resourceId>\n", argv[0]);
+ DebugPrintf("where <resourceId> is the id of the robot resource to draw\n");
+ return true;
+ }
+
+ uint16 resourceId = atoi(argv[1]);
+
+ if (_engine->_gfxPaint32) {
+ _engine->_gfxPaint32->debugPlayRobotAudio(resourceId);
+ } else {
+ DebugPrintf("command not available in non-sci32 games");
+ }
+ return true;
+}
#endif
bool Console::cmdUndither(int argc, const char **argv) {
diff --git a/engines/sci/console.h b/engines/sci/console.h
index 670c89e672..140b0883e0 100644
--- a/engines/sci/console.h
+++ b/engines/sci/console.h
@@ -93,6 +93,7 @@ private:
bool cmdDrawCel(int argc, const char **argv);
#ifdef ENABLE_SCI32
bool cmdDrawRobot(int argc, const char **argv);
+ bool cmdPlayRobotAudio(int argc, const char **argv);
#endif
bool cmdUndither(int argc, const char **argv);
bool cmdPicVisualize(int argc, const char **argv);
diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp
index 0167593084..974efd371a 100644
--- a/engines/sci/graphics/paint32.cpp
+++ b/engines/sci/graphics/paint32.cpp
@@ -90,4 +90,12 @@ void GfxPaint32::debugDrawRobot(GuiResourceId robotId) {
delete test;
}
+void GfxPaint32::debugPlayRobotAudio(GuiResourceId robotId) {
+ GfxRobot *test = new GfxRobot(g_sci->getResMan(), _screen, _palette);
+ test->init(robotId, 0, 0);
+ test->playAudio();
+ delete test;
+}
+
+
} // End of namespace Sci
diff --git a/engines/sci/graphics/paint32.h b/engines/sci/graphics/paint32.h
index a048d7f307..7fbaf4594e 100644
--- a/engines/sci/graphics/paint32.h
+++ b/engines/sci/graphics/paint32.h
@@ -49,6 +49,7 @@ public:
void kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control);
void debugDrawRobot(GuiResourceId robotId);
+ void debugPlayRobotAudio(GuiResourceId robotId);
private:
ResourceManager *_resMan;
diff --git a/engines/sci/graphics/robot.cpp b/engines/sci/graphics/robot.cpp
index 853e111daa..c2e0796a27 100644
--- a/engines/sci/graphics/robot.cpp
+++ b/engines/sci/graphics/robot.cpp
@@ -292,6 +292,11 @@ int GfxRobot::getFrameScale(int frame) {
byte *videoData = _resourceData + _imageStart[frame];
return videoData[3];
}
+
+void GfxRobot::playAudio() {
+// Audio::Mixer *mixer = g_system->getMixer();
+}
+
#endif
diff --git a/engines/sci/graphics/robot.h b/engines/sci/graphics/robot.h
index d794c4ba60..f26ea84ad3 100644
--- a/engines/sci/graphics/robot.h
+++ b/engines/sci/graphics/robot.h
@@ -41,6 +41,7 @@ public:
uint16 getCurFrame() { return _curFrame; }
uint16 getFrameCount() { return _frameCount; }
bool isPlaying() { return _resourceId != -1; }
+ void playAudio();
private:
void initData(GuiResourceId resourceId);