aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/mortevielle/mortevielle.cpp2
-rw-r--r--engines/mortevielle/mortevielle.h1
-rw-r--r--engines/mortevielle/sound.cpp12
-rw-r--r--engines/mortevielle/speech.cpp21
-rw-r--r--engines/mortevielle/speech.h8
-rw-r--r--engines/mortevielle/utils.cpp13
6 files changed, 18 insertions, 39 deletions
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index d46dfc16ac..3fcd8b663a 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -377,7 +377,6 @@ Common::Error MortevielleEngine::run() {
*/
void MortevielleEngine::showIntroduction() {
_dialogManager.displayIntroScreen(false);
- _speechManager._mlec = 0;
_dialogManager.checkForF8(142, false);
if (shouldQuit())
return;
@@ -403,7 +402,6 @@ void MortevielleEngine::mainGame() {
for (_crep = 1; _crep <= _x26KeyCount; ++_crep)
decodeNumber(&_cfiecBuffer[161 * 16], (_cfiecBufferSize - (161 * 16)) / 64);
- loadBRUIT5();
_menu.initMenu(this);
charToHour();
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 19e580816d..6211914b57 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -259,7 +259,6 @@ private:
void displayCGAPattern(int n, Pattern *p, nhom *pal);
void loadPalette();
void loadTexts();
- void loadBRUIT5();
void loadCFIEC();
void loadCFIPH();
void showTitleScreen();
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
index a39bdf5120..d1f8f789a9 100644
--- a/engines/mortevielle/sound.cpp
+++ b/engines/mortevielle/sound.cpp
@@ -99,8 +99,8 @@ void SoundManager::loadAmbiantSounds() {
}
/**
- * Speech function - Load Noise file
- * @remarks Originally called 'charge_bruit'
+ * Speech function - Load Noise files
+ * @remarks Originally called 'charge_bruit' and 'charge_bruit5'
*/
void SoundManager::loadNoise() {
Common::File f1, f2;
@@ -131,7 +131,7 @@ void SoundManager::regenbruit() {
void SoundManager::litph(tablint &t, int typ, int tempo) {
// Skip speech
- if (_vm->_speechManager._typlec == 0)
+ if (_vm->_speechManager._soundType == 0)
return;
if (!_vm->_speechManager._buildingSentence) {
@@ -148,9 +148,9 @@ void SoundManager::litph(tablint &t, int typ, int tempo) {
case 0: {
int val = _vm->_mem[(kAdrTroct * 16) + i];
i++;
- if (_vm->_speechManager._typlec == 0)
+ if (_vm->_speechManager._soundType == 0)
warning("TODO: vclas");
- else if (_vm->_speechManager._typlec == 1) {
+ else if (_vm->_speechManager._soundType == 1) {
debugC(5, kMortevielleSounds, "litph - duson");
const static int noiseAdr[] = {0, 17224,
17224, 33676,
@@ -196,7 +196,7 @@ void SoundManager::litph(tablint &t, int typ, int tempo) {
}
break;
case 4:
- if (_vm->_speechManager._typlec) {
+ if (_vm->_speechManager._soundType) {
i += 2;
} else {
// Speech
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 499f852b55..6ea43ad54a 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -59,7 +59,7 @@ const byte _tabdph[16] = {0, 10, 2, 0, 2, 10, 3, 0, 3, 7, 5, 0, 6, 7, 7, 10};
const byte _tabdbc[18] = {7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9};
SpeechManager::SpeechManager() {
- _typlec = 0;
+ _soundType = 0;
_phonemeNumb = 0;
for (int i = 0; i < 3; i++) {
@@ -69,17 +69,15 @@ SpeechManager::SpeechManager() {
_queue[i]._freq = 0;
_queue[i]._rep = 0;
}
- _noise5Buf = nullptr;
_buildingSentence = false;
}
SpeechManager::~SpeechManager() {
- free(_noise5Buf);
}
void SpeechManager::spfrac(int wor) {
_queue[2]._rep = (uint)wor >> 12;
- if ((_typlec == 0) && (_queue[2]._code != 9))
+ if ((_soundType == 0) && (_queue[2]._code != 9))
if (((_queue[2]._code > 4) && (_queue[2]._val != 20) && (_queue[2]._rep != 3) && (_queue[2]._rep != 6) && (_queue[2]._rep != 9)) ||
((_queue[2]._code < 5) && ((_queue[2]._val != 19) && (_queue[2]._val != 22) && (_queue[2]._rep != 4) && (_queue[2]._rep != 9)))) {
++_queue[2]._rep;
@@ -493,8 +491,8 @@ void SpeechManager::initQueue() {
void SpeechManager::handlePhoneme() {
const uint16 deca[3] = {300, 30, 40};
- uint16 startPos = _cfiphBuffer[_phonemeNumb - 1] + deca[_typlec];
- uint16 endPos = _cfiphBuffer[_phonemeNumb] + deca[_typlec];
+ uint16 startPos = _cfiphBuffer[_phonemeNumb - 1] + deca[_soundType];
+ uint16 endPos = _cfiphBuffer[_phonemeNumb] + deca[_soundType];
int wordCount = endPos - startPos;
startPos /= 2;
@@ -530,8 +528,8 @@ void SpeechManager::startSpeech(int rep, int ht, int typ) {
_phonemeNumb = rep;
int haut = ht;
- _typlec = typ;
- if (_typlec != 0) {
+ _soundType = typ;
+ if (_soundType != 0) {
for (int i = 0; i <= 500; ++i)
savph[i] = _cfiphBuffer[i];
tempo = kTempoNoise;
@@ -561,11 +559,10 @@ void SpeechManager::startSpeech(int rep, int ht, int typ) {
_vm->_soundManager._audioStream = nullptr;
}
- if (_typlec != 0)
- for (int i = 0; i <= 500; ++i) {
+ if (_soundType != 0) {
+ for (int i = 0; i <= 500; ++i)
_cfiphBuffer[i] = savph[i];
- _mlec = _typlec;
- }
+ }
_vm->setPal(_vm->_numpal);
}
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index aa231c3536..43cdbd5326 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -59,14 +59,12 @@ private:
int _phonemeNumb;
SpeechQueue _queue[3];
public:
- int _typlec;
+ int _soundType;
+ bool _buildingSentence;
+
int _ptr_oct;
uint16 *_cfiphBuffer;
int _tbi[256];
- int _mlec;
- byte *_noise5Buf;
- int _noise5Size;
- bool _buildingSentence;
SpeechManager();
~SpeechManager();
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 81bdb6e387..a5a64d604d 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2135,19 +2135,6 @@ void MortevielleEngine::loadTexts() {
}
-void MortevielleEngine::loadBRUIT5() {
- Common::File f;
-
- if (!f.open("bruit5"))
- error("Missing file - bruit5");
-
- free(_speechManager._noise5Buf);
- _speechManager._noise5Size = f.size();
- _speechManager._noise5Buf = (byte *)malloc(sizeof(byte) * _speechManager._noise5Size);
- f.read(_speechManager._noise5Buf, _speechManager._noise5Size);
- f.close();
-}
-
void MortevielleEngine::loadCFIEC() {
Common::File f;