aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/mortevielle/outtext.cpp14
-rw-r--r--engines/mortevielle/ovd1.cpp7
-rw-r--r--engines/mortevielle/var_mor.cpp4
-rw-r--r--engines/mortevielle/var_mor.h2
4 files changed, 16 insertions, 11 deletions
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index e70ee10c6e..b42aa481ba 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -72,11 +72,11 @@ static void cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
(uchar)'6', (uchar)'7', (uchar)'8', (uchar)'9'
};
*/
- int oct, ocd;
+ uint16 oct, ocd;
/* 5-8 */
oct = t_mot[idx];
- oct = (uint)(oct << (16 - pt)) >> (16 - pt);
+ oct = ((uint16)(oct << (16 - pt))) >> (16 - pt);
if (pt < 6) {
idx = idx + 1;
oct = oct << (5 - pt);
@@ -96,7 +96,7 @@ static void cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
case 30:
case 31 : {
ocd = t_mot[idx];
- ocd = (uint)(ocd << (16 - pt)) >> (16 - pt);
+ ocd = (uint16)(ocd << (16 - pt)) >> (16 - pt);
if (pt < 6) {
idx = idx + 1;
ocd = ocd << (5 - pt);
@@ -119,7 +119,10 @@ static void cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
}
} /* 5-8 */
-void deline(int num , char *l , int &tl) {
+/**
+ * Decode and extract the line with the given Id
+ */
+void deline(int num, char *l , int &tl) {
int i, j, ts;
char let;
byte ps, k;
@@ -142,7 +145,8 @@ void deline(int num , char *l , int &tl) {
j = j + 1;
} while (!the_end);
tl = j - 1;
- if (tl < 255) delig = copy(delig, 1, tl - 1); /* enleve le $ */ //Translation: Remove '$'
+ if (tl < 255)
+ delig.deleteLastChar(); // Remove trailing '$'
} /* DETEX */
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index eb0bd8b20b..4eb990c7f6 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -201,18 +201,17 @@ void ani50() {
assert(f.size() <= (maxti * 2));
for (i = 0; i < f.size() / 2; ++i)
- t_mot[i] = f.readSint16LE();
+ t_mot[i] = f.readUint16LE();
f.close();
if (!f.open("TXX.NTP"))
error("Missing file - TXX.NTP");
- assert(f.size() <= (maxtd * 4));
- for (i = 0; i < (f.size() + 3) / 4; ++i) {
+ assert(f.size() <= (maxtd * 3));
+ for (i = 0; i < (f.size() / 3); ++i) {
t_rec[i].indis = f.readSint16LE();
t_rec[i].point = f.readByte();
- f.readByte();
}
f.close();
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index a017e55c0d..0d3f88dcdc 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -25,6 +25,7 @@
* Copyright (c) 1988-1989 Lankhor
*/
+#include "common/debug.h"
#include "common/str.h"
#include "common/textconsole.h"
#include "mortevielle/sprint.h"
@@ -216,7 +217,7 @@ byte lettres[7][24];
byte palher[16];
-int t_mot[maxti + 1];
+uint16 t_mot[maxti + 1];
int tay_tchar;
ind t_rec[maxtd + 1];
//file<ind> sauv_t;
@@ -349,6 +350,7 @@ void gotoxy(int x, int y) {
void textcolor(int c) {
}
void output(const Common::String &s) {
+ debug(s.c_str());
}
void graphbackground(int c) {
}
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index c75fc78081..63d3112760 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -370,7 +370,7 @@ extern byte lettres[7][24];
extern byte palher[16];
-extern int t_mot[maxti + 1];
+extern uint16 t_mot[maxti + 1];
extern int tay_tchar;
extern ind t_rec[maxtd + 1];
//file<ind> sauv_t;