mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-18 07:39:08 +00:00
MORTEVIELLE: Rename F3F8 functions, rename everything related to Graphical Device
This commit is contained in:
parent
20e61b40d0
commit
77f9e706e5
@ -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);
|
||||
|
@ -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();
|
||||
};
|
||||
|
||||
|
@ -56,6 +56,8 @@ int testou() {
|
||||
if (keypressed())
|
||||
ch = get_ch();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ord(ch);
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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)) {
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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();
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
namespace Mortevielle {
|
||||
|
||||
extern void change_gd(int ngd);
|
||||
extern void changeGraphicalDevice(int newDevice);
|
||||
|
||||
/* NIVEAU 3 */
|
||||
/* procedure PROGRAMME */
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user