[Scummvm-cvs-logs] SF.net SVN: scummvm:[55424] scummvm/trunk/engines/sci
lskovlun at users.sourceforge.net
lskovlun at users.sourceforge.net
Sat Jan 22 14:12:01 CET 2011
Revision: 55424
http://scummvm.svn.sourceforge.net/scummvm/?rev=55424&view=rev
Author: lskovlun
Date: 2011-01-22 13:12:01 +0000 (Sat, 22 Jan 2011)
Log Message:
-----------
SCI: Added stub for playing robot audio from the console
Modified Paths:
--------------
scummvm/trunk/engines/sci/console.cpp
scummvm/trunk/engines/sci/console.h
scummvm/trunk/engines/sci/graphics/paint32.cpp
scummvm/trunk/engines/sci/graphics/paint32.h
scummvm/trunk/engines/sci/graphics/robot.cpp
scummvm/trunk/engines/sci/graphics/robot.h
Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp 2011-01-22 13:03:54 UTC (rev 55423)
+++ scummvm/trunk/engines/sci/console.cpp 2011-01-22 13:12:01 UTC (rev 55424)
@@ -121,6 +121,7 @@
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 @@
}
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) {
Modified: scummvm/trunk/engines/sci/console.h
===================================================================
--- scummvm/trunk/engines/sci/console.h 2011-01-22 13:03:54 UTC (rev 55423)
+++ scummvm/trunk/engines/sci/console.h 2011-01-22 13:12:01 UTC (rev 55424)
@@ -93,6 +93,7 @@
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);
Modified: scummvm/trunk/engines/sci/graphics/paint32.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint32.cpp 2011-01-22 13:03:54 UTC (rev 55423)
+++ scummvm/trunk/engines/sci/graphics/paint32.cpp 2011-01-22 13:12:01 UTC (rev 55424)
@@ -90,4 +90,12 @@
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
Modified: scummvm/trunk/engines/sci/graphics/paint32.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/paint32.h 2011-01-22 13:03:54 UTC (rev 55423)
+++ scummvm/trunk/engines/sci/graphics/paint32.h 2011-01-22 13:12:01 UTC (rev 55424)
@@ -49,6 +49,7 @@
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;
Modified: scummvm/trunk/engines/sci/graphics/robot.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/robot.cpp 2011-01-22 13:03:54 UTC (rev 55423)
+++ scummvm/trunk/engines/sci/graphics/robot.cpp 2011-01-22 13:12:01 UTC (rev 55424)
@@ -292,6 +292,11 @@
byte *videoData = _resourceData + _imageStart[frame];
return videoData[3];
}
+
+void GfxRobot::playAudio() {
+// Audio::Mixer *mixer = g_system->getMixer();
+}
+
#endif
Modified: scummvm/trunk/engines/sci/graphics/robot.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/robot.h 2011-01-22 13:03:54 UTC (rev 55423)
+++ scummvm/trunk/engines/sci/graphics/robot.h 2011-01-22 13:12:01 UTC (rev 55424)
@@ -41,6 +41,7 @@
uint16 getCurFrame() { return _curFrame; }
uint16 getFrameCount() { return _frameCount; }
bool isPlaying() { return _resourceId != -1; }
+ void playAudio();
private:
void initData(GuiResourceId resourceId);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list