diff options
-rw-r--r-- | engines/mortevielle/actions.cpp | 2 | ||||
-rw-r--r-- | engines/mortevielle/alert.cpp | 13 | ||||
-rw-r--r-- | engines/mortevielle/level15.cpp | 1 | ||||
-rw-r--r-- | engines/mortevielle/menu.cpp | 4 | ||||
-rw-r--r-- | engines/mortevielle/mor.cpp | 23 | ||||
-rw-r--r-- | engines/mortevielle/mor2.cpp | 8 | ||||
-rw-r--r-- | engines/mortevielle/mouse.cpp | 2 | ||||
-rw-r--r-- | engines/mortevielle/mouse.h | 6 | ||||
-rw-r--r-- | engines/mortevielle/outtext.cpp | 1 | ||||
-rw-r--r-- | engines/mortevielle/prog.cpp | 4 | ||||
-rw-r--r-- | engines/mortevielle/ques.cpp | 3 | ||||
-rw-r--r-- | engines/mortevielle/sprint.cpp | 4 | ||||
-rw-r--r-- | engines/mortevielle/taffich.cpp | 1 | ||||
-rw-r--r-- | engines/mortevielle/var_mor.h | 4 |
14 files changed, 55 insertions, 21 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp index ff986a946a..b9626b3e6b 100644 --- a/engines/mortevielle/actions.cpp +++ b/engines/mortevielle/actions.cpp @@ -28,10 +28,12 @@ #include "common/scummsys.h" #include "mortevielle/actions.h" #include "mortevielle/alert.h" +#include "mortevielle/level15.h" #include "mortevielle/mor.h" #include "mortevielle/mor2.h" #include "mortevielle/mouse.h" #include "mortevielle/outtext.h" +#include "mortevielle/parole2.h" #include "mortevielle/var_mor.h" namespace Mortevielle { diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp index d003ccbc12..c35ba4f62e 100644 --- a/engines/mortevielle/alert.cpp +++ b/engines/mortevielle/alert.cpp @@ -28,6 +28,7 @@ #include "common/str.h" #include "mortevielle/alert.h" #include "mortevielle/level15.h" +#include "mortevielle/mouse.h" namespace Mortevielle { @@ -35,12 +36,12 @@ namespace Mortevielle { const int nligne = 7; -const matrix<1, 2, 1, 3, int> coord -= {{ {{150, 72, 103}}, - {{143, 107, 183}} - } -}; +const int coord[3][4] = { + {0, 0, 0, 0}, + {0, 150, 72, 103), + {0, 143, 107, 183} +}; static void decod(Common::String s, int &nbc, int &nbl, int &col, Common::String &c, Common::String &cs) { @@ -115,7 +116,7 @@ static void fait_choix(Common::String c, int &coldep, int &nbcase, Common::Strin str[l] = str[l] + ch; } while (!(c[i + 1] == ']')); i = i + 2; - while (length(str[l]) < 3) str[l] = str[l] + ' '; + while (str[l].size() < 3) str[l] = str[l] + ' '; putxy(x, 98); writeg(string(' ') + str[l] + ' ', 0); x = x + esp + 40; diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp index 42219ee943..e7a9c2116b 100644 --- a/engines/mortevielle/level15.cpp +++ b/engines/mortevielle/level15.cpp @@ -27,6 +27,7 @@ #include "mortevielle/level15.h" #include "mortevielle/var_mor.h" +#include "mortevielle/mouse.h" namespace Mortevielle { diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp index df4085671b..083a16d07a 100644 --- a/engines/mortevielle/menu.cpp +++ b/engines/mortevielle/menu.cpp @@ -28,7 +28,9 @@ #include "common/scummsys.h" #include "common/str.h" #include "common/textconsole.h" +#include "mortevielle/level15.h" #include "mortevielle/menu.h" +#include "mortevielle/mouse.h" #include "mortevielle/var_mor.h" namespace Mortevielle { @@ -48,7 +50,7 @@ namespace Mortevielle { clrscr; mortevielle_exit(0); } - while (length(s) < 30) s = s + ' '; + while (s.size() < 30) s = s + ' '; switch (h) { case invent : if (l != 7) inv[l] = string(' ') + s; diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp index f8454e6446..b4e3fb3082 100644 --- a/engines/mortevielle/mor.cpp +++ b/engines/mortevielle/mor.cpp @@ -28,8 +28,14 @@ #include "common/str.h" #include "common/textconsole.h" #include "mortevielle/alert.h" +#include "mortevielle/boite.h" +#include "mortevielle/droite.h +#include "mortevielle/level15.h" +#include "mortevielle/menu.h" #include "mortevielle/mor.h" +#include "mortevielle/mouse.h" #include "mortevielle/outtext.h" +#include "mortevielle/parole2.h" #include "mortevielle/var_mor.h" namespace Mortevielle { @@ -219,8 +225,8 @@ void ecr2(Common::String str_) { else tab = 6; putxy(8, 177); tlig = 59 + pred(int, res) * 36; - if (length(str_) < tlig) writeg(str_, 5); - else if (length(str_) < (tlig << 1)) { + if (str_.size() < tlig) writeg(str_, 5); + else if (str_.size() < (tlig << 1)) { putxy(8, 176); writeg(copy(str_, 1, pred(int, tlig)), 5); putxy(8, 182); @@ -286,7 +292,7 @@ void clsf10() { else if (s.conf > 65) st = "Malsaine"; if (res == 1) co = 10; else co = 6; - co = 574 - ((uint)co * length(st) >> 1); + co = 574 - ((uint)co * st.size() >> 1); putxy(co, 92); writeg(st, 4); if (res == 1) co = 620; @@ -638,10 +644,10 @@ void chlm(int &per) { } void pendule() { - const matrix<1, 2, 1, 12, int> cv - = {{{{ 5, 8, 10, 8, 5, 0, -5, -8, -10, -8, -5, 0}}, - {{ -5, -3, 0, 3, 5, 6, 5, 3, 0, -3, -5, -6}} - } + const int cv[3][13] = { + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 5, 8, 10, 8, 5, 0, -5, -8, -10, -8, -5, 0 }, + { 0, -5, -3, 0, 3, 5, 6, 5, 3, 0, -3, -5, -6 } }; const int x = 580; const int y = 123; @@ -983,8 +989,7 @@ void debloc(int l) { /* NIVEAU 10 */ void init_nbrepm() { - const array<1, 8, byte> ipm - = {{4, 5, 6, 7, 5, 6, 5, 8}}; + const byte ipm[9] = { 0, 4, 5, 6, 7, 5, 6, 5, 8 }; int i; /* debug('init_nbrepm'); */ diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp index 50d12452a5..9b9fa68768 100644 --- a/engines/mortevielle/mor2.cpp +++ b/engines/mortevielle/mor2.cpp @@ -26,9 +26,15 @@ */ #include "mortevielle/mor2.h" +#include "mortevielle/alert.h" +#include "mortevielle/boite.h" #include "mortevielle/var_mor.h" +#include "mortevielle/menu.h" +#include "mortevielle/mor.h" #include "mortevielle/mouse.h" #include "mortevielle/outtext.h" +#include "mortevielle/parole2.h" +#include "mortevielle/taffich.h" namespace Mortevielle { @@ -211,7 +217,7 @@ void tmlieu(int mli) { cx = v_lieu[i][mli]; deline(cx + c_tmlieu, st, tail); nomp = delig; - while (length(nomp) < 30) nomp = nomp + ' '; + while (nomp.size() < 30) nomp = nomp + ' '; menut(depl[i], nomp); i = i + 1; } diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp index a6b1768b96..708865ee1a 100644 --- a/engines/mortevielle/mouse.cpp +++ b/engines/mortevielle/mouse.cpp @@ -42,7 +42,7 @@ int m_show, p_o_s, mouse_shwn; -matrix<0, 5, 0, 11, int> s_s; +int s_s[12][6]; void init_mouse() { diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h index 2a22d04e4c..0923c71866 100644 --- a/engines/mortevielle/mouse.h +++ b/engines/mortevielle/mouse.h @@ -32,6 +32,12 @@ namespace Mortevielle { extern bool clic; +extern int m_show, + x_s, + y_s, + p_o_s, + mouse_shwn; + void init_mouse(); //extern void change_mouse(int t); //extern void dessine_souris(int xf, int yf); diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp index ba0c956c1a..6ec3f8930e 100644 --- a/engines/mortevielle/outtext.cpp +++ b/engines/mortevielle/outtext.cpp @@ -26,6 +26,7 @@ */ #include "mortevielle/outtext.h" +#include "mortevielle/level15.h" #include "mortevielle/var_mor.h" #include "common/str.h" diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp index d5004cdec8..d7f95f49eb 100644 --- a/engines/mortevielle/prog.cpp +++ b/engines/mortevielle/prog.cpp @@ -25,9 +25,13 @@ * Copyright (c) 1988-1989 Lankhor */ +#include "mortevielle/actions.h" +#include "mortevielle/menu.h" +#include "mortevielle/mor.h" #include "mortevielle/mor2.h" #include "mortevielle/prog.h" #include "mortevielle/var_mor.h" +#include "mortevielle/mouse.h" namespace Mortevielle { diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp index 870f8b7435..2a200fb823 100644 --- a/engines/mortevielle/ques.cpp +++ b/engines/mortevielle/ques.cpp @@ -25,6 +25,7 @@ * Copyright (c) 1988-1989 Lankhor */ +#include "mortevielle/mouse.h" #include "mortevielle/outtext.h" #include "mortevielle/ques.h" #include "common/str.h" @@ -89,7 +90,7 @@ namespace Mortevielle { with.y2 = 34 + j * 8; with.etat = true; } - while (length(chaines[j]) < tmax) { + while (chaines[j].size() < tmax) { chaines[j] = chaines[j] + ' '; } } diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp index 9df1a1894c..406d7bccb4 100644 --- a/engines/mortevielle/sprint.cpp +++ b/engines/mortevielle/sprint.cpp @@ -55,7 +55,7 @@ void writeg(Common::String l, int c) yo = ywhere; if (res == 2) i = 6; else i = 10; - x = xo + i * length(l); + x = xo + i * l.size(); switch (c) { case 1: case 3 : { @@ -80,7 +80,7 @@ void writeg(Common::String l, int c) } xo = xo + 1; yo = yo + 1; - for (x = 1; x <= length(l); x ++) { + for (x = 1; x <= l.size(); x ++) { affcar(gd, xo, yo, cecr, ord(l[x])); xo = xo + i; } diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp index 6d6df692cd..6969cf6aea 100644 --- a/engines/mortevielle/taffich.cpp +++ b/engines/mortevielle/taffich.cpp @@ -26,6 +26,7 @@ */ #include "common/str.h" +#include "mortevielle/mouse.h" #include "mortevielle/taffich.h" #include "mortevielle/var_mor.h" diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h index 88b42a845f..4f8e0fe523 100644 --- a/engines/mortevielle/var_mor.h +++ b/engines/mortevielle/var_mor.h @@ -48,6 +48,10 @@ namespace Mortevielle { #define pred(type, v) (v - 1) #define succ(type, v) (v + 1) #define ord(v) ((int) v) +#define chr(v) ((char) v) +#define lo(v) (v & 0xff) +#define hi(v) ((v >> 8) & 0xff) +#define odd(v) ((v % 2) == 1) // TODO: Replace the following with proper implementations #define mortevielle_exit(ret) error("Exit the game") |