aboutsummaryrefslogtreecommitdiff
path: root/engines/mortevielle
diff options
context:
space:
mode:
authorStrangerke2012-02-21 22:14:22 +0100
committerStrangerke2012-04-06 08:21:42 +0200
commit77f9e706e50e11d711575a90e18522381d5bac73 (patch)
tree60652866008630337b0438d176016f20594383aa /engines/mortevielle
parent20e61b40d05b35c55038311a1a617b70f0790837 (diff)
downloadscummvm-rg350-77f9e706e50e11d711575a90e18522381d5bac73.tar.gz
scummvm-rg350-77f9e706e50e11d711575a90e18522381d5bac73.tar.bz2
scummvm-rg350-77f9e706e50e11d711575a90e18522381d5bac73.zip
MORTEVIELLE: Rename F3F8 functions, rename everything related to Graphical Device
Diffstat (limited to 'engines/mortevielle')
-rw-r--r--engines/mortevielle/dialogs.cpp38
-rw-r--r--engines/mortevielle/dialogs.h6
-rw-r--r--engines/mortevielle/keyboard.cpp2
-rw-r--r--engines/mortevielle/level15.cpp8
-rw-r--r--engines/mortevielle/menu.cpp2
-rw-r--r--engines/mortevielle/mor.cpp11
-rw-r--r--engines/mortevielle/mor2.cpp6
-rw-r--r--engines/mortevielle/mortevielle.cpp18
-rw-r--r--engines/mortevielle/mouse.cpp4
-rw-r--r--engines/mortevielle/ovd1.cpp4
-rw-r--r--engines/mortevielle/prog.cpp8
-rw-r--r--engines/mortevielle/prog.h2
-rw-r--r--engines/mortevielle/taffich.cpp2
-rw-r--r--engines/mortevielle/var_mor.cpp4
-rw-r--r--engines/mortevielle/var_mor.h4
15 files changed, 71 insertions, 48 deletions
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 991bda4bd4..93b556ea68 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -40,6 +40,10 @@ namespace Mortevielle {
static const int nligne = 7;
+/**
+ * Alert function - Show
+ * @remarks Originally called 'do_alert'
+ */
int Alert::show(const Common::String &msg, int n) {
int coldep, esp, i, caseNumb, quoi, ix;
Common::String st, chaine;
@@ -182,6 +186,10 @@ int Alert::show(const Common::String &msg, int n) {
return do_alert_result;
}
+/**
+ * Alert function - Decode Alert Details
+ * @remarks Originally called 'decod'
+ */
void Alert::decodeAlertDetails(Common::String s, int &nbc, int &lineNumb, int &col, Common::String &c, Common::String &cs) {
int i, k;
bool v;
@@ -244,7 +252,6 @@ void Alert::drawAlertBox(int lidep, int nli, int tx) {
g_vm->_screenSurface.fillRect(0, Common::Rect(x, yy - 4, xx, yy - 2));
}
-
/**
* Alert function - Set Button Text
* @remarks Originally called 'fait_choix'
@@ -425,34 +432,43 @@ void f3f8::draw() {
g_vm->_screenSurface.drawBox(0, 42, MAX(f3Width, f8Width) + 6, 16, 7);
}
-void f3f8::divers(int np, bool b) {
+/**
+ * Alert function - Loop until F8 is pressed, update
+ * Graphical Device if modified
+ * @remarks Originally called 'diver'
+ */
+void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) {
teskbd();
do {
- parole(np, 0, 0);
- atf3f8(key);
+ parole(SpeechNum, 0, 0);
+ waitForF3F8(key);
CHECK_QUIT;
- if (newgd != gd) {
- gd = newgd;
+ if (_newGraphicalDevice != _currGraphicalDevice) {
+ _currGraphicalDevice = _newGraphicalDevice;
hirs();
- aff50(b);
+ aff50(drawAni50Fl);
}
- } while (!(key == 66));
+ } while (!(key == 66)); // keycode for F8
}
-void f3f8::atf3f8(int &key) {
+/**
+ * Alert function - Loop until F3 or F8 is pressed
+ * @remarks Originally called 'atf3f8'
+ */
+void f3f8::waitForF3F8(int &key) {
do {
key = testou();
CHECK_QUIT;
} while (!((key == 61) || (key == 66)));
}
-void f3f8::aff50(bool c) {
+void f3f8::aff50(bool drawAni50Fl) {
caff = 50;
_maff = 0;
taffich();
dessine(ades, 63, 12);
- if (c)
+ if (drawAni50Fl)
ani50();
else
repon(2, c_paroles + 142);
diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h
index 76b824eab0..a8c0cb7cf7 100644
--- a/engines/mortevielle/dialogs.h
+++ b/engines/mortevielle/dialogs.h
@@ -50,9 +50,9 @@ public:
class f3f8 {
public:
static void draw();
- static void divers(int np, bool b);
- static void atf3f8(int &key);
- static void aff50(bool c);
+ static void checkForF8(int SpeechNum, bool drawAni50Fl);
+ static void waitForF3F8(int &key);
+ static void aff50(bool drawAni50Fl);
static void ani50();
};
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index bd7ad2c8aa..679264bff9 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -56,6 +56,8 @@ int testou() {
if (keypressed())
ch = get_ch();
break;
+ default:
+ break;
}
return ord(ch);
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index d297529470..eff7172235 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -68,7 +68,7 @@ void outbloc(int n, pattern p, t_nhom pal) {
void writepal(int n) {
t_nhom pal;
- switch (gd) {
+ switch (_currGraphicalDevice) {
case tan:
case ega:
case ams:
@@ -96,7 +96,7 @@ void pictout(int seg, int dep, int x, int y) {
GfxSurface surface;
surface.decode(&mem[seg * 16 + dep]);
- if (gd == her) {
+ if (_currGraphicalDevice == her) {
mem[0x7000 * 16 + 2] = 0;
mem[0x7000 * 16 + 32] = 15;
}
@@ -109,13 +109,13 @@ void pictout(int seg, int dep, int x, int y) {
void sauvecr(int y, int dy) {
hideMouse();
- s_sauv(gd, y, dy);
+ s_sauv(_currGraphicalDevice, y, dy);
showMouse();
}
void charecr(int y, int dy) {
hideMouse();
- s_char(gd, y, dy);
+ s_char(_currGraphicalDevice, y, dy);
showMouse();
}
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index b585177f19..9f2e83f967 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -152,7 +152,7 @@ void Menu::menu_aff() {
g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
col = 28 * res;
- if (gd == cga)
+ if (_currGraphicalDevice == cga)
color = 1;
else
color = 9;
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index a4283407c5..76ba080c22 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -113,7 +113,7 @@ void dessine(int ad, int x, int y) {
void dessine_rouleau() {
writepal(89);
- if (gd == her) {
+ if (_currGraphicalDevice == her) {
mem[0x7000 * 16 + 14] = 15;
}
hideMouse();
@@ -266,7 +266,7 @@ void clsf10() {
void stop() {
hirs();
- gd = ams;
+ _currGraphicalDevice = ams;
hirs();
g_vm->quitGame();
}
@@ -274,7 +274,7 @@ void stop() {
void paint_rect(int x, int y, int dx, int dy) {
int co;
- if (gd == cga)
+ if (_currGraphicalDevice == cga)
co = 3;
else
co = 11;
@@ -634,9 +634,10 @@ void drawClock() {
paint_rect(570, 118, 20, 10);
paint_rect(578, 114, 6, 18);
- if ((gd == cga) || (gd == her))
+ if ((_currGraphicalDevice == cga) || (_currGraphicalDevice == her))
co = 0;
- else co = 1;
+ else
+ co = 1;
if (_minute == 0)
g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y - rg), co);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 9dcbb85b0e..fff6917907 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -200,9 +200,9 @@ void fenat(char ans) {
int coul;
hideMouse();
- if (gd == cga)
+ if (_currGraphicalDevice == cga)
coul = 2;
- else if (gd == her)
+ else if (_currGraphicalDevice == her)
coul = 1;
else
coul = 12;
@@ -425,7 +425,7 @@ void sparl(float adr, float rep) {
key = 0;
do {
parole(repint, haut[caff - 69], 0);
- f3f8::atf3f8(key);
+ f3f8::waitForF3F8(key);
CHECK_QUIT;
} while (!(key == 66));
hirs();
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 4112073cde..e6ecbde4d3 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -120,7 +120,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
_screenSurface.create(SCREEN_WIDTH, SCREEN_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
// Set the screen mode
- gd = ega;
+ _currGraphicalDevice = ega;
res = 2;
// Load the mort.dat resource
@@ -134,8 +134,8 @@ Common::ErrorCode MortevielleEngine::initialise() {
// Setup the mouse cursor
initMouse();
- gd = ega;
- newgd = gd;
+ _currGraphicalDevice = ega;
+ _newGraphicalDevice = _currGraphicalDevice;
zuul = false;
tesok = false;
chartex();
@@ -153,10 +153,10 @@ Common::ErrorCode MortevielleEngine::initialise() {
teskbd();
dialpre();
- newgd = gd;
+ _newGraphicalDevice = _currGraphicalDevice;
teskbd();
- if (newgd != gd)
- gd = newgd;
+ if (_newGraphicalDevice != _currGraphicalDevice)
+ _currGraphicalDevice = _newGraphicalDevice;
hirs();
ades = 0x7000;
@@ -469,11 +469,11 @@ Common::Error MortevielleEngine::run() {
void MortevielleEngine::showIntroduction() {
f3f8::aff50(false);
mlec = 0;
- f3f8::divers(142, false);
+ f3f8::checkForF8(142, false);
CHECK_QUIT;
f3f8::ani50();
- f3f8::divers(143, true);
+ f3f8::checkForF8(143, true);
CHECK_QUIT;
// TODO: Once music is implemented, only use the below delay if music is turned off
@@ -558,7 +558,7 @@ void MortevielleEngine::handleAction() {
g_vm->_menu.eraseMenu();
imen = false;
if ((inkey == '\1') || (inkey == '\3') || (inkey == '\5') || (inkey == '\7') || (inkey == '\11')) {
- change_gd((uint)pred(int, ord(inkey)) >> 1);
+ changeGraphicalDevice((uint)pred(int, ord(inkey)) >> 1);
return;
}
if (choisi && (msg[3] == sauve)) {
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 44b254fe41..2a4ab76efb 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -89,7 +89,7 @@ void hideMouse() {
if (mouse_shwn == 0) {
imp = odd(y_s);
j = p_o_s;
- switch (gd) {
+ switch (_currGraphicalDevice) {
case cga:
k = 0;
j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
@@ -180,7 +180,7 @@ void showMouse() {
j = p_o_s;
imp = odd(y_s);
i = x_s & 7;
- switch (gd) {
+ switch (_currGraphicalDevice) {
case cga:
k = 0;
j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 0177d3e5c1..fb893570ff 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -239,8 +239,8 @@ void suite() {
caff = 51;
taffich();
teskbd();
- if (newgd != gd)
- gd = newgd;
+ if (_newGraphicalDevice != _currGraphicalDevice)
+ _currGraphicalDevice = _newGraphicalDevice;
hirs();
dessine(ades, 0, 0);
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index fa83b822d0..0c05e81cdb 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -38,9 +38,13 @@
namespace Mortevielle {
-void change_gd(int ngd) {
+/**
+ * Engine function - Change Graphical Device
+ * @remarks Originally called 'change_gd'
+ */
+void changeGraphicalDevice(int newDevice) {
hideMouse();
- gd = ngd;
+ _currGraphicalDevice = newDevice;
hirs();
initMouse();
showMouse();
diff --git a/engines/mortevielle/prog.h b/engines/mortevielle/prog.h
index e88b943307..c6ccca8920 100644
--- a/engines/mortevielle/prog.h
+++ b/engines/mortevielle/prog.h
@@ -30,7 +30,7 @@
namespace Mortevielle {
-extern void change_gd(int ngd);
+extern void changeGraphicalDevice(int newDevice);
/* NIVEAU 3 */
/* procedure PROGRAMME */
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 4da3ef0c32..1306f7f1b1 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -208,7 +208,7 @@ void taffich() {
npal = a + 37;
}
chardes(filename, lgt, handle);
- if (gd == her) {
+ if (_currGraphicalDevice == her) {
for (i = 0; i <= 15; ++i) {
palh = READ_LE_UINT16(&mem[0x7000 * 16 + (succ(int, i) << 1)]);
alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index efd84cca76..759c29ab9b 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -124,7 +124,7 @@ int x,
jh,
mh,
cs,
- gd, /* Gd = graph device */
+ _currGraphicalDevice,
hdb,
hfb,
_hour,
@@ -147,7 +147,7 @@ int x,
msg3,
msg4,
mlec,
- newgd,
+ _newGraphicalDevice,
c_zzz,
mchai,
menup,
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index a77586ca2b..179c92d6bc 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -273,7 +273,7 @@ extern int x,
jh,
mh,
cs,
- gd, /* Gd = graph device */
+ _currGraphicalDevice,
hdb,
hfb,
_hour,
@@ -296,7 +296,7 @@ extern int x,
msg3,
msg4,
mlec,
- newgd,
+ _newGraphicalDevice,
c_zzz,
mchai,
menup,