Skip to content

Commit

Permalink
MORTEVIELLE: Added stubs for remaining functions needed by the project
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster authored and Strangerke committed Apr 6, 2012
1 parent c6fb8d6 commit 03e7aec
Show file tree
Hide file tree
Showing 14 changed files with 192 additions and 151 deletions.
13 changes: 8 additions & 5 deletions engines/mortevielle/alert.cpp
Expand Up @@ -133,20 +133,23 @@ static void fait_choix(Common::String c, int &coldep, int &nbcase, Common::Strin
}

int do_alert(Common::String str_, int n) {
int coldep, esp, i, l, nbcase, quoi, ix;
int coldep, esp, i, nbcase, quoi, ix;
Common::String st, chaine;
int limit[3][3];
char c, dumi;
char dumi;
Common::String s[3];
int cx, cy, cd, nbcol, nblig;
bool touch, newaff, test, test1, test2, test3, dum;
int cx, cy, nbcol, nblig;
bool newaff, test, test1, test2, test3, dum;
Common::String cas;


/*debug('** do_alert **');*/
memset(&limit[0][0], 0, sizeof(int) * 3 * 3);
int do_alert_result;
hide_mouse();
while (keypressed()) input >> kbd >> dumi;
while (keypressed())
dumi = get_ch(); // input >> kbd >> dumi;

clic = false;
decod(str_, nbcase, nblig, nbcol, chaine, cas);
sauvecr(50, succ(int, nligne) << 4);
Expand Down
6 changes: 3 additions & 3 deletions engines/mortevielle/keyboard.cpp
Expand Up @@ -34,7 +34,7 @@ char readkey1() {
char c;

char readkey1_result;
input >> kbd >> c;
c = get_ch(); // input >> kbd >> c;
readkey1_result = c;
return readkey1_result;
}
Expand All @@ -43,7 +43,7 @@ int testou() {
char ch;

int testou_result;
input >> kbd >> ch;
ch = get_ch(); // input >> kbd >> ch;
switch (ch) {
case '\23' :
sonoff = ! sonoff;
Expand Down Expand Up @@ -77,7 +77,7 @@ int testou() {
}
break;
case '\33' :
if (keypressed()) input >> kbd >> ch;
if (keypressed()) ch = get_ch(); // input >> kbd >> ch;
break;
}
testou_result = ord(ch);
Expand Down
31 changes: 10 additions & 21 deletions engines/mortevielle/mor.cpp
Expand Up @@ -150,7 +150,7 @@ void ecrf1() {
}

void clsf1() {
int i, j;
// int i, j;

/* debug('clsf1'); */
hide_mouse();
Expand Down Expand Up @@ -198,7 +198,7 @@ void clsf1() {
}

void clsf2() {
int i, j;
// int i, j;

/* debug('clsf2'); */
hide_mouse();
Expand Down Expand Up @@ -247,7 +247,7 @@ void ecr2(Common::String str_) {
}

void clsf3() {
int i, j;
// int i, j;

/* debug('clsf3'); */
hide_mouse();
Expand Down Expand Up @@ -323,15 +323,8 @@ void paint_rect(int x, int y, int dx, int dy) {
}

int hazard(int min, int max) {
int ha1;
float ha2;

/* debug('hazard'); */
int hazard_result;
ha2 = Random();
ha1 = abs((int)(ha2 * (max - min)));
hazard_result = min + ha1;
return hazard_result;
return get_random_number(min, max);
}

void calch(int &j, int &h, int &m) {
Expand Down Expand Up @@ -370,7 +363,7 @@ void okpas() {
void modobj(int m) {
char str_[1410];
Common::String strp;
int i, tay;
int tay;

/* debug('modobj'); */
strp = ' ';
Expand All @@ -385,7 +378,7 @@ void modobj(int m) {
void modobj2(int m, bool t1, bool t2) {
char str_[1410];
Common::String strp;
int i, tay;
int tay;

/* debug('modobj'); */
strp = ' ';
Expand Down Expand Up @@ -541,7 +534,6 @@ void affper(int per) {
/* overlay */ void choix(int min, int max, int &per) {
bool i;
int haz, cx, cy, cz;
float per2, cz2;

/* debug('o0 choix'); */
haz = hazard(min, max);
Expand Down Expand Up @@ -793,16 +785,14 @@ void debloc(int l) {
}

/* overlay */ void quelq6(int l) {
int per;

/* debug('o1 quelq6'); */
if (l == 6) bh6 = true;
if (l == 8) bh8 = true;
ipers = 10;
}

/* overlay */ void quelq10(int h, int &per) {
int min, max;
int min = 0, max = 0;

/* debug('o1 quelq10'); */
if ((h >= 0) && (h < 8)) chlm(per);
Expand All @@ -829,7 +819,7 @@ void debloc(int l) {
}

/* overlay */ void quelq11(int h, int &per) {
int min, max;
int min = 0, max = 0;

/* debug('o1 quelq11'); */
if ((h >= 0) && (h < 8)) chlm(per);
Expand Down Expand Up @@ -882,7 +872,7 @@ void debloc(int l) {
}

/* overlay */ void quelq20(int h, int &per) {
int min, max;
int min = 0, max = 0;

/* debug('o1 quelq20'); */
if (((h >= 0) && (h < 10)) || ((h > 18) && (h < 24))) chlm(per);
Expand Down Expand Up @@ -1175,7 +1165,7 @@ void phaz(int &haz, int &p, int cf) {
}

/* overlay */ void t11(int l11, int &a) {
int p, haz, h;
int p, haz, h = 0;

/* debug('o2 t11'); */
ecfren(p, haz, s.conf, l11);
Expand Down Expand Up @@ -1254,7 +1244,6 @@ void messint(int nu) {

void aniof(int ouf, int num) {
int ad, offset;
char c;

/* debug('aniof'); */
if ((caff == 7) && ((num == 4) || (num == 5))) return;
Expand Down
8 changes: 4 additions & 4 deletions engines/mortevielle/mor2.cpp
Expand Up @@ -206,7 +206,7 @@ void tkey1(bool d) {
}

void tmlieu(int mli) {
int cx, j, i, tail;
int cx, i, tail;
Common::String nomp;
char st[1410];

Expand Down Expand Up @@ -354,7 +354,7 @@ void st1sama() {
}

void modinv() {
int cx, cy, tay, i, r;
int cx, cy, tay, r;
char nom[1410];
Common::String nomp;

Expand All @@ -377,7 +377,7 @@ void modinv() {

void sparl(float adr, float rep) {
const int haut[9] = { 0, 0, 1, -3, 6, -2, 2, 7, -1 };
int key, ad, tay, repint;
int key, tay, repint;
char st[1410];

repint = abs((int)rep);
Expand Down Expand Up @@ -615,7 +615,7 @@ void tsuiv() {
void tfleche() {
bool qust;
char touch;
int dummy, cd, xmo, ymo;
int dummy;

if (num == 9999) return;
fenat(chr(152));
Expand Down
75 changes: 38 additions & 37 deletions engines/mortevielle/mouse.cpp
Expand Up @@ -332,7 +332,7 @@ void mov_mouse(bool &funct, char &key) {
key = '\377';
p_key = keypressed();
while (p_key) {
input >> kbd >> in1;
in1 = get_ch(); // input >> kbd >> in1;
read_pos_mouse(cx, cy, cd);
switch (toupper(in1)) {
case '4' :
Expand Down Expand Up @@ -381,48 +381,49 @@ void mov_mouse(bool &funct, char &key) {
case '\33' : {
p_key = keypressed();

if ((in2 >= ';') && (in2 <= 'D')) {
funct = true;
key = in2;
return;
}

if (p_key) {
input >> kbd >> in2;
switch (in2) {
case 'K' :
cx = pred(int, cx);
in2 = get_ch(); // input >> kbd >> in2;

if ((in2 >= ';') && (in2 <= 'D')) {
funct = true;
key = in2;
return;
} else {
switch (in2) {
case 'K' :
cx = pred(int, cx);
break;
case 'P' :
cy = succ(int, cy);
break;
case 'M' :
cx = cx + 2;
break;
case 'H' :
cy = pred(int, cy);
break;
case 'G' : {
cx = cx - 1;
cy = cy - 1;
}
break;
case 'P' :
cy = succ(int, cy);
case 'I' : {
cx = cx + 1;
cy = cy - 1;
}
break;
case 'M' :
cx = cx + 2;
case 'O' : {
cx = cx - 1;
cy = cy + 1;
}
break;
case 'H' :
cy = pred(int, cy);
case 'Q' : {
cx = cx + 1;
cy = cy + 1;
}
break;
case 'G' : {
cx = cx - 1;
cy = cy - 1;
}
break;
case 'I' : {
cx = cx + 1;
cy = cy - 1;
}
break;
case 'O' : {
cx = cx - 1;
cy = cy + 1;
}
break;
case 'Q' : {
cx = cx + 1;
cy = cy + 1;
} /* case */
}
break;
} /* case */
}
}
break;
Expand Down
3 changes: 1 addition & 2 deletions engines/mortevielle/outtext.cpp
Expand Up @@ -162,12 +162,11 @@ static int l_motsuiv(int p, char *ch, int &tab) {

void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
bool the_end;
char touch;
int xf, yf;
int xc, yc;
int tab, p;
Common::String s;
int i, j, nt;
int i, j;


/* debug(' .. Afftex');*/
Expand Down

0 comments on commit 03e7aec

Please sign in to comment.