aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/mortevielle/mortevielle.cpp2
-rw-r--r--engines/mortevielle/mortevielle.h3
-rw-r--r--engines/mortevielle/speech.cpp8
3 files changed, 8 insertions, 5 deletions
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 616bee1a67..b4b46a4286 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -104,6 +104,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
_curPict = nullptr;
_curAnim = nullptr;
_rightFramePict = nullptr;
+ _compMusicBuf1 = nullptr;
_compMusicBuf2 = nullptr;
}
@@ -111,6 +112,7 @@ MortevielleEngine::~MortevielleEngine() {
free(_curPict);
free(_curAnim);
free(_rightFramePict);
+ free(_compMusicBuf1);
free(_compMusicBuf2);
}
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 23003719ba..6f5d4b4fac 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -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)
@@ -477,6 +475,7 @@ public:
byte *_curPict;
byte *_curAnim;
byte *_rightFramePict;
+ byte *_compMusicBuf1;
byte *_compMusicBuf2;
Debugger _debugger;
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 899cd80472..445f7faffb 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -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();
}