From 11b1d4763899115ca2afa3d1751b53dfb9437fbb Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 26 Dec 2016 22:47:24 -0800 Subject: CRYO: Turn _voiceSamplesBuffer into a byte* --- engines/cryo/eden.cpp | 20 ++++++++++---------- engines/cryo/eden.h | 2 +- 2 files changed, 11 insertions(+), 11 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; } } diff --git a/engines/cryo/eden.h b/engines/cryo/eden.h index 0debe70c71..ddf9dc663e 100644 --- a/engines/cryo/eden.h +++ b/engines/cryo/eden.h @@ -610,7 +610,7 @@ private: color_t oldPalette[256]; // TODO palette_t ? color_t newPalette[256]; Common::Rect rect_dst, rect_src; - void *voiceSamplesBuffer; //TODO: sound sample buffer + byte *_voiceSamplesBuffer; //TODO: sound sample buffer Common::File h_bigfile; byte _infoList[16]; bool needToFade; -- cgit v1.2.3