aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2012-03-11 01:28:57 +0100
committerStrangerke2012-04-06 08:23:11 +0200
commit28eaf257038f6ecc86b4138eb683e3fb29d6ed74 (patch)
tree61dc48a48884004daa2e11d4e958a0616fc757fb
parent1ff2cb051d035f587314bf4e312d759bbfd036f9 (diff)
downloadscummvm-rg350-28eaf257038f6ecc86b4138eb683e3fb29d6ed74.tar.gz
scummvm-rg350-28eaf257038f6ecc86b4138eb683e3fb29d6ed74.tar.bz2
scummvm-rg350-28eaf257038f6ecc86b4138eb683e3fb29d6ed74.zip
MORTEVIELLE: Some more renaming
-rw-r--r--engines/mortevielle/dialogs.cpp4
-rw-r--r--engines/mortevielle/dialogs.h1
-rw-r--r--engines/mortevielle/mor.cpp6
-rw-r--r--engines/mortevielle/mor.h3
-rw-r--r--engines/mortevielle/mortevielle.h10
-rw-r--r--engines/mortevielle/outtext.cpp2
-rw-r--r--engines/mortevielle/outtext.h3
-rw-r--r--engines/mortevielle/ovd1.cpp2
-rw-r--r--engines/mortevielle/speech.cpp72
-rw-r--r--engines/mortevielle/speech.h31
-rw-r--r--engines/mortevielle/var_mor.h39
11 files changed, 93 insertions, 80 deletions
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index b37e0a53c5..b5cf83162c 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -463,9 +463,9 @@ void f3f8::aff50(bool drawAni50Fl) {
void f3f8::ani50() {
g_crep = animof(1, 1);
- pictout(adani, g_crep, 63, 12);
+ pictout(kAdrAni, g_crep, 63, 12);
g_crep = animof(2, 1);
- pictout(adani, g_crep, 63, 12);
+ pictout(kAdrAni, g_crep, 63, 12);
g_vm->_largestClearScreen = (g_res == 1);
repon(2, kDialogStringIndex + 143);
}
diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h
index c3f33e899c..eaab56d7e2 100644
--- a/engines/mortevielle/dialogs.h
+++ b/engines/mortevielle/dialogs.h
@@ -33,6 +33,7 @@
namespace Mortevielle {
static const int NUM_LINES = 7;
+const int kMaxRect = 14;
class Alert {
private:
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index c973fabc0a..a19bb2dccd 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -161,12 +161,12 @@ void adzon() {
* Returns the offset within the compressed image data resource of the desired image
*/
int animof(int ouf, int num) {
- int nani = g_mem[adani * 16 + 1];
+ int nani = g_mem[kAdrAni * 16 + 1];
int aux = num;
if (ouf != 1)
aux += nani;
- int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&g_mem[adani * 16 + (aux << 1)]);
+ int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&g_mem[kAdrAni * 16 + (aux << 1)]);
return animof_result;
}
@@ -1557,7 +1557,7 @@ void aniof(int ouf, int num) {
num = 3;
}
- int ad = adani;
+ int ad = kAdrAni;
int offset = animof(ouf, num);
GfxSurface surface;
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 2336bc4022..5f47a17360 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -33,6 +33,9 @@
namespace Mortevielle {
+const int kTime1 = 410;
+const int kTime2 = 250;
+
/* NIVEAU 15 */
extern void copcha();
extern bool isMouseIn(rectangle r);
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index c1ed2ad855..345db2c724 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -78,6 +78,16 @@ enum DataType {
#define MORT_DAT "mort.dat"
#define GAME_FRAME_DELAY (1000 / 50)
+const int asoul = 154;
+const int aouvr = 282;
+const int achai = 387;
+const int acha = 492;
+const int arcf = 1272;
+const int arep = 1314;
+const int amzon = 1650;
+const int fleche = 1758;
+const int arega = 0;
+
class MortevielleEngine : public Engine {
private:
const ADGameDescription *_gameDescription;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 9d7c38d864..0d3216d370 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -292,7 +292,7 @@ void charani(Common::String filename, int32 skipSize, int length) {
f.close();
for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i)
- g_mem[0x7314 * 16 + i - remainingSkipSize] = g_mem[0x6000 * 16 + i];
+ g_mem[kAdrAni * 16 + i - remainingSkipSize] = g_mem[0x6000 * 16 + i];
}
void taffich() {
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index 03523d7086..cd109ffea5 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -33,9 +33,10 @@
namespace Mortevielle {
+const int kAdrAni = 0x7314;
+
extern Common::String deline(int num);
extern void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ);
-
extern void chardes(Common::String filename, int32 passe, int long_);
extern void charani(Common::String filename, int32 skipSize, int length);
extern void taffich();
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 53da43402e..058a880a41 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -190,7 +190,7 @@ void loadBRUIT5() {
if (!f.open("bruit5"))
error("Missing file - bruit5");
- f.read(&g_mem[adbruit5 * 16 + 0], 149 * 128);
+ f.read(&g_mem[kAdrNoise5 * 16 + 0], 149 * 128);
f.close();
}
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 2ad5c0514f..dae6e83ae3 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -48,10 +48,8 @@ void spfrac(int wor) {
}
void charg_car(int &currWordNumb) {
- int wor, int_;
-
- wor = swap(READ_LE_UINT16(&g_mem[adword + currWordNumb]));
- int_ = wor & 0x3f;
+ int wor = swap(READ_LE_UINT16(&g_mem[kAdrWord + currWordNumb]));
+ int int_ = wor & 0x3f;
if ((int_ >= 0) && (int_ <= 13)) {
g_c3._val = int_;
@@ -90,7 +88,7 @@ void charg_car(int &currWordNumb) {
void entroct(byte o) {
- g_mem[adtroct * 16 + g_ptr_oct] = o;
+ g_mem[kAdrTroct * 16 + g_ptr_oct] = o;
++g_ptr_oct;
}
@@ -109,16 +107,20 @@ void cctable(tablint &t) {
}
void regenbruit() {
- int i = offsetb3 + 8590;
+ int i = kOffsetB3 + 8590;
int j = 0;
do {
- g_t_cph[j] = READ_LE_UINT16(&g_mem[adbruit3 + i]);
+ g_t_cph[j] = READ_LE_UINT16(&g_mem[kAdrNoise3 + i]);
i += 2;
++j;
- } while (i < offsetb3 + 8790);
+ } while (i < kOffsetB3 + 8790);
}
-void charge_son() {
+/**
+ * Load sonmus.mor file
+ * @remarks Originally called 'charge_son'
+ */
+void loadMusicSound() {
Common::File f;
if (!f.open("sonmus.mor"))
@@ -126,11 +128,15 @@ void charge_son() {
f.read(&g_mem[0x7414 * 16 + 0], 273);
- g_vm->_soundManager.decodeMusic(&g_mem[0x7414 * 16], &g_mem[adson * 16], 273);
+ g_vm->_soundManager.decodeMusic(&g_mem[0x7414 * 16], &g_mem[kAdrNoise * 16], 273);
f.close();
}
-void charge_phbruit() {
+/**
+ * Load phoneme sound file
+ * @remarks Originally called 'charge_phbruit'
+ */
+void loadPhonemeSounds() {
Common::File f;
if (!f.open("phbrui.mor"))
@@ -142,17 +148,21 @@ void charge_phbruit() {
f.close();
}
-void charge_bruit() {
+/**
+ * Speech function - Load Noise file
+ * @remarks Originally called 'charge_bruit'
+ */
+void loadNoise() {
Common::File f;
int i;
if (!f.open("bruits")) //Translation: "noise"
error("Missing file - bruits");
- f.read(&g_mem[adbruit * 16 + 0], 250);
+ f.read(&g_mem[kAdrNoise * 16 + 0], 250);
for (i = 0; i <= 19013; ++i)
- g_mem[adbruit * 16 + 32000 + i] = g_mem[adbruit5 + i];
- f.read(&g_mem[adbruit1 * 16 + offsetb1], 149);
+ g_mem[kAdrNoise * 16 + 32000 + i] = g_mem[kAdrNoise5 + i];
+ f.read(&g_mem[kAdrNoise1 * 16 + kOffsetB1], 149);
f.close();
}
@@ -172,12 +182,12 @@ void trait_car() {
if (g_c2._code == 6)
d3 = g_tabdph[(g_c2._val - 14) << 1];
else
- d3 = null;
+ d3 = kNullValue;
if (g_c1._code >= 5) {
veracf(g_c2._acc);
if (g_c1._code == 9) {
entroct(4);
- if (d3 == null)
+ if (d3 == kNullValue)
entroct(g_c2._val);
else
entroct(d3);
@@ -189,7 +199,7 @@ void trait_car() {
case 0:
entroct(0);
entroct(g_c2._val);
- if (d3 == null)
+ if (d3 == kNullValue)
if (g_c3._code == 9)
entroct(2);
else
@@ -207,14 +217,14 @@ void trait_car() {
do {
--i;
entroct(0);
- if (d3 == null)
+ if (d3 == kNullValue)
entroct(g_c2._val);
else
entroct(d3);
entroct(3);
} while (i >= 0);
}
- if (d3 == null) {
+ if (d3 == kNullValue) {
entroct(4);
entroct(g_c2._val);
entroct(0);
@@ -232,14 +242,14 @@ void trait_car() {
do {
--i;
entroct(0);
- if (d3 == null)
+ if (d3 == kNullValue)
entroct(g_c2._val);
else
entroct(d3);
entroct(3);
} while (i >= 0);
}
- if (d3 == null) {
+ if (d3 == kNullValue) {
entroct(0);
entroct(g_c2._val);
entroct(2);
@@ -257,7 +267,7 @@ void trait_car() {
do {
--i;
entroct(0);
- if (d3 == null)
+ if (d3 == kNullValue)
entroct(g_c2._val);
else
entroct(d3);
@@ -478,7 +488,7 @@ void trait_ph() {
int endPos = swap(g_t_cph[ptr_tcph + 1]) + deca[g_typlec];
int wordCount = endPos - startPos;
for (int i = (uint)startPos >> 1, currWord = 0; i < (int)((uint)endPos >> 1); i++, currWord += 2)
- WRITE_LE_UINT16(&g_mem[adword + currWord], g_t_cph[i]);
+ WRITE_LE_UINT16(&g_mem[kAdrWord + currWord], g_t_cph[i]);
g_ptr_oct = 0;
int currWord = 0;
@@ -495,8 +505,10 @@ void trait_ph() {
entroct(ord('#'));
}
-
-
+/**
+ * Start speech
+ * @remarks Originally called 'parole'
+ */
void startSpeech(int rep, int ht, int typ) {
int savph[501];
int tempo;
@@ -519,13 +531,13 @@ void startSpeech(int rep, int ht, int typ) {
cctable(g_tbi);
switch (typ) {
case 1:
- charge_bruit();
- /*if zuul then zzuul(adbruit,0,1095);*/
+ loadNoise();
+ /*if zuul then zzuul(kAdrNoise,0,1095);*/
regenbruit();
break;
case 2:
- charge_son();
- charge_phbruit();
+ loadMusicSound();
+ loadPhonemeSounds();
break;
default:
break;
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index 0e249b8e00..7947ee4472 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -33,15 +33,40 @@
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;
+const int kOffsetB3 = 6;
+
+const float freq0 = 1.19318e6;
+const int kNullValue = 255;
+const int kTempoMusic = 71;
+const int kTempoNoise = 78;
+const int kTempoF = 80;
+const int kTempoM = 89;
+
+
+// Useless constants
+//const int segdon = 0x6c00;
+//const int adbruit2 = 0x6b30;/*3A80;*/
+//const int adson2 = 0x60b0;/*3000;*/
+//const int seg_syst = 0x6fed;
+//const int offsetb2 = 4;
+
+
extern void spfrac(int wor);
extern void charg_car(int &currWordNumb);
extern void entroct(byte o);
extern void veracf(byte b);
extern void cctable(tablint &t);
extern void regenbruit();
-extern void charge_son();
-extern void charge_phbruit();
-extern void charge_bruit();
+extern void loadMusicSound();
+extern void loadPhonemeSounds();
+extern void loadNoise();
extern void trait_car();
extern void rot_chariot();
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 50c73974d8..9d81a8e16e 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -64,38 +64,8 @@ namespace Mortevielle {
/*------------------------- CONSTANTS ----------------------------------*/
/*---------------------------------------------------------------------------*/
-const float freq0 = 1.19318e6;
-
-const int adani = 0x7314;
-const int adbruit = 0x5cb0;/*2C00;*/
-const int adbruit1 = 0x6924;
-const int adbruit3 = 0x6ba6;/*3AF6;*/
-const int adbruit5 = 0x3b50;
-const int adson = 0x5cb0;/*2C00;*/
-const int adtroct = 0x406b;
-const int adword = 0x4000;
-const int offsetb1 = 6;
-const int offsetb3 = 6;
-
-// Useless constants
-//const int segdon = 0x6c00;
-//const int adbruit2 = 0x6b30;/*3A80;*/
-//const int adson2 = 0x60b0;/*3000;*/
-//const int seg_syst = 0x6fed;
-//const int offsetb2 = 4;
-
-const int null = 255;
-
-const int kTempoMusic = 71;
-const int kTempoNoise = 78;
-const int kTempoF = 80;
-const int kTempoM = 89;
-
-const int kTime1 = 410;
-const int kTime2 = 250;
const int maxti = 7975;
const int maxtd = 600;
-const int kMaxRect = 14;
const int kDescriptionStringIndex = 0; // Unused
const int kInventoryStringIndex = 186;
@@ -107,15 +77,6 @@ const int kMenuSelfStringIndex = 497;
const int kMenuSayStringIndex = 502;
const int kSecretPassageQuestionStringIndex = 510; // Unusued?
-const int arega = 0;
-const int asoul = 154;
-const int aouvr = 282;
-const int achai = 387;
-const int acha = 492;
-const int arcf = 1272;
-const int arep = 1314;
-const int amzon = 1650;
-const int fleche = 1758;
const int OPCODE_NONE = 0;
enum verbs {OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302, OPCODE_FORCE = 0x303, OPCODE_SLEEP = 0x304, OPCODE_LISTEN = 0x305,