Skip to content

Commit

Permalink
MORTEVIELLE: Remove another use of _mem
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Jul 26, 2013
1 parent 62eae32 commit 0af5305
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions engines/mortevielle/mortevielle.cpp
Expand Up @@ -104,13 +104,15 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
_curPict = nullptr;
_curAnim = nullptr;
_rightFramePict = nullptr;
_compMusicBuf1 = nullptr;
_compMusicBuf2 = nullptr;
}

MortevielleEngine::~MortevielleEngine() {
free(_curPict);
free(_curAnim);
free(_rightFramePict);
free(_compMusicBuf1);
free(_compMusicBuf2);
}

Expand Down
3 changes: 1 addition & 2 deletions engines/mortevielle/mortevielle.h
Expand Up @@ -65,8 +65,6 @@ namespace Mortevielle {
*/
const int kAdrMusic = 0x5000;

const int kAdrCompMusicBuf1 = 0x7414;

#define ord(v) ((int) v)
#define chr(v) ((unsigned char) v)
#define lo(v) ((v) & 0xff)
Expand Down Expand Up @@ -477,6 +475,7 @@ class MortevielleEngine : public Engine {
byte *_curPict;
byte *_curAnim;
byte *_rightFramePict;
byte *_compMusicBuf1;
byte *_compMusicBuf2;

Debugger _debugger;
Expand Down
8 changes: 5 additions & 3 deletions engines/mortevielle/speech.cpp
Expand Up @@ -162,13 +162,15 @@ void SpeechManager::regenbruit() {
*/
void SpeechManager::loadMusicSound() {
Common::File f;

if (!f.open("sonmus.mor"))
error("Missing file - sonmus.mor");

f.read(&_vm->_mem[kAdrCompMusicBuf1 * 16], 273 * 128);
free(_vm->_compMusicBuf1);
int size = f.size();
_vm->_compMusicBuf1 = (byte *)malloc(sizeof(byte) * size);
f.read(_vm->_compMusicBuf1, size);

_vm->_soundManager.decodeMusic(&_vm->_mem[kAdrCompMusicBuf1 * 16], &_vm->_mem[kAdrNoise * 16], 273);
_vm->_soundManager.decodeMusic(_vm->_compMusicBuf1, &_vm->_mem[kAdrNoise * 16], size / 128);
f.close();
}

Expand Down

0 comments on commit 0af5305

Please sign in to comment.