diff options
author | Peter Kohaut | 2016-09-30 22:42:40 +0200 |
---|---|---|
committer | Peter Kohaut | 2016-09-30 22:42:40 +0200 |
commit | 0c7d323921baa36f0a6db4b81e906ff402509463 (patch) | |
tree | abc863a31a3ef18d19acb14dbfc6b8a1021dae70 /engines/bladerunner | |
parent | a6f8a39dd3de395fedd26cbe014b23584c8297a8 (diff) | |
download | scummvm-rg350-0c7d323921baa36f0a6db4b81e906ff402509463.tar.gz scummvm-rg350-0c7d323921baa36f0a6db4b81e906ff402509463.tar.bz2 scummvm-rg350-0c7d323921baa36f0a6db4b81e906ff402509463.zip |
BLADERUNNER: add support for uncompressed audio, fixed wrong call to gamescript after loading scene
Diffstat (limited to 'engines/bladerunner')
-rw-r--r-- | engines/bladerunner/aud_stream.cpp | 10 | ||||
-rw-r--r-- | engines/bladerunner/scene.cpp | 7 |
2 files changed, 9 insertions, 8 deletions
diff --git a/engines/bladerunner/aud_stream.cpp b/engines/bladerunner/aud_stream.cpp index 97623f9b7e..4eadb5baf6 100644 --- a/engines/bladerunner/aud_stream.cpp +++ b/engines/bladerunner/aud_stream.cpp @@ -62,9 +62,9 @@ AudStream::~AudStream() { int AudStream::readBuffer(int16 *buffer, const int numSamples) { int samplesRead = 0; - assert(numSamples % 2 == 0); - if (_compressionType == 99) { + assert(numSamples % 2 == 0); + while (samplesRead < numSamples) { if (_deafBlockRemain == 0) { if (_end - _p == 0) @@ -95,8 +95,10 @@ int AudStream::readBuffer(int16 *buffer, const int numSamples) { samplesRead += 2 * bytesConsumed; } } else { - //assert(0 && "readBuffer: Unimplemented"); - warning("AudStream::readBuffer unknown compression type %d", _compressionType); + int bytesToCopy = MIN(2 * numSamples, _end - _p); + memcpy(buffer, _p, bytesToCopy); + _p += bytesToCopy; + samplesRead = bytesToCopy / 2; } return samplesRead; diff --git a/engines/bladerunner/scene.cpp b/engines/bladerunner/scene.cpp index 65efe1306b..0ced4d8b93 100644 --- a/engines/bladerunner/scene.cpp +++ b/engines/bladerunner/scene.cpp @@ -93,16 +93,15 @@ bool Scene::open(int setId, int sceneId, bool isLoadingGame) { if (isLoadingGame) { // TODO: Advance VQA frame if (sceneId >= 73 && sceneId <= 76) - _vm->_script->InitializeScene(); + _vm->_script->SceneLoaded(); return true; } // TODO: set VQADecoder parameters + //_vm->_scene->advanceFrame(0, 0); - // TODO: Set actor position from scene info _vm->_playerActor->setAtXYZ(_actorStartPosition, _actorStartFacing); - - // TODO: Set actor set + //_vm->_playerActor->setSetId(setId); _vm->_script->SceneLoaded(); |