Skip to content

Commit

Permalink
BLADERUNNER: add support for uncompressed audio, fixed wrong call to …
Browse files Browse the repository at this point in the history
…gamescript after loading scene
  • Loading branch information
peterkohaut committed Sep 30, 2016
1 parent a6f8a39 commit 0c7d323
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 6 additions & 4 deletions engines/bladerunner/aud_stream.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 3 additions & 4 deletions engines/bladerunner/scene.cpp
Expand Up @@ -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();

Expand Down

0 comments on commit 0c7d323

Please sign in to comment.