diff options
author | Strangerke | 2016-12-26 22:47:24 -0800 |
---|---|---|
committer | Eugene Sandulenko | 2017-01-25 22:42:17 +0100 |
commit | 11b1d4763899115ca2afa3d1751b53dfb9437fbb (patch) | |
tree | 4a7c14ba6db3b5a1ec3040340c291da221603931 /engines/cryo/eden.cpp | |
parent | 939aa635830c078e09485a4138ece16d602860e6 (diff) | |
download | scummvm-rg350-11b1d4763899115ca2afa3d1751b53dfb9437fbb.tar.gz scummvm-rg350-11b1d4763899115ca2afa3d1751b53dfb9437fbb.tar.bz2 scummvm-rg350-11b1d4763899115ca2afa3d1751b53dfb9437fbb.zip |
CRYO: Turn _voiceSamplesBuffer into a byte*
Diffstat (limited to 'engines/cryo/eden.cpp')
-rw-r--r-- | engines/cryo/eden.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/engines/cryo/eden.cpp b/engines/cryo/eden.cpp index 3ac51eff0f..73d321ed44 100644 --- a/engines/cryo/eden.cpp +++ b/engines/cryo/eden.cpp @@ -87,7 +87,7 @@ EdenGame::EdenGame(CryoEngine *vm) : _vm(vm) { dword_30B04 = 0; lastPhrasesFile = 0; dialogSkipFlags = 0; - voiceSamplesBuffer = nullptr; + _voiceSamplesBuffer = nullptr; needToFade = false; lastMusicNum = 0; _mainBankBuf = nullptr; @@ -4822,22 +4822,22 @@ int EdenGame::ssndfl(uint16 num) { int32 offs = file->_offs; debug("* Loading sound %d (%s) at 0x%X, %d bytes", num, file->_name.c_str(), (uint)offs, size); if (_soundAllocated) { - free(voiceSamplesBuffer); - voiceSamplesBuffer = nullptr; + free(_voiceSamplesBuffer); + _voiceSamplesBuffer = nullptr; _soundAllocated = false; //TODO: bug??? no alloc } else { - voiceSamplesBuffer = malloc(size); + _voiceSamplesBuffer = (byte *)malloc(size); _soundAllocated = true; } h_bigfile.seek(offs, SEEK_SET); //For PC loaded data is a VOC file, on Mac version this is a raw samples if (_vm->getPlatform() == Common::kPlatformMacintosh) - h_bigfile.read(voiceSamplesBuffer, size); + h_bigfile.read(_voiceSamplesBuffer, size); else { // VOC files also include extra information for lipsync // 1. Standard VOC header - h_bigfile.read(voiceSamplesBuffer, 0x1A); + h_bigfile.read(_voiceSamplesBuffer, 0x1A); // 2. Lipsync? unsigned char chunkType = h_bigfile.readByte(); @@ -4859,7 +4859,7 @@ int EdenGame::ssndfl(uint16 num) { if (chunkType == 1) { /*unsigned short freq = */h_bigfile.readUint16LE(); size = chunkLen - 2; - h_bigfile.read(voiceSamplesBuffer, size); + h_bigfile.read(_voiceSamplesBuffer, size); } } @@ -6612,7 +6612,7 @@ void EdenGame::persovox() { volumeLeft = p_global->_prefVoiceVol[0]; volumeRight = p_global->_prefVoiceVol[1]; _voiceChannel->setVolume(volumeLeft, volumeRight); - _voiceChannel->queueBuffer((byte*)voiceSamplesBuffer, _voiceSamplesSize, true); + _voiceChannel->queueBuffer(_voiceSamplesBuffer, _voiceSamplesSize, true); _personTalking = true; _musicFadeFlag = 0; _lastAnimTicks = _vm->_timerTicks; @@ -6627,8 +6627,8 @@ void EdenGame::endpersovox() { } if (_soundAllocated) { - free(voiceSamplesBuffer); - voiceSamplesBuffer = nullptr; + free(_voiceSamplesBuffer); + _voiceSamplesBuffer = nullptr; _soundAllocated = false; } } |