aboutsummaryrefslogtreecommitdiff
path: root/engines/mortevielle
diff options
context:
space:
mode:
authorStrangerke2013-07-25 15:47:31 +0200
committerStrangerke2013-07-25 15:47:31 +0200
commitdb10ddace466522062a18a0c9079292225fb53d0 (patch)
treefd9e05a8476cc8d48c2c9a52031e914b650f19ae /engines/mortevielle
parent8e2fe73afab1b27d70c4cd64c66b70673df5ea98 (diff)
downloadscummvm-rg350-db10ddace466522062a18a0c9079292225fb53d0.tar.gz
scummvm-rg350-db10ddace466522062a18a0c9079292225fb53d0.tar.bz2
scummvm-rg350-db10ddace466522062a18a0c9079292225fb53d0.zip
MORTEVIELLE: Use a specific buffer instead of _mem for noise5 file
Diffstat (limited to 'engines/mortevielle')
-rw-r--r--engines/mortevielle/speech.cpp11
-rw-r--r--engines/mortevielle/speech.h4
-rw-r--r--engines/mortevielle/utils.cpp5
3 files changed, 15 insertions, 5 deletions
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 7fe8c54f2d..3a42c957c8 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -68,6 +68,11 @@ SpeechManager::SpeechManager() {
_queue[i]._freq = 0;
_queue[i]._rep = 0;
}
+ _noise5Buf = nullptr;
+}
+
+SpeechManager::~SpeechManager() {
+ free(_noise5Buf);
}
void SpeechManager::spfrac(int wor) {
@@ -194,10 +199,10 @@ void SpeechManager::loadNoise() {
if (!f.open("bruits")) //Translation: "noise"
error("Missing file - bruits");
- f.read(&_vm->_mem[kAdrNoise * 16], 250 * 128);
+ f.read(&_vm->_mem[kAdrNoise * 16], 250 * 128); // 32000
for (i = 0; i <= 19013; ++i)
- _vm->_mem[(kAdrNoise * 16) + 32000 + i] = _vm->_mem[(kAdrNoise5 * 16) + i];
- f.read(&_vm->_mem[(kAdrNoise1 * 16) + kOffsetB1], 149 * 128);
+ _vm->_mem[(kAdrNoise * 16) + 32000 + i] = _noise5Buf[i];
+ f.read(&_vm->_mem[(kAdrNoise1 * 16) + kOffsetB1], 149 * 128); // 19072
f.close();
}
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index b3d7c15203..ef3211dad9 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -37,7 +37,6 @@ namespace Mortevielle {
const int kAdrNoise = 0x5cb0;/*2C00;*/
const int kAdrNoise1 = 0x6924;
const int kAdrNoise3 = 0x6ba6;/*3AF6;*/
-const int kAdrNoise5 = 0x3b50;
const int kAdrTroct = 0x406b;
const int kAdrWord = 0x4000;
const int kOffsetB1 = 6;
@@ -79,8 +78,11 @@ public:
int16 *_cfiphBuffer;
int _tbi[256];
int _mlec;
+ byte *_noise5Buf;
+ int _noise5Size;
SpeechManager();
+ ~SpeechManager();
void setParent(MortevielleEngine *vm);
void spfrac(int wor);
void charg_car(int &currWordNumb);
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 001b2d3baf..2211a6d569 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2134,7 +2134,10 @@ void MortevielleEngine::loadBRUIT5() {
if (!f.open("bruit5"))
error("Missing file - bruit5");
- f.read(&_mem[kAdrNoise5 * 16], 149 * 128);
+ free(_speechManager._noise5Buf);
+ _speechManager._noise5Size = f.size();
+ _speechManager._noise5Buf = (byte *)malloc(sizeof(byte) * _speechManager._noise5Size);
+ f.read(_speechManager._noise5Buf, _speechManager._noise5Size);
f.close();
}