MORTEVIELLE: Rename mouse functions, various formatting fixes
This commit is contained in:
parent
b12f8bf5ad
commit
d868681976
13 changed files with 240 additions and 220 deletions
|
@ -534,12 +534,12 @@ void tmettre() {
|
|||
i = Alert::show(delig, 1);
|
||||
tesok = false;
|
||||
entre = Ques::show();
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
hirs();
|
||||
dessine_rouleau();
|
||||
clsf2();
|
||||
clsf3();
|
||||
show_mouse();
|
||||
showMouse();
|
||||
tinke();
|
||||
pendule();
|
||||
if (ipers != 0)
|
||||
|
@ -1034,7 +1034,7 @@ void tparler()
|
|||
}
|
||||
tkey1(false);
|
||||
mennor();
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
hirs();
|
||||
premtet();
|
||||
sparl(0, suj);
|
||||
|
@ -1047,7 +1047,7 @@ void tparler()
|
|||
}
|
||||
lib[46] = lib[45];
|
||||
lib[45] = ' ';
|
||||
show_mouse();
|
||||
showMouse();
|
||||
do {
|
||||
choi = 0;
|
||||
icm = 0;
|
||||
|
@ -1068,10 +1068,10 @@ void tparler()
|
|||
writetp(lib[46], 0);
|
||||
tou = '\0';
|
||||
do {
|
||||
mov_mouse(f, tou);
|
||||
moveMouse(f, tou);
|
||||
CHECK_QUIT;
|
||||
|
||||
read_pos_mouse(x, y, c);
|
||||
getMousePos(x, y, c);
|
||||
x = x * (3 - res);
|
||||
if (x > 319) cx = 41;
|
||||
else cx = 1;
|
||||
|
@ -1135,11 +1135,11 @@ void tparler()
|
|||
s.conf = s.conf + 3;
|
||||
suj = 139;
|
||||
}
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
hirs();
|
||||
premtet();
|
||||
sparl(0, suj);
|
||||
show_mouse();
|
||||
showMouse();
|
||||
if ((suj == 84) || (suj == 86)) {
|
||||
s.pourc[5] = '*';
|
||||
s.teauto[7] = '*';
|
||||
|
@ -1152,26 +1152,26 @@ void tparler()
|
|||
s.pourc[8] = '*';
|
||||
s.teauto[32] = '*';
|
||||
}
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
hirs();
|
||||
show_mouse();
|
||||
showMouse();
|
||||
}
|
||||
} while (!((choi == 46) || (suj == 138)));
|
||||
if (col) {
|
||||
s.conf = s.conf + (3 * (s.conf / 10));
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
hirs();
|
||||
premtet();
|
||||
sparl(0, 138);
|
||||
show_mouse();
|
||||
showMouse();
|
||||
col = false;
|
||||
s.mlieu = 15;
|
||||
}
|
||||
ctrm = 0;
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
hirs();
|
||||
dessine_rouleau();
|
||||
show_mouse();
|
||||
showMouse();
|
||||
affper(ipers);
|
||||
tinke();
|
||||
pendule();
|
||||
|
@ -1216,13 +1216,13 @@ void MortevielleEngine::endGame() {
|
|||
clsf3();
|
||||
repon(9, 1509);
|
||||
tkey1(false);
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
caff = 70;
|
||||
taffich();
|
||||
hirs();
|
||||
premtet();
|
||||
sparl(0, 141);
|
||||
show_mouse();
|
||||
showMouse();
|
||||
clsf1();
|
||||
repon(9, 1509);
|
||||
repon(2, 142);
|
||||
|
|
|
@ -64,7 +64,7 @@ int Alert::show(const Common::String &msg, int n) {
|
|||
/*debug('** do_alert **');*/
|
||||
memset(&limit[0][0], 0, sizeof(int) * 3 * 3);
|
||||
int do_alert_result;
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
while (keypressed())
|
||||
dumi = get_ch(); // input >> kbd >> dumi;
|
||||
|
||||
|
@ -106,12 +106,12 @@ int Alert::show(const Common::String &msg, int n) {
|
|||
limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) >> 1) * res;
|
||||
limit[2][2] = (limit[2][1]) + 40;
|
||||
}
|
||||
show_mouse();
|
||||
showMouse();
|
||||
quoi = 0;
|
||||
dum = false;
|
||||
do {
|
||||
dumi = '\377';
|
||||
mov_mouse(dum, dumi);
|
||||
moveMouse(dum, dumi);
|
||||
CHECK_QUIT0;
|
||||
|
||||
cx = x_s;
|
||||
|
@ -127,7 +127,7 @@ int Alert::show(const Common::String &msg, int n) {
|
|||
if (test1) ix = 1;
|
||||
else ix = 2;
|
||||
if (ix != quoi) {
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
if (quoi != 0) {
|
||||
setPosition(quoi, coldep, esp);
|
||||
|
||||
|
@ -144,12 +144,12 @@ int Alert::show(const Common::String &msg, int n) {
|
|||
g_vm->_screenSurface.writeg(tmp2, 1);
|
||||
|
||||
quoi = ix;
|
||||
show_mouse();
|
||||
showMouse();
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((quoi != 0) && ! newaff) {
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
setPosition(quoi, coldep, esp);
|
||||
|
||||
Common::String tmp3(" ");
|
||||
|
@ -158,13 +158,13 @@ int Alert::show(const Common::String &msg, int n) {
|
|||
g_vm->_screenSurface.writeg(tmp3, 0);
|
||||
|
||||
quoi = 0;
|
||||
show_mouse();
|
||||
showMouse();
|
||||
}
|
||||
test3 = (cy > 95) && (cy < 105) && (((cx > limit[1][1]) && (cx < limit[1][2]))
|
||||
|| ((cx > limit[2][1]) && (cx < limit[2][2])));
|
||||
} while (!g_vm->getMouseClick());
|
||||
g_vm->setMouseClick(false);
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
if (! test3) {
|
||||
quoi = n;
|
||||
setPosition(n, coldep, esp);
|
||||
|
@ -174,7 +174,7 @@ int Alert::show(const Common::String &msg, int n) {
|
|||
g_vm->_screenSurface.writeg(tmp4, 1);
|
||||
}
|
||||
charecr(50, succ(int, nligne) << 4);
|
||||
show_mouse();
|
||||
showMouse();
|
||||
|
||||
/* Restore the background area */
|
||||
g_vm->_screenSurface.copyFrom(g_vm->_backgroundSurface, 0, 0);
|
||||
|
@ -289,9 +289,9 @@ bool Ques::show() {
|
|||
compte = 0;
|
||||
|
||||
do {
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
hirs();
|
||||
show_mouse();
|
||||
showMouse();
|
||||
i = i + 1;
|
||||
deline(ta[i], st, tay);
|
||||
if (res == 1) y = 29;
|
||||
|
@ -340,7 +340,7 @@ bool Ques::show() {
|
|||
do {
|
||||
g_vm->setMouseClick(false);
|
||||
tesok = false;
|
||||
mov_mouse(func, key);
|
||||
moveMouse(func, key);
|
||||
CHECK_QUIT0;
|
||||
|
||||
k = 1;
|
||||
|
|
|
@ -1048,7 +1048,7 @@ void ScreenSurface::writeg(const Common::String &l, int c) {
|
|||
|
||||
if (l == "")
|
||||
return;
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
pt = _textPos;
|
||||
|
||||
if (res == 2)
|
||||
|
@ -1085,7 +1085,7 @@ void ScreenSurface::writeg(const Common::String &l, int c) {
|
|||
g_vm->_screenSurface.writeCharacter(Common::Point(pt.x, pt.y), ord(l[x - 1]), cecr);
|
||||
pt.x += i;
|
||||
}
|
||||
show_mouse();
|
||||
showMouse();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -50,7 +50,7 @@ bool dans_rect(rectangle r) {
|
|||
int x, y, c;
|
||||
|
||||
bool dans_rect_result;
|
||||
read_pos_mouse(x, y, c);
|
||||
getMousePos(x, y, c);
|
||||
if ((x > r.x1) &&
|
||||
(x < r.x2) &&
|
||||
(y > r.y1) &&
|
||||
|
@ -113,15 +113,15 @@ void pictout(int seg, int dep, int x, int y) {
|
|||
}
|
||||
|
||||
void sauvecr(int y, int dy) {
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
s_sauv(gd, y, dy);
|
||||
show_mouse();
|
||||
showMouse();
|
||||
}
|
||||
|
||||
void charecr(int y, int dy) {
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
s_char(gd, y, dy);
|
||||
show_mouse();
|
||||
showMouse();
|
||||
}
|
||||
|
||||
void adzon() {
|
||||
|
|
|
@ -148,7 +148,7 @@ void Menu::menu_aff() {
|
|||
|
||||
int pt, x, y, color, msk, num_letr;
|
||||
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
|
||||
g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
|
||||
col = 28 * res;
|
||||
|
@ -180,7 +180,7 @@ void Menu::menu_aff() {
|
|||
} while (!(y == 9));
|
||||
col = col + 48 * res;
|
||||
} while (!(num_letr == 6));
|
||||
show_mouse();
|
||||
showMouse();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -279,7 +279,7 @@ void Menu::menuDown(int ii) {
|
|||
// Draw the menu
|
||||
xco = don[ii][1];
|
||||
nb_lig = don[ii][4];
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
sauvecr(10, succ(byte, don[ii][2]) << 1);
|
||||
xco = xco << 3;
|
||||
if (res == 1) cx = 10;
|
||||
|
@ -337,7 +337,7 @@ void Menu::menuDown(int ii) {
|
|||
g_vm->_screenSurface.putxy(xco, g_vm->_screenSurface._textPos.y + 8);
|
||||
} while (!(cx == nb_lig));
|
||||
test0 = true;
|
||||
show_mouse();
|
||||
showMouse();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -92,10 +92,10 @@ void modif(int &nu) {
|
|||
|
||||
void dessine(int ad, int x, int y) {
|
||||
/* debug('dessine'); */
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
writepal(numpal);
|
||||
pictout(ad, 0, x, y);
|
||||
show_mouse();
|
||||
showMouse();
|
||||
}
|
||||
|
||||
void dessine_rouleau() {
|
||||
|
@ -104,9 +104,9 @@ void dessine_rouleau() {
|
|||
if (gd == her) {
|
||||
mem[0x7000 * 16 + 14] = 15;
|
||||
}
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
pictout(0x73a2, 0, 0, 0);
|
||||
show_mouse();
|
||||
showMouse();
|
||||
}
|
||||
|
||||
|
||||
|
@ -145,17 +145,17 @@ void ecrf1() {
|
|||
|
||||
void clsf1() {
|
||||
/* debug('clsf1'); */
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
g_vm->_screenSurface.fillRect(0, Common::Rect(0, 11, 514, 175));
|
||||
|
||||
show_mouse();
|
||||
showMouse();
|
||||
}
|
||||
|
||||
void clsf2() {
|
||||
// int i, j;
|
||||
|
||||
/* debug('clsf2'); */
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
if (f2_all) {
|
||||
g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 199));
|
||||
g_vm->_screenSurface.drawBox(0, 175, 634, 24, 15);
|
||||
|
@ -164,7 +164,7 @@ void clsf2() {
|
|||
g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 190));
|
||||
g_vm->_screenSurface.drawBox(0, 175, 634, 15, 15);
|
||||
}
|
||||
show_mouse();
|
||||
showMouse();
|
||||
}
|
||||
|
||||
void ecrf2() {
|
||||
|
@ -203,10 +203,10 @@ void clsf3() {
|
|||
// int i, j;
|
||||
|
||||
/* debug('clsf3'); */
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
g_vm->_screenSurface.fillRect(0, Common::Rect(1, 192, 633, 199));
|
||||
g_vm->_screenSurface.drawBox(0, 191, 634, 8, 15);
|
||||
show_mouse();
|
||||
showMouse();
|
||||
}
|
||||
|
||||
void ecr3(Common::String text) {
|
||||
|
@ -231,7 +231,7 @@ void clsf10() {
|
|||
Common::String st;
|
||||
|
||||
/* debug('clsf10'); */
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
if (res == 1) {
|
||||
co = 634;
|
||||
cod = 534;
|
||||
|
@ -254,7 +254,7 @@ void clsf10() {
|
|||
else co = 584;
|
||||
g_vm->_screenSurface.fillRect(15, Common::Rect(560, 24, co, 86));
|
||||
/* rempli(69,12,32,5,255);*/
|
||||
show_mouse();
|
||||
showMouse();
|
||||
}
|
||||
|
||||
void stop() {
|
||||
|
@ -595,7 +595,7 @@ void pendule() {
|
|||
|
||||
|
||||
/* debug('pendule'); */
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
|
||||
paint_rect(570, 118, 20, 10);
|
||||
paint_rect(578, 114, 6, 18);
|
||||
|
@ -610,7 +610,7 @@ void pendule() {
|
|||
if (h > 12) h = h - 12;
|
||||
if (h == 0) h = 12;
|
||||
g_vm->_screenSurface.droite(((uint)x >> 1)*res, y, ((uint)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co);
|
||||
show_mouse();
|
||||
showMouse();
|
||||
g_vm->_screenSurface.putxy(568, 154);
|
||||
if (heu > 11)
|
||||
g_vm->_screenSurface.writeg("PM ", 1);
|
||||
|
|
|
@ -181,7 +181,7 @@ void tinke() {
|
|||
void fenat(char ans) {
|
||||
int coul;
|
||||
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
if (gd == cga)
|
||||
coul = 2;
|
||||
else if (gd == her)
|
||||
|
@ -191,7 +191,7 @@ void fenat(char ans) {
|
|||
|
||||
g_vm->_screenSurface.writeCharacter(Common::Point(306, 193), ord(ans), coul);
|
||||
g_vm->_screenSurface.drawBox(300, 191, 16, 8, 15);
|
||||
show_mouse();
|
||||
showMouse();
|
||||
}
|
||||
|
||||
|
||||
|
@ -207,18 +207,18 @@ void tkey1(bool d) {
|
|||
int x, y, c;
|
||||
int key;
|
||||
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
fenat('K');
|
||||
while (keypressed()) key = testou();
|
||||
do {
|
||||
if (d) tinke();
|
||||
quest = keypressed();
|
||||
read_pos_mouse(x, y, c);
|
||||
getMousePos(x, y, c);
|
||||
CHECK_QUIT;
|
||||
} while (!(quest || (c != 0) || (d && anyone)));
|
||||
if (quest) key = testou();
|
||||
g_vm->setMouseClick(false);
|
||||
show_mouse();
|
||||
showMouse();
|
||||
}
|
||||
|
||||
void tmlieu(int mli) {
|
||||
|
@ -384,7 +384,7 @@ void sparl(float adr, float rep) {
|
|||
char st[1410];
|
||||
|
||||
repint = abs((int)rep);
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
deline(repint + c_paroles, st, tay);
|
||||
afftex(st, 230, 4, 65, 24, 5);
|
||||
f3f8::draw();
|
||||
|
@ -396,7 +396,7 @@ void sparl(float adr, float rep) {
|
|||
CHECK_QUIT;
|
||||
} while (!(key == 66));
|
||||
hirs();
|
||||
show_mouse();
|
||||
showMouse();
|
||||
}
|
||||
|
||||
void finfouil() {
|
||||
|
@ -477,13 +477,13 @@ void t1sama() { /* On entre dans le manoir */ //Translation:
|
|||
repon(2, 33);
|
||||
tkey1(false);
|
||||
mennor();
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
hirs();
|
||||
premtet();
|
||||
sparl(0, 140);
|
||||
dessine_rouleau();
|
||||
pendule();
|
||||
show_mouse();
|
||||
showMouse();
|
||||
s.mlieu = 0;
|
||||
affrep();
|
||||
t5(10);
|
||||
|
@ -616,7 +616,7 @@ void tfleche() {
|
|||
touch = '\0';
|
||||
|
||||
do {
|
||||
mov_mouse(qust, touch);
|
||||
moveMouse(qust, touch);
|
||||
CHECK_QUIT;
|
||||
|
||||
if (g_vm->getMouseClick())
|
||||
|
|
|
@ -145,7 +145,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
|
|||
zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
|
||||
c_zzz = 1;
|
||||
init_nbrepm();
|
||||
init_mouse();
|
||||
initMouse();
|
||||
|
||||
init_lieu();
|
||||
sonoff = false;
|
||||
|
@ -497,7 +497,7 @@ void MortevielleEngine::mainGame() {
|
|||
dprog();
|
||||
hirs();
|
||||
dessine_rouleau();
|
||||
show_mouse();
|
||||
showMouse();
|
||||
|
||||
// Loop to play the game
|
||||
do {
|
||||
|
@ -549,7 +549,7 @@ void MortevielleEngine::handleAction() {
|
|||
do {
|
||||
g_vm->_menu.mdn();
|
||||
tinke();
|
||||
mov_mouse(funct, inkey);
|
||||
moveMouse(funct, inkey);
|
||||
CHECK_QUIT;
|
||||
temps = temps + 1;
|
||||
} while (!((choisi) || (temps > lim) || (funct) || (anyone)));
|
||||
|
|
|
@ -47,8 +47,11 @@ int m_show,
|
|||
|
||||
int s_s[12][6];
|
||||
|
||||
|
||||
void init_mouse() {
|
||||
/**
|
||||
* Initialize the mouse
|
||||
* @remarks Originally called 'init_mouse'
|
||||
*/
|
||||
void initMouse() {
|
||||
registres reg;
|
||||
|
||||
mouse_shwn = 0;
|
||||
|
@ -58,23 +61,28 @@ void init_mouse() {
|
|||
|
||||
g_vm->setMouseClick(false);
|
||||
m_show = m_arrow;
|
||||
if ((READ_LE_UINT16(&mem[0xcc]) == 0) && (READ_LE_UINT16(&mem[0xce]) == 0)) int_m = false;
|
||||
if ((READ_LE_UINT16(&mem[0xcc]) == 0) && (READ_LE_UINT16(&mem[0xce]) == 0))
|
||||
int_m = false;
|
||||
|
||||
if (int_m) {
|
||||
reg.ax = 0;
|
||||
intr(0x33, reg);
|
||||
int_m = (reg.ax == -1);
|
||||
if (int_m) {
|
||||
{
|
||||
reg.ax = 4;
|
||||
reg.cx = 0;
|
||||
reg.dx = 0;
|
||||
}
|
||||
reg.ax = 4;
|
||||
reg.cx = 0;
|
||||
reg.dx = 0;
|
||||
|
||||
intr(0x33, reg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void hide_mouse() {
|
||||
/**
|
||||
* Hide the mouse
|
||||
* @remarks Originally called 'hide_mouse'
|
||||
*/
|
||||
void hideMouse() {
|
||||
int i, j, k, ps;;
|
||||
bool imp;
|
||||
|
||||
|
@ -83,7 +91,7 @@ void hide_mouse() {
|
|||
imp = odd(y_s);
|
||||
j = p_o_s;
|
||||
switch (gd) {
|
||||
case cga : {
|
||||
case cga: {
|
||||
k = 0;
|
||||
j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
|
||||
do {
|
||||
|
@ -91,12 +99,12 @@ void hide_mouse() {
|
|||
WRITE_LE_UINT16(&mem[0xb800 * 16 + j + 2], s_s[1][k]);
|
||||
WRITE_LE_UINT16(&mem[0xba00 * 16 + j], s_s[2][k]);
|
||||
WRITE_LE_UINT16(&mem[0xba00 * 16 + j + 2], s_s[3][k]);
|
||||
j = j + 80;
|
||||
j += 80;
|
||||
k = succ(int, k);
|
||||
} while (!(k >= 5));
|
||||
}
|
||||
break;
|
||||
case ams : {
|
||||
case ams: {
|
||||
for (i = 0; i <= 3; i ++) {
|
||||
port[0x3dd] = 1 << i;
|
||||
k = 0;
|
||||
|
@ -104,10 +112,10 @@ void hide_mouse() {
|
|||
do {
|
||||
if (imp) {
|
||||
WRITE_LE_UINT16(&mem[0xb800 * 16 + j], s_s[i][k]);
|
||||
j = j + 80 - 0x2000;
|
||||
j += 80 - 0x2000;
|
||||
} else {
|
||||
WRITE_LE_UINT16(&mem[0xb800 * 16 + j], s_s[i][k]);
|
||||
j = j + 0x2000;
|
||||
j += 0x2000;
|
||||
}
|
||||
imp = ! imp;
|
||||
k = succ(int, k);
|
||||
|
@ -115,7 +123,7 @@ void hide_mouse() {
|
|||
}
|
||||
}
|
||||
break;
|
||||
case ega : {
|
||||
case ega: {
|
||||
port[0x3c4] = 2;
|
||||
port[0x3ce] = 8;
|
||||
port[0x3cf] = 255;
|
||||
|
@ -129,23 +137,23 @@ void hide_mouse() {
|
|||
mem[0xa000 * 16 + j] = lo(s_s[i][k]);
|
||||
ps = mem[0xa000 * 16 + j + 1];
|
||||
mem[0xa000 * 16 + j + 1] = hi(s_s[i][k]);
|
||||
j = j + 80;
|
||||
j += 80;
|
||||
k = succ(int, k);
|
||||
} while (!(k >= 8));
|
||||
i = i + 1;
|
||||
++i;
|
||||
} while (!(i == 4));
|
||||
}
|
||||
break;
|
||||
case her : {
|
||||
case her: {
|
||||
j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
|
||||
for (i = 0; i <= 5; i ++) {
|
||||
for (k = 0; k <= 3; k ++)
|
||||
WRITE_LE_UINT16(&mem[0xb000 * 16 + k * 0x200 + j], s_s[i][k]);
|
||||
j = j + 80;
|
||||
j += 80;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case tan : {
|
||||
case tan: {
|
||||
j = ((uint)y_s >> 2) * 160 + ((uint)x_s >> 1);
|
||||
k = 0;
|
||||
do {
|
||||
|
@ -153,7 +161,7 @@ void hide_mouse() {
|
|||
WRITE_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j], s_s[k][i + (k << 2)]);
|
||||
WRITE_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j + 2], s_s[k + 3][i + (k << 2)]);
|
||||
}
|
||||
j = j + 160;
|
||||
j += 160;
|
||||
k = succ(int, k);
|
||||
} while (!(k == 3));
|
||||
}
|
||||
|
@ -163,7 +171,11 @@ void hide_mouse() {
|
|||
}
|
||||
}
|
||||
|
||||
void show_mouse() {
|
||||
/**
|
||||
* Show mouse
|
||||
* @remarks Originally called 'show_mouse'
|
||||
*/
|
||||
void showMouse() {
|
||||
int i, j, k, l;
|
||||
bool imp;
|
||||
|
||||
|
@ -173,7 +185,7 @@ void show_mouse() {
|
|||
imp = odd(y_s);
|
||||
i = x_s & 7;
|
||||
switch (gd) {
|
||||
case cga : {
|
||||
case cga: {
|
||||
k = 0;
|
||||
j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
|
||||
do {
|
||||
|
@ -181,12 +193,12 @@ void show_mouse() {
|
|||
s_s[1][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j + 2]);
|
||||
s_s[2][k] = READ_LE_UINT16(&mem[0xba00 * 16 + j]);
|
||||
s_s[3][k] = READ_LE_UINT16(&mem[0xba00 * 16 + j + 2]);
|
||||
j = j + 80;
|
||||
j += 80;
|
||||
k = succ(int, k);
|
||||
} while (!(k >= 5));
|
||||
}
|
||||
break;
|
||||
case ams : {
|
||||
case ams: {
|
||||
for (i = 0; i <= 3; i ++) {
|
||||
j = p_o_s;
|
||||
imp = odd(y_s);
|
||||
|
@ -195,10 +207,10 @@ void show_mouse() {
|
|||
do {
|
||||
if (imp) {
|
||||
s_s[i][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j]);
|
||||
j = j + 80 - 0x2000;
|
||||
j += 80 - 0x2000;
|
||||
} else {
|
||||
s_s[i][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j]);
|
||||
j = j + 0x2000;
|
||||
j += 0x2000;
|
||||
}
|
||||
imp = ! imp;
|
||||
k = succ(int, k);
|
||||
|
@ -206,7 +218,7 @@ void show_mouse() {
|
|||
}
|
||||
}
|
||||
break;
|
||||
case ega : {
|
||||
case ega: {
|
||||
port[0x3ce] = 4;
|
||||
l = 0;
|
||||
do {
|
||||
|
@ -215,14 +227,14 @@ void show_mouse() {
|
|||
j = p_o_s;
|
||||
do {
|
||||
s_s[l][k] = mem[0xa000 * 16 + j] + (mem[0xa000 * 16 + succ(int, j)] << 8);
|
||||
j = j + 80;
|
||||
j += 80;
|
||||
k = succ(int, k);
|
||||
} while (!(k >= 8));
|
||||
l = l + 1;
|
||||
++l;
|
||||
} while (!(l == 4));
|
||||
}
|
||||
break;
|
||||
case her : {
|
||||
case her: {
|
||||
j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
|
||||
for (i = 0; i <= 5; i ++) {
|
||||
for (k = 0; k <= 3; k ++)
|
||||
|
@ -231,7 +243,7 @@ void show_mouse() {
|
|||
}
|
||||
}
|
||||
break;
|
||||
case tan : {
|
||||
case tan: {
|
||||
j = ((uint)y_s >> 2) * 160 + ((uint)x_s >> 1);
|
||||
k = 0;
|
||||
do {
|
||||
|
@ -239,7 +251,7 @@ void show_mouse() {
|
|||
s_s[k][i + (k << 2)] = READ_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j]);
|
||||
s_s[k + 3][i + (k << 2)] = READ_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j + 2]);
|
||||
}
|
||||
j = j + 160;
|
||||
j += 160;
|
||||
k = succ(int, k);
|
||||
} while (!(k == 3));
|
||||
}
|
||||
|
@ -247,24 +259,41 @@ void show_mouse() {
|
|||
} /* case Gd */
|
||||
}
|
||||
|
||||
void pos_mouse(int x, int y) {
|
||||
if (x > 314 * res) x = 314 * res;
|
||||
else if (x < 0) x = 0;
|
||||
if (y > 199) y = 199;
|
||||
else if (y < 0) y = 0;
|
||||
if ((x == x_s) && (y == y_s)) return;
|
||||
/**
|
||||
* Set mouse position
|
||||
* @remarks Originally called 'pos_mouse'
|
||||
*/
|
||||
void setMousePos(int x, int y) {
|
||||
if (x > 314 * res)
|
||||
x = 314 * res;
|
||||
else if (x < 0)
|
||||
x = 0;
|
||||
if (y > 199)
|
||||
y = 199;
|
||||
else if (y < 0)
|
||||
y = 0;
|
||||
if ((x == x_s) && (y == y_s))
|
||||
return;
|
||||
|
||||
// Set the new position
|
||||
g_vm->setMousePos(Common::Point(x, y));
|
||||
}
|
||||
|
||||
void read_pos_mouse(int &x, int &y, int &c) {
|
||||
/**
|
||||
* Get mouse poisition
|
||||
* @remarks Originally called 'read_pos_mouse'
|
||||
*/
|
||||
void getMousePos(int &x, int &y, int &c) {
|
||||
x = g_vm->getMousePos().x;
|
||||
y = g_vm->getMousePos().y;
|
||||
c = g_vm->getMouseClick() ? 1 : 0;
|
||||
}
|
||||
|
||||
void mov_mouse(bool &funct, char &key) {
|
||||
/**
|
||||
* Move mouse
|
||||
* @remarks Originally called 'mov_mouse'
|
||||
*/
|
||||
void moveMouse(bool &funct, char &key) {
|
||||
bool p_key;
|
||||
char in1, in2;
|
||||
int cx, cy, cd;
|
||||
|
@ -283,52 +312,46 @@ void mov_mouse(bool &funct, char &key) {
|
|||
CHECK_QUIT;
|
||||
|
||||
in1 = get_ch();
|
||||
read_pos_mouse(cx, cy, cd);
|
||||
getMousePos(cx, cy, cd);
|
||||
switch (toupper(in1)) {
|
||||
case '4' :
|
||||
case '4':
|
||||
cx = cx - 8;
|
||||
break;
|
||||
case '2' :
|
||||
case '2':
|
||||
cy = cy + 8;
|
||||
break;
|
||||
case '6' :
|
||||
case '6':
|
||||
cx = cx + 8;
|
||||
break;
|
||||
case '8' :
|
||||
case '8':
|
||||
cy = cy - 8;
|
||||
break;
|
||||
case '7' : {
|
||||
case '7':
|
||||
cy = 1;
|
||||
cx = 1;
|
||||
}
|
||||
break;
|
||||
case '1' : {
|
||||
break;
|
||||
case '1':
|
||||
cx = 1;
|
||||
cy = 190;
|
||||
}
|
||||
break;
|
||||
case '9' : {
|
||||
break;
|
||||
case '9':
|
||||
cx = 315 * res;
|
||||
cy = 1;
|
||||
}
|
||||
break;
|
||||
case '3' : {
|
||||
break;
|
||||
case '3':
|
||||
cy = 190;
|
||||
cx = 315 * res;
|
||||
}
|
||||
break;
|
||||
case '5' : {
|
||||
break;
|
||||
case '5':
|
||||
cy = 100;
|
||||
cx = 155 * res;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case ' ':
|
||||
case '\15' : {
|
||||
case '\15':
|
||||
g_vm->setMouseClick(true);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case '\33' : {
|
||||
break;
|
||||
case '\33':
|
||||
p_key = keypressed();
|
||||
|
||||
if (p_key) {
|
||||
|
@ -340,102 +363,90 @@ void mov_mouse(bool &funct, char &key) {
|
|||
return;
|
||||
} else {
|
||||
switch (in2) {
|
||||
case 'K' :
|
||||
case 'K':
|
||||
cx = pred(int, cx);
|
||||
break;
|
||||
case 'P' :
|
||||
case 'P':
|
||||
cy = succ(int, cy);
|
||||
break;
|
||||
case 'M' :
|
||||
case 'M':
|
||||
cx = cx + 2;
|
||||
break;
|
||||
case 'H' :
|
||||
case 'H':
|
||||
cy = pred(int, cy);
|
||||
break;
|
||||
case 'G' : {
|
||||
case 'G':
|
||||
cx = cx - 1;
|
||||
cy = cy - 1;
|
||||
}
|
||||
break;
|
||||
case 'I' : {
|
||||
break;
|
||||
case 'I':
|
||||
cx = cx + 1;
|
||||
cy = cy - 1;
|
||||
}
|
||||
break;
|
||||
case 'O' : {
|
||||
break;
|
||||
case 'O':
|
||||
cx = cx - 1;
|
||||
cy = cy + 1;
|
||||
}
|
||||
break;
|
||||
case 'Q' : {
|
||||
break;
|
||||
case 'Q':
|
||||
cx = cx + 1;
|
||||
cy = cy + 1;
|
||||
}
|
||||
break;
|
||||
} /* case */
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
} // case
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'I' : {
|
||||
break;
|
||||
case 'I':
|
||||
cx = res * 32;
|
||||
cy = 8;
|
||||
}
|
||||
break;
|
||||
case 'D' : {
|
||||
break;
|
||||
case 'D':
|
||||
cx = 80 * res;
|
||||
cy = 8;
|
||||
}
|
||||
break;
|
||||
case 'A' : {
|
||||
break;
|
||||
case 'A':
|
||||
cx = 126 * res;
|
||||
cy = 8;
|
||||
}
|
||||
break;
|
||||
case 'S' : {
|
||||
break;
|
||||
case 'S':
|
||||
cx = 174 * res;
|
||||
cy = 8;
|
||||
}
|
||||
break;
|
||||
case 'P' : {
|
||||
break;
|
||||
case 'P':
|
||||
cx = 222 * res;
|
||||
cy = 8;
|
||||
}
|
||||
break;
|
||||
case 'F' : {
|
||||
break;
|
||||
case 'F':
|
||||
cx = res * 270;
|
||||
cy = 8;
|
||||
}
|
||||
break;
|
||||
case '\23' : {
|
||||
break;
|
||||
case '\23':
|
||||
sonoff = ! sonoff;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case '\26' : {
|
||||
break;
|
||||
case '\26':
|
||||
zuul = true;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case '\24' : { /* ^T => mode tandy */
|
||||
break;
|
||||
case '\24': // ^T => mode tandy
|
||||
funct = true;
|
||||
key = '\11';
|
||||
}
|
||||
break;
|
||||
case '\10' : { /* ^H => mode Hercule */
|
||||
break;
|
||||
case '\10': // ^H => mode Hercule
|
||||
funct = true;
|
||||
key = '\7';
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case '\1':
|
||||
case '\3':
|
||||
case '\5' : {
|
||||
case '\5':
|
||||
funct = true;
|
||||
key = in1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
pos_mouse(cx, cy);
|
||||
setMousePos(cx, cy);
|
||||
p_key = keypressed();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,14 +38,14 @@ extern int m_show,
|
|||
p_o_s,
|
||||
mouse_shwn;
|
||||
|
||||
void init_mouse();
|
||||
void initMouse();
|
||||
//extern void change_mouse(int t);
|
||||
//extern void dessine_souris(int xf, int yf);
|
||||
extern void hide_mouse();
|
||||
extern void show_mouse();
|
||||
extern void pos_mouse(int x, int y);
|
||||
extern void read_pos_mouse(int &x, int &y, int &c);
|
||||
extern void mov_mouse(bool &funct, char &key);
|
||||
extern void hideMouse();
|
||||
extern void showMouse();
|
||||
extern void setMousePos(int x, int y);
|
||||
extern void getMousePos(int &x, int &y, int &c);
|
||||
extern void moveMouse(bool &funct, char &key);
|
||||
|
||||
} // End of namespace Mortevielle
|
||||
#endif
|
||||
|
|
|
@ -39,11 +39,11 @@
|
|||
namespace Mortevielle {
|
||||
|
||||
void change_gd(int ngd) {
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
gd = ngd;
|
||||
hirs();
|
||||
init_mouse();
|
||||
show_mouse();
|
||||
initMouse();
|
||||
showMouse();
|
||||
dessine_rouleau();
|
||||
tinke();
|
||||
pendule();
|
||||
|
@ -67,7 +67,7 @@ void MortevielleEngine::gameLoaded() {
|
|||
char g[8];
|
||||
|
||||
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
imen = false;
|
||||
g[1] = 'M';
|
||||
_loseGame = true;
|
||||
|
@ -131,7 +131,7 @@ void MortevielleEngine::gameLoaded() {
|
|||
modinv();
|
||||
if (s.derobj != 0) modobj2(s.derobj + 400, test[1], test[2]);
|
||||
else tesok = test[1] || test[2];
|
||||
show_mouse();
|
||||
showMouse();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ void SavegameManager::takesav(int n) {
|
|||
* Load a saved game
|
||||
*/
|
||||
Common::Error SavegameManager::loadGame(int n) {
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
maivid();
|
||||
takesav(n);
|
||||
|
||||
|
@ -126,7 +126,7 @@ Common::Error SavegameManager::loadGame(int n) {
|
|||
theure();
|
||||
dprog();
|
||||
g_vm->gameLoaded();
|
||||
show_mouse();
|
||||
showMouse();
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
|
|||
Common::OutSaveFile *f;
|
||||
int i;
|
||||
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
tmaj3();
|
||||
|
||||
for (i = 0; i <= 389; i ++)
|
||||
|
@ -165,7 +165,7 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
|
|||
delete f;
|
||||
|
||||
dem2();
|
||||
show_mouse();
|
||||
showMouse();
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ void chardes(Common::String filename, int32 skipSize, int length) {
|
|||
if (!f.open(filename))
|
||||
error("Missing file %s", filename.c_str());
|
||||
|
||||
testfi();
|
||||
int skipBlock = 0;
|
||||
while (skipSize > 127) {
|
||||
++skipBlock;
|
||||
|
@ -66,11 +65,9 @@ void chardes(Common::String filename, int32 skipSize, int length) {
|
|||
|
||||
void charani(Common::String filename, int32 skipSize, int length) {
|
||||
Common::File f;
|
||||
|
||||
if (!f.open(filename))
|
||||
error("Missing file - %s", filename.c_str());
|
||||
|
||||
testfi();
|
||||
int skipBlock = 0;
|
||||
while (skipSize > 127) {
|
||||
skipSize = skipSize - 128;
|
||||
|
@ -153,23 +150,29 @@ void taffich() {
|
|||
}
|
||||
|
||||
okdes = true;
|
||||
hide_mouse();
|
||||
hideMouse();
|
||||
lgt = 0;
|
||||
Common::String filename;
|
||||
|
||||
if ((a != 50) && (a != 51)) {
|
||||
m = a + 2000;
|
||||
if ((m > 2001) && (m < 2010)) m = 2001;
|
||||
if (m == 2011) m = 2010;
|
||||
if (a == 32) m = 2034;
|
||||
if ((a == 17) && (_maff == 14)) m = 2018;
|
||||
if ((m > 2001) && (m < 2010))
|
||||
m = 2001;
|
||||
if (m == 2011)
|
||||
m = 2010;
|
||||
if (a == 32)
|
||||
m = 2034;
|
||||
if ((a == 17) && (_maff == 14))
|
||||
m = 2018;
|
||||
if (a > 99)
|
||||
if ((is == 1) || (is == 0)) m = 2031;
|
||||
else m = 2032;
|
||||
if (((a > 69) && (a < 80)) || (a == 30) || (a == 31) || (a == 144)
|
||||
|| (a == 147) || (a == 149)) m = 2030;
|
||||
if (((a < 27) && (((_maff > 69) && (! s.ipre)) || (_maff > 99)))
|
||||
|| ((_maff > 29) && (_maff < 33))) m = 2033;
|
||||
if ((is == 1) || (is == 0))
|
||||
m = 2031;
|
||||
else
|
||||
m = 2032;
|
||||
if (((a > 69) && (a < 80)) || (a == 30) || (a == 31) || (a == 144) || (a == 147) || (a == 149))
|
||||
m = 2030;
|
||||
if (((a < 27) && (((_maff > 69) && (! s.ipre)) || (_maff > 99))) || ((_maff > 29) && (_maff < 33)))
|
||||
m = 2033;
|
||||
messint(m);
|
||||
_maff = a;
|
||||
if (a == 159)
|
||||
|
@ -224,10 +227,14 @@ void taffich() {
|
|||
if ((b < 15) || (b == 16) || (b == 17) || (b == 24) || (b == 26) || (b == 50)) {
|
||||
lgt = 0;
|
||||
if ((b < 15) || (b == 16) || (b == 17) || (b == 24) || (b == 26)) {
|
||||
if (b == 26) b = 18;
|
||||
else if (b == 24) b = 17;
|
||||
else if (b > 15) b = b - 1;
|
||||
for (cx = 0; cx <= (b - 1); cx ++) lgt = lgt + l[cx + 89];
|
||||
if (b == 26)
|
||||
b = 18;
|
||||
else if (b == 24)
|
||||
b = 17;
|
||||
else if (b > 15)
|
||||
b = b - 1;
|
||||
for (cx = 0; cx <= (b - 1); cx ++)
|
||||
lgt = lgt + l[cx + 89];
|
||||
handle = l[b + 89];
|
||||
filename = "AXX.mor";
|
||||
} else if (b == 50) {
|
||||
|
@ -236,10 +243,12 @@ void taffich() {
|
|||
}
|
||||
charani(filename, lgt, handle);
|
||||
}
|
||||
show_mouse();
|
||||
showMouse();
|
||||
if ((a < 27) && ((_maff < 27) || (s.mlieu == 15)) && (msg[4] != entrer)) {
|
||||
if ((a == 13) || (a == 14)) person();
|
||||
else if (! blo) t11(s.mlieu, cx);
|
||||
if ((a == 13) || (a == 14))
|
||||
person();
|
||||
else if (! blo)
|
||||
t11(s.mlieu, cx);
|
||||
mpers = 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue