aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/mortevielle/actions.cpp10
-rw-r--r--engines/mortevielle/alert.cpp22
-rw-r--r--engines/mortevielle/droite.cpp6
-rw-r--r--engines/mortevielle/graphics.cpp55
-rw-r--r--engines/mortevielle/graphics.h4
-rw-r--r--engines/mortevielle/level15.cpp4
-rw-r--r--engines/mortevielle/level15.h1
-rw-r--r--engines/mortevielle/menu.cpp37
-rw-r--r--engines/mortevielle/mor.cpp103
-rw-r--r--engines/mortevielle/mor2.cpp12
-rw-r--r--engines/mortevielle/mouse.cpp1
-rw-r--r--engines/mortevielle/outtext.cpp18
-rw-r--r--engines/mortevielle/ovd1.cpp4
-rw-r--r--engines/mortevielle/sprint.cpp49
-rw-r--r--engines/mortevielle/sprint.h1
-rw-r--r--engines/mortevielle/var_mor.cpp23
-rw-r--r--engines/mortevielle/var_mor.h5
17 files changed, 174 insertions, 181 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index cd3a7b0df8..f3bc31b637 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -1053,7 +1053,7 @@ L2:
lig = 0;
do {
icm = succ(int, icm);
- putxy(co, lig);
+ g_vm->_screenSurface.putxy(co, lig);
if (s.teauto[icm] == '*')
if (te[icm]) writetp(lib[icm], 1);
else writetp(lib[icm], 0);
@@ -1062,7 +1062,7 @@ L2:
co = 320;
} else lig = lig + 8;
} while (!(icm == 42));
- putxy(320, 176);
+ g_vm->_screenSurface.putxy(320, 176);
writetp(lib[46], 0);
tou = '\0';
do {
@@ -1080,7 +1080,7 @@ L2:
lig = ((choi - 1) % 23) << 3;
if (choi > 23) co = 320;
else co = 0;
- putxy(co, lig);
+ g_vm->_screenSurface.putxy(co, lig);
if (te[choi]) writetp(lib[choi], 0);
else writetp(lib[choi], 1);
te[choi] = ! te[choi];
@@ -1094,7 +1094,7 @@ L2:
lig = ((choi - 1) % 23) << 3;
if (choi > 23) co = 320;
else co = 0;
- putxy(co, lig);
+ g_vm->_screenSurface.putxy(co, lig);
if (te[choi]) writetp(lib[choi], 0);
else writetp(lib[choi], 1);
te[choi] = ! te[choi];
@@ -1103,7 +1103,7 @@ L2:
lig = ((ix - 1) % 23) << 3;
if (ix > 23) co = 320;
else co = 0;
- putxy(co, lig);
+ g_vm->_screenSurface.putxy(co, lig);
if (te[ix]) writetp(lib[ix], 0);
else writetp(lib[ix], 1);
te[ix] = ! te[ix];
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 36a51b07ed..73befd9196 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -87,7 +87,7 @@ static void decod(Common::String s, int &nbc, int &nbl, int &col, Common::String
static void posit(int ji, int &coldep, int &esp) {
- putxy(coldep + (40 + esp) *pred(int, ji), 98);
+ g_vm->_screenSurface.putxy(coldep + (40 + esp) *pred(int, ji), 98);
}
@@ -122,13 +122,13 @@ static void fait_choix(Common::String c, int &coldep, int &nbcase, Common::Strin
} while (!(c[i + 1] == ']'));
i = i + 2;
while (str[l].size() < 3) str[l] = str[l] + ' ';
- putxy(x, 98);
+ g_vm->_screenSurface.putxy(x, 98);
Common::String tmp(" ");
tmp += str[l];
tmp += " ";
- writeg(tmp, 0);
+ g_vm->_screenSurface.writeg(tmp, 0);
x = x + esp + 40;
}
}
@@ -163,7 +163,7 @@ int do_alert(Common::String str_, int n) {
} else {
fait_boite(8, 7, nbcol);
i = 0;
- ywhere = 70;
+ g_vm->_screenSurface._textPos.y = 70;
do {
cx = 320;
st = "";
@@ -173,9 +173,9 @@ int do_alert(Common::String str_, int n) {
if (res == 2) cx = cx - 3;
else cx = cx - 5;
}
- putxy(cx, ywhere);
- ywhere = ywhere + 6;
- writeg(st, 4);
+ g_vm->_screenSurface.putxy(cx, g_vm->_screenSurface._textPos.y);
+ g_vm->_screenSurface._textPos.y += 6;
+ g_vm->_screenSurface.writeg(st, 4);
i = i + 1;
} while (!(chaine[i] == ']'));
}
@@ -219,14 +219,14 @@ int do_alert(Common::String str_, int n) {
Common::String tmp(" ");
tmp += s[quoi];
tmp += " ";
- writeg(tmp, 0);
+ g_vm->_screenSurface.writeg(tmp, 0);
}
posit(ix, coldep, esp);
Common::String tmp2 = " ";
tmp2 += s[ix];
tmp2 += " ";
- writeg(tmp2, 1);
+ g_vm->_screenSurface.writeg(tmp2, 1);
quoi = ix;
show_mouse();
@@ -240,7 +240,7 @@ int do_alert(Common::String str_, int n) {
Common::String tmp3(" ");
tmp3 += s[quoi];
tmp3 += " ";
- writeg(tmp3, 0);
+ g_vm->_screenSurface.writeg(tmp3, 0);
quoi = 0;
show_mouse();
@@ -256,7 +256,7 @@ int do_alert(Common::String str_, int n) {
Common::String tmp4(" ");
tmp4 += s[n];
tmp4 += " ";
- writeg(tmp4, 1);
+ g_vm->_screenSurface.writeg(tmp4, 1);
}
charecr(50, succ(int, nligne) << 4);
show_mouse();
diff --git a/engines/mortevielle/droite.cpp b/engines/mortevielle/droite.cpp
index 54d788b6eb..c0a48a51aa 100644
--- a/engines/mortevielle/droite.cpp
+++ b/engines/mortevielle/droite.cpp
@@ -26,6 +26,8 @@
*/
#include "mortevielle/droite.h"
+#include "mortevielle/graphics.h"
+#include "mortevielle/mortevielle.h"
#include "mortevielle/var_mor.h"
namespace Mortevielle {
@@ -47,7 +49,7 @@ void droite(int x, int y, int xx, int yy, int coul) {
if (y > yy) step = -1;
else step = 1;
do {
- putpix(gd, abs((int)(a * i + b)), i, coul);
+ g_vm->_screenSurface.setPixel(Common::Point(abs((int)(a * i + b)), i), coul);
i = i + step;
} while (!(i == yy));
/*writeln(le_file,'X == ',a:3:3,' * Y + ',b:3:3);*/
@@ -58,7 +60,7 @@ void droite(int x, int y, int xx, int yy, int coul) {
if (x > xx) step = -1;
else step = 1;
do {
- putpix(gd, i, abs((int)(a * i + b)), coul);
+ g_vm->_screenSurface.setPixel(Common::Point(i, abs((int)(a * i + b))), coul);
i = i + step;
} while (!(i == xx));
/*writeln(le_file,'Y == ',a:3:3,' * X + ',b:3:3);*/
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 3450d41cf5..e9c8c1e7e9 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1040,4 +1040,59 @@ void ScreenSurface::setPixel(const Common::Point &pt, int palIndex) {
*(destP + SCREEN_WIDTH) = palIndex;
}
+/**
+ * Write out a string
+ */
+void ScreenSurface::writeg(const Common::String &l, int c) {
+ int i, x;
+ Common::Point pt;
+ int cecr = 0;
+
+ /* debug('writeg : '+l);*/
+
+ if (l == "")
+ return;
+ hide_mouse();
+ pt = _textPos;
+
+ if (res == 2)
+ i = 6;
+ else
+ i = 10;
+ x = pt.x + i * l.size();
+
+ switch (c) {
+ case 1:
+ case 3 : {
+ cecr = 0;
+ box(15, gd, pt.x, pt.y, x, pt.y + 7, 255);
+ }
+ break;
+ case 4 : {
+ cecr = 0;
+ }
+ break;
+ case 5 : {
+ cecr = 15;
+ }
+ break;
+ case 0:
+ case 2 : {
+ cecr = 15;
+ box(0, gd, pt.x, pt.y, x, pt.y + 7, 255);
+ }
+ break;
+ }
+ pt.x += 1;
+ pt.y += 1;
+ for (x = 1; x <= (int)l.size(); ++x) {
+ g_vm->_screenSurface.writeCharacter(Common::Point(pt.x, pt.y), ord(l[x - 1]), cecr);
+ pt.x += i;
+ }
+ show_mouse();
+
+ // TODO: Move screen updates to main loop once constructed
+ g_vm->_screenSurface.updateScreen();
+}
+
} // End of namespace Mortevielle
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 0b265469df..258f4cfacc 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -78,6 +78,8 @@ private:
Common::List<Common::Rect> _dirtyRects;
byte _fontData[FONT_NUM_CHARS * FONT_HEIGHT];
public:
+ Common::Point _textPos; // Original called xwhere/ywhere
+public:
void readFontData(Common::File &f, int dataSize);
Graphics::Surface lockArea(const Common::Rect &bounds);
void updateScreen();
@@ -87,6 +89,8 @@ public:
void drawBox(int x, int y, int dx, int dy, int col);
void fillBox(int colour, const Common::Rect &bounds, int patt);
void clearScreen();
+ void putxy(int x, int y) { _textPos = Common::Point(x, y); }
+ void writeg(const Common::String &l, int c);
// TODO: Refactor code to remove this method, for increased performance
void setPixel(const Common::Point &pt, int palIndex);
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index b0ed953aa4..c017bf24d3 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -112,10 +112,6 @@ void pictout(int seg, int dep, int x, int y) {
g_vm->_screenSurface.drawPicture(surface, x, y);
}
-void putxy(int x, int y) {
- xwhere = x;
- ywhere = y;
-}
/*
function calad(x,y:int):int;
begin
diff --git a/engines/mortevielle/level15.h b/engines/mortevielle/level15.h
index aee94c9c09..c3df5e5d6c 100644
--- a/engines/mortevielle/level15.h
+++ b/engines/mortevielle/level15.h
@@ -38,7 +38,6 @@ extern bool dans_rect(rectangle r);
extern void outbloc(int n, pattern p, t_nhom pal);
extern void writepal(int n);
extern void pictout(int seg, int dep, int x, int y);
-extern void putxy(int x, int y);
// extern int calad(int x, int y);
extern void sauvecr(int y, int dy);
extern void charecr(int y, int dy);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index bc74a379e5..07626b3894 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -162,9 +162,9 @@ void menu_aff() {
msk = 0x80;
for (pt = 0; pt <= 7; pt ++) {
if ((lettres[num_letr - 1][ind_tabl] & msk) != 0) {
- putpix(gd, x + 1, y + 1, 0);
- putpix(gd, x, y + 1, 0);
- putpix(gd, x, y, color);
+ g_vm->_screenSurface.setPixel(Common::Point(x + 1, y + 1), 0);
+ g_vm->_screenSurface.setPixel(Common::Point(x, y + 1), 0);
+ g_vm->_screenSurface.setPixel(Common::Point(x, y), color);
}
msk = (uint)msk >> 1;
x = x + 1;
@@ -196,7 +196,7 @@ void invers(int ix) {
/* debug('invers'); */
if (msg4 == no_choice) return;
- putxy(don[msg3][1] << 3, succ(void, lo(msg4)) << 3);
+ g_vm->_screenSurface.putxy(don[msg3][1] << 3, succ(void, lo(msg4)) << 3);
switch (msg3) {
case 1 :
s = inv[lo(msg4)];
@@ -232,7 +232,7 @@ void invers(int ix) {
break;
}
if ((s[0] != '*') && (s[0] != '<'))
- writeg(s, ix);
+ g_vm->_screenSurface.writeg(s, ix);
else
msg4 = no_choice;
}
@@ -281,48 +281,53 @@ void menu_down(int ii) {
box(15, gd, xco, 12, xcc, 10 + (don[ii][2] << 1), 255);
box(0, gd, xcc, 12, xcc + 4, 10 + (don[ii][2] << 1), 255);
box(0, gd, xco, 8 + (don[ii][2] << 1), xcc + 4, 12 + (don[ii][2] << 1), 255);
- putxy(xco, 16);
+ g_vm->_screenSurface.putxy(xco, 16);
cx = 0;
do {
cx = succ(int, cx);
switch (ii) {
case 1 :
- if (inv[cx][0] != '*') writeg(inv[cx], 4);
+ if (inv[cx][0] != '*')
+ g_vm->_screenSurface.writeg(inv[cx], 4);
break;
case 2 :
- if (dep[cx][0] != '*') writeg(dep[cx], 4);
+ if (dep[cx][0] != '*')
+ g_vm->_screenSurface.writeg(dep[cx], 4);
break;
case 3 :
- if (act[cx][0] != '*') writeg(act[cx], 4);
+ if (act[cx][0] != '*')
+ g_vm->_screenSurface.writeg(act[cx], 4);
break;
case 4 :
- if (self_[cx][0] != '*') writeg(self_[cx], 4);
+ if (self_[cx][0] != '*')
+ g_vm->_screenSurface.writeg(self_[cx], 4);
break;
case 5 :
- if (dis[cx][0] != '*') writeg(dis[cx], 4);
+ if (dis[cx][0] != '*')
+ g_vm->_screenSurface.writeg(dis[cx], 4);
break;
case 6 :
- writeg(g_vm->getString(S_SAVE_LOAD + cx), 4);
+ g_vm->_screenSurface.writeg(g_vm->getString(S_SAVE_LOAD + cx), 4);
break;
case 7 : {
Common::String s = g_vm->getString(S_SAVE_LOAD + 1);
s += ' ';
s += (char)(48 + cx);
- writeg(s, 4);
+ g_vm->_screenSurface.writeg(s, 4);
break;
}
case 8 :
if (cx == 1)
- writeg(g_vm->getString(S_RESTART), 4);
+ g_vm->_screenSurface.writeg(g_vm->getString(S_RESTART), 4);
else {
Common::String s = g_vm->getString(S_SAVE_LOAD + 2);
s += ' ';
s += (char)(47 + cx);
- writeg(s, 4);
+ g_vm->_screenSurface.writeg(s, 4);
}
break;
}
- putxy(xco, ywhere + 8);
+ g_vm->_screenSurface.putxy(xco, g_vm->_screenSurface._textPos.y + 8);
} while (!(cx == nb_lig));
test0 = true;
show_mouse();
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index ae303e99fd..89787312d0 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -221,23 +221,24 @@ void ecr2(Common::String str_) {
/* debug('ecr2 : '+str_);*/
if (res == 1) tab = 10;
else tab = 6;
- putxy(8, 177);
+ g_vm->_screenSurface.putxy(8, 177);
tlig = 59 + pred(int, res) * 36;
- if ((int)str_.size() < tlig) writeg(str_, 5);
+ if ((int)str_.size() < tlig)
+ g_vm->_screenSurface.writeg(str_, 5);
else if ((int)str_.size() < (tlig << 1)) {
- putxy(8, 176);
- writeg(copy(str_, 1, pred(int, tlig)), 5);
- putxy(8, 182);
- writeg(copy(str_, tlig, tlig << 1), 5);
+ g_vm->_screenSurface.putxy(8, 176);
+ g_vm->_screenSurface.writeg(copy(str_, 1, pred(int, tlig)), 5);
+ g_vm->_screenSurface.putxy(8, 182);
+ g_vm->_screenSurface.writeg(copy(str_, tlig, tlig << 1), 5);
} else {
f2_all = true;
clsf2();
- putxy(8, 176);
- writeg(copy(str_, 1, pred(int, tlig)), 5);
- putxy(8, 182);
- writeg(copy(str_, tlig, pred(int, (tlig << 1))), 5);
- putxy(8, 190);
- writeg(copy(str_, tlig << 1, tlig * 3), 5);
+ g_vm->_screenSurface.putxy(8, 176);
+ g_vm->_screenSurface.writeg(copy(str_, 1, pred(int, tlig)), 5);
+ g_vm->_screenSurface.putxy(8, 182);
+ g_vm->_screenSurface.writeg(copy(str_, tlig, pred(int, (tlig << 1))), 5);
+ g_vm->_screenSurface.putxy(8, 190);
+ g_vm->_screenSurface.writeg(copy(str_, tlig << 1, tlig * 3), 5);
}
}
@@ -254,8 +255,8 @@ void clsf3() {
void ecr3(Common::String text) {
/* debug('ecr3 : '+text);*/
clsf3();
- putxy(8, 192);
- writeg(text, 5);
+ g_vm->_screenSurface.putxy(8, 192);
+ g_vm->_screenSurface.writeg(text, 5);
}
void ecrf6() {
@@ -295,8 +296,8 @@ void clsf10() {
co = 10;
else co = 6;
co = 574 - ((uint)co * st.size() >> 1);
- putxy(co, 92);
- writeg(st, 4);
+ g_vm->_screenSurface.putxy(co, 92);
+ g_vm->_screenSurface.writeg(st, 4);
if (res == 1) co = 620;
else co = 584;
box(15, gd, 560, 24, co, 86, 255);
@@ -454,10 +455,10 @@ void f3f8() {
if (res == 1) co = 107;
else co = 64;
- putxy(3, 44);
- writeg(g_vm->getString(S_F3), 5);
- ywhere = 51;
- writeg(g_vm->getString(S_F8), 5);
+ g_vm->_screenSurface.putxy(3, 44);
+ g_vm->_screenSurface.writeg(g_vm->getString(S_F3), 5);
+ g_vm->_screenSurface._textPos.y = 51;
+ g_vm->_screenSurface.writeg(g_vm->getString(S_F8), 5);
boite(0, 42, co, 16, 7);
}
@@ -488,43 +489,43 @@ void affper(int per) {
for (cx = 1; cx <= 8; cx ++) menu_disable(disc[cx]);
clsf10();
if ((per & 128) == 128) {
- putxy(560, 24);
- writeg("LEO", 4);
+ g_vm->_screenSurface.putxy(560, 24);
+ g_vm->_screenSurface.writeg("LEO", 4);
menu_enable(disc[1]);
}
if ((per & 64) == 64) {
- putxy(560, 32);
- writeg("PAT", 4);
+ g_vm->_screenSurface.putxy(560, 32);
+ g_vm->_screenSurface.writeg("PAT", 4);
menu_enable(disc[2]);
}
if ((per & 32) == 32) {
- putxy(560, 40);
- writeg("GUY", 4);
+ g_vm->_screenSurface.putxy(560, 40);
+ g_vm->_screenSurface.writeg("GUY", 4);
menu_enable(disc[3]);
}
if ((per & 16) == 16) {
- putxy(560, 48);
- writeg("EVA", 4);
+ g_vm->_screenSurface.putxy(560, 48);
+ g_vm->_screenSurface.writeg("EVA", 4);
menu_enable(disc[4]);
}
if ((per & 8) == 8) {
- putxy(560, 56);
- writeg("BOB", 4);
+ g_vm->_screenSurface.putxy(560, 56);
+ g_vm->_screenSurface.writeg("BOB", 4);
menu_enable(disc[5]);
}
if ((per & 4) == 4) {
- putxy(560, 64);
- writeg("LUC", 4);
+ g_vm->_screenSurface.putxy(560, 64);
+ g_vm->_screenSurface.writeg("LUC", 4);
menu_enable(disc[6]);
}
if ((per & 2) == 2) {
- putxy(560, 72);
- writeg("IDA", 4);
+ g_vm->_screenSurface.putxy(560, 72);
+ g_vm->_screenSurface.writeg("IDA", 4);
menu_enable(disc[7]);
}
if ((per & 1) == 1) {
- putxy(560, 80);
- writeg("MAX", 4);
+ g_vm->_screenSurface.putxy(560, 80);
+ g_vm->_screenSurface.writeg("MAX", 4);
menu_enable(disc[8]);
}
ipers = per;
@@ -621,12 +622,12 @@ void person() {
menu_disable(disc[cf]);
clsf10();
- putxy(560, 30);
- writeg(g_vm->getString(S_YOU), 4);
- putxy(560, 50);
- writeg(g_vm->getString(S_ARE), 4);
- putxy(560, 70);
- writeg(g_vm->getString(S_ALONE), 4);
+ g_vm->_screenSurface.putxy(560, 30);
+ g_vm->_screenSurface.writeg(g_vm->getString(S_YOU), 4);
+ g_vm->_screenSurface.putxy(560, 50);
+ g_vm->_screenSurface.writeg(g_vm->getString(S_ARE), 4);
+ g_vm->_screenSurface.putxy(560, 70);
+ g_vm->_screenSurface.writeg(g_vm->getString(S_ALONE), 4);
ipers = 0;
}
@@ -664,14 +665,16 @@ void pendule() {
if (h == 0) h = 12;
droite(((uint)x >> 1)*res, y, ((uint)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co);
show_mouse();
- putxy(568, 154);
- if (heu > 11) writeg("PM ", 1);
- else writeg("AM ", 1);
- putxy(550, 160);
+ g_vm->_screenSurface.putxy(568, 154);
+ if (heu > 11)
+ g_vm->_screenSurface.writeg("PM ", 1);
+ else
+ g_vm->_screenSurface.writeg("AM ", 1);
+ g_vm->_screenSurface.putxy(550, 160);
if ((jou >= 0) && (jou <= 8)) {
Common::String tmp = g_vm->getString(S_DAY);
tmp.insertChar((char)(jou + 49), 0);
- writeg(tmp, 1);
+ g_vm->_screenSurface.writeg(tmp, 1);
}
}
@@ -1218,8 +1221,10 @@ void phaz(int &haz, int &p, int cf) {
}
void writetp(Common::String s, int t) {
- if (res == 2) writeg(s, t);
- else writeg(copy(s, 1, 25), t);
+ if (res == 2)
+ g_vm->_screenSurface.writeg(s, t);
+ else
+ g_vm->_screenSurface.writeg(copy(s, 1, 25), t);
}
void messint(int nu) {
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index b8b76c1928..515fd836f6 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -182,10 +182,14 @@ void fenat(char ans) {
int coul;
hide_mouse();
- if (gd == cga) coul = 2;
- else if (gd == her) coul = 1;
- else coul = 12;
- affcar(gd, 306, 193, coul, ord(ans));
+ if (gd == cga)
+ coul = 2;
+ else if (gd == her)
+ coul = 1;
+ else
+ coul = 12;
+
+ g_vm->_screenSurface.writeCharacter(Common::Point(306, 193), ord(ans), coul);
boite(300, 191, 16, 8, 15);
show_mouse();
}
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 98429cc04e..631be60cf8 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -261,7 +261,6 @@ void show_mouse() {
}
break;
} /* case Gd */
- affput(Common::Point(x_s, y_s), 0, 0);
}
void pos_mouse(int x, int y) {
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index b42aa481ba..e7d75517be 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -26,7 +26,9 @@
*/
#include "mortevielle/outtext.h"
+#include "mortevielle/graphics.h"
#include "mortevielle/level15.h"
+#include "mortevielle/mortevielle.h"
#include "mortevielle/sprint.h"
#include "mortevielle/var_mor.h"
#include "common/str.h"
@@ -174,7 +176,7 @@ void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
/* debug(' .. Afftex');*/
- putxy(x, y);
+ g_vm->_screenSurface.putxy(x, y);
if (res == 1) tab = 10;
else tab = 6;
dx = dx * 6;
@@ -189,12 +191,12 @@ void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
while (! the_end) {
switch (ch[p]) {
case '@' : {
- writeg(s, typ);
+ g_vm->_screenSurface.writeg(s, typ);
s = "";
p = p + 1;
xc = x;
yc = yc + 6;
- putxy(xc, yc);
+ g_vm->_screenSurface.putxy(xc, yc);
}
break;
case ' ' : {
@@ -202,7 +204,7 @@ void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
xc = xc + tab;
p = p + 1;
if (l_motsuiv(p, ch, tab) + xc > xf) {
- writeg(s, typ);
+ g_vm->_screenSurface.writeg(s, typ);
s = "";
xc = x;
yc = yc + 6;
@@ -214,21 +216,21 @@ void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
do {
j = x;
do {
- putxy(j, i);
- writeg(" ", 0);
+ g_vm->_screenSurface.putxy(j, i);
+ g_vm->_screenSurface.writeg(" ", 0);
j = j + 6;
} while (!(j > xf));
i = i + 6;
} while (!(i > yf));
yc = y;
}
- putxy(xc, yc);
+ g_vm->_screenSurface.putxy(xc, yc);
}
}
break;
case '$' : {
the_end = true;
- writeg(s, typ);
+ g_vm->_screenSurface.writeg(s, typ);
}
break;
default: {
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 8fb45b5ca3..7deda53d7b 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -339,8 +339,8 @@ void suite() {
dessine(ades, 0, 0);
Common::String cpr = "COPYRIGHT 1989 : LANKHOR";
- putxy(104 + 72 * res, 185);
- writeg(cpr, 0);
+ g_vm->_screenSurface.putxy(104 + 72 * res, 185);
+ g_vm->_screenSurface.writeg(cpr, 0);
}
} // End of namespace Mortevielle
diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
index 027d74791a..6a52b2cdb2 100644
--- a/engines/mortevielle/sprint.cpp
+++ b/engines/mortevielle/sprint.cpp
@@ -42,53 +42,4 @@ void clear_box(int x, int y, int dx) {
box(0, gd, pred(int, x) << 3, pred(int, y) << 3, pred(int, x + dx) << 3, y << 3, 255);
}
-void writeg(Common::String l, int c)
-
-{
- int i, x, xo, yo;
- int cecr = 0;
-
- /* debug('writeg : '+l);*/
-
- if (l == "") return;
- hide_mouse();
- xo = xwhere;
- yo = ywhere;
- if (res == 2) i = 6;
- else i = 10;
- x = xo + i * l.size();
- switch (c) {
- case 1:
- case 3 : {
- cecr = 0;
- box(15, gd, xo, yo, x, yo + 7, 255);
- }
- break;
- case 4 : {
- cecr = 0;
- }
- break;
- case 5 : {
- cecr = 15;
- }
- break;
- case 0:
- case 2 : {
- cecr = 15;
- box(0, gd, xo, yo, x, yo + 7, 255);
- }
- break;
- }
- xo = xo + 1;
- yo = yo + 1;
- for (x = 1; x <= (int)l.size(); x ++) {
- affcar(gd, xo, yo, cecr, ord(l[x - 1]));
- xo = xo + i;
- }
- show_mouse();
-
- // TODO: Move screen updates to main loop once constructed
- g_vm->_screenSurface.updateScreen();
-}
-
} // End of namespace Mortevielle
diff --git a/engines/mortevielle/sprint.h b/engines/mortevielle/sprint.h
index 8484214fa3..09d5758f63 100644
--- a/engines/mortevielle/sprint.h
+++ b/engines/mortevielle/sprint.h
@@ -34,7 +34,6 @@ namespace Mortevielle {
extern void fill_box(int x, int y, int dx);
extern void clear_box(int x, int y, int dx);
-extern void writeg(Common::String l, int c);
} // End of namespace Mortevielle
#endif
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index cd84b934a1..77da4a50a0 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -164,8 +164,6 @@ int x,
prebru,
typlec,
num_ph,
- xwhere,
- ywhere,
numpal,
lderobj,
nb_word,
@@ -236,27 +234,6 @@ void hirs() {
}
/**
- * Draws either a single pixel or a character to the screen
- */
-void affput(const Common::Point &pt, int palIndex, int ch) {
- if (ch == 0)
- g_vm->_screenSurface.setPixel(pt, palIndex);
- else
- g_vm->_screenSurface.writeCharacter(pt, ch, palIndex);
-}
-
-void affcar(int gd, int x, int y, int coul, int chr) {
- if (res == 1)
- affput(Common::Point(((uint)x >> 1), y), coul, chr);
- else
- affput(Common::Point(x, y), coul, chr);
-}
-
-void putpix(int gd, int x, int y, int coul) {
- affput(Common::Point(x, y), coul, 0);
-}
-
-/**
* Returns a substring of the given string
* @param s Source string
* @param idx Starting index (1 based)
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 2e2bf539f2..739934277c 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -336,8 +336,6 @@ extern int x,
prebru,
typlec,
num_ph,
- xwhere,
- ywhere,
numpal,
lderobj,
nb_word,
@@ -399,11 +397,8 @@ extern byte adcfiec[822 * 128];
/*---------------------------------------------------------------------------*/
void hirs();
-void affcar(int gd, int x, int y, int coul, int chr);
-void putpix(int gd, int x, int y, int coul);
Common::String copy(const Common::String &s, int idx, size_t size);
void Val(const Common::String &s, int &V, int Code);
-void affput(const Common::Point &pt, int palIndex, int ch);
/*---------------------------------------------------------------------------*/
/*------------------------------ STUBS ------------------------------*/