MORTEVIELLE: Remove another use of _mem

This commit is contained in:
Strangerke 2013-07-26 13:10:54 +02:00
parent db10ddace4
commit 8009b2ebd8
4 changed files with 12 additions and 9 deletions

View File

@ -104,12 +104,14 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
_curPict = nullptr;
_curAnim = nullptr;
_rightFramePict = nullptr;
_compMusicBuf2 = nullptr;
}
MortevielleEngine::~MortevielleEngine() {
free(_curPict);
free(_curAnim);
free(_rightFramePict);
free(_compMusicBuf2);
}
/**

View File

@ -66,7 +66,6 @@ namespace Mortevielle {
const int kAdrMusic = 0x5000;
const int kAdrCompMusicBuf1 = 0x7414;
const int kAdrCompMusicBuf2 = 0x3800;
#define ord(v) ((int) v)
#define chr(v) ((unsigned char) v)
@ -478,6 +477,7 @@ public:
byte *_curPict;
byte *_curAnim;
byte *_rightFramePict;
byte *_compMusicBuf2;
Debugger _debugger;
ScreenSurface _screenSurface;

View File

@ -194,13 +194,12 @@ void SpeechManager::loadPhonemeSounds() {
*/
void SpeechManager::loadNoise() {
Common::File f;
int i;
if (!f.open("bruits")) //Translation: "noise"
error("Missing file - bruits");
f.read(&_vm->_mem[kAdrNoise * 16], 250 * 128); // 32000
for (i = 0; i <= 19013; ++i)
for (int i = 0; i < _noise5Size; ++i)
_vm->_mem[(kAdrNoise * 16) + 32000 + i] = _noise5Buf[i];
f.read(&_vm->_mem[(kAdrNoise1 * 16) + kOffsetB1], 149 * 128); // 19072
@ -582,7 +581,6 @@ void SpeechManager::startSpeech(int rep, int ht, int typ) {
switch (typ) {
case 1:
loadNoise();
/*if zuul then zzuul(kAdrNoise,0,1095);*/
regenbruit();
break;
case 2:

View File

@ -2193,14 +2193,17 @@ void MortevielleEngine::music() {
_reloadCFIEC = true;
Common::File fic;
if (!fic.open("mort.img"))
Common::File f;
if (!f.open("mort.img"))
error("Missing file - mort.img");
fic.read(&_mem[kAdrCompMusicBuf2 * 16], 623 * 128);
fic.close();
free(_compMusicBuf2);
int size = f.size();
_compMusicBuf2 = (byte *)malloc(sizeof(byte) * size);
f.read(_compMusicBuf2, size);
f.close();
_soundManager.decodeMusic(&_mem[kAdrCompMusicBuf2 * 16], &_mem[kAdrMusic * 16], 623);
_soundManager.decodeMusic(_compMusicBuf2, &_mem[kAdrMusic * 16], size / 128);
_addFix = (float)((kTempoMusic - 8)) / 256;
_speechManager.cctable(_speechManager._tbi);