aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/robot.cpp18
-rw-r--r--engines/sci/graphics/robot.h1
2 files changed, 17 insertions, 2 deletions
diff --git a/engines/sci/graphics/robot.cpp b/engines/sci/graphics/robot.cpp
index 0792c6596e..3049fa7fce 100644
--- a/engines/sci/graphics/robot.cpp
+++ b/engines/sci/graphics/robot.cpp
@@ -27,8 +27,13 @@
#include "sci/engine/state.h"
#include "sci/graphics/screen.h"
#include "sci/graphics/robot.h"
+#include "sci/sound/audio.h"
+
+#include "sound/audiostream.h"
+#include "sound/mixer.h"
#include "common/file.h"
+#include "common/system.h"
namespace Sci {
@@ -64,9 +69,9 @@ void GfxRobot::initData(GuiResourceId resourceId) {
_audioSize = READ_LE_UINT16(_resourceData + 15);
//_frameSize = READ_LE_UINT32(_resourceData + 34);
- byte hasSound = _resourceData[25];
+ _hasSound = (_resourceData[25] != 0);
- debug("Robot %d, %d frames, sound: %d\n", resourceId, _frameCount, hasSound);
+ debug("Robot %d, %d frames, sound: %s\n", resourceId, _frameCount, _hasSound ? "yes" : "no");
}
// TODO: just trying around in here...
@@ -76,6 +81,15 @@ void GfxRobot::draw() {
int x, y;
int frame;
+ // Play the audio of the robot file (for debugging)
+#if 0
+ if (_hasSound) {
+ Audio::SoundHandle _audioHandle;
+ Audio::AudioStream *audioStream = g_sci->_audio->getRobotAudioStream(_resourceData);
+ g_system->getMixer()->playStream(Audio::Mixer::kSpeechSoundType, &_audioHandle, audioStream);
+ }
+#endif
+
return;
// Each frame contains these bytes:
diff --git a/engines/sci/graphics/robot.h b/engines/sci/graphics/robot.h
index 76dca35a82..a9f1d3c4df 100644
--- a/engines/sci/graphics/robot.h
+++ b/engines/sci/graphics/robot.h
@@ -52,6 +52,7 @@ private:
uint16 _frameCount;
uint32 _frameSize; // is width * height (pixelCount)
uint16 _audioSize;
+ bool _hasSound;
};
#endif