aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2016-12-26 22:47:24 -0800
committerEugene Sandulenko2017-01-25 22:42:17 +0100
commit11b1d4763899115ca2afa3d1751b53dfb9437fbb (patch)
tree4a7c14ba6db3b5a1ec3040340c291da221603931
parent939aa635830c078e09485a4138ece16d602860e6 (diff)
downloadscummvm-rg350-11b1d4763899115ca2afa3d1751b53dfb9437fbb.tar.gz
scummvm-rg350-11b1d4763899115ca2afa3d1751b53dfb9437fbb.tar.bz2
scummvm-rg350-11b1d4763899115ca2afa3d1751b53dfb9437fbb.zip
CRYO: Turn _voiceSamplesBuffer into a byte*
-rw-r--r--engines/cryo/eden.cpp20
-rw-r--r--engines/cryo/eden.h2
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;