Skip to content

Commit

Permalink
MORTEVIELLE: Lots of compilation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster authored and Strangerke committed Apr 6, 2012
1 parent 5483930 commit c6fb8d6
Show file tree
Hide file tree
Showing 19 changed files with 180 additions and 95 deletions.
8 changes: 5 additions & 3 deletions engines/mortevielle/actions.cpp
Expand Up @@ -29,12 +29,14 @@
#include "mortevielle/actions.h"
#include "mortevielle/alert.h"
#include "mortevielle/level15.h"
#include "mortevielle/menu.h"
#include "mortevielle/mor.h"
#include "mortevielle/mor2.h"
#include "mortevielle/mouse.h"
#include "mortevielle/outtext.h"
#include "mortevielle/ques.h"
#include "mortevielle/parole2.h"
#include "mortevielle/taffich.h"
#include "mortevielle/var_mor.h"

namespace Mortevielle {
Expand Down Expand Up @@ -827,7 +829,7 @@ void taller() {
}

/* overlay */ void tentrer() {
int x, z;
int x, z = 0;

if ((s.mlieu == 21) || (s.mlieu == 22)) {
t1sama();
Expand Down Expand Up @@ -931,7 +933,7 @@ void taller() {
}

/* overlay */ void tsortir() {
int lx;
int lx = 0;

tsort();
crep = 0;
Expand Down Expand Up @@ -1055,7 +1057,7 @@ void taller() {
x = x * (3 - res);
if (x > 319) cx = 41;
else cx = 1;
cy = succ(int, (uint)y >> 3); /* 0-199 => 1-25 */
cy = succ(int, ((uint)y >> 3)); /* 0-199 => 1-25 */
if ((cy > 23) || ((cx == 41) && ((cy >= 20) && (cy <= 22)))) {
if (choi != 0) {
lig = ((choi - 1) % 23) << 3;
Expand Down
4 changes: 2 additions & 2 deletions engines/mortevielle/alert.cpp
Expand Up @@ -106,7 +106,7 @@ static void fait_boite(int lidep, int nli, int tx) {



static void fait_choix(Common::String c, int &coldep, int &nbcase, Common::String[3] &str, int &esp) {
static void fait_choix(Common::String c, int &coldep, int &nbcase, Common::String *str, int &esp) {
int i, l, x;
char ch;

Expand Down Expand Up @@ -176,7 +176,7 @@ int do_alert(Common::String str_, int n) {
if (nbcase == 1) esp = nbcol - 40;
else esp = (uint)(nbcol - nbcase * 40) >> 1;
coldep = 320 - ((uint)nbcol >> 1) + ((uint)esp >> 1);
fait_choix(cas, coldep, nbcase, s, esp);
fait_choix(cas, coldep, nbcase, &s[0], esp);
limit[1][1] = ((uint)(coldep) >> 1) * res;
limit[1][2] = limit[1][1] + 40;
if (nbcase == 1) {
Expand Down
15 changes: 9 additions & 6 deletions engines/mortevielle/disk.cpp
Expand Up @@ -30,9 +30,12 @@
#include "common/savefile.h"
#include "common/serializer.h"
#include "mortevielle/alert.h"
#include "mortevielle/ovd1.h"
#include "mortevielle/disk.h"
#include "mortevielle/mor.h"
#include "mortevielle/mor2.h"
#include "mortevielle/mouse.h"
#include "mortevielle/ovd1.h"
#include "mortevielle/prog.h"
#include "mortevielle/var_mor.h"

namespace Mortevielle {
Expand All @@ -41,9 +44,9 @@ namespace Mortevielle {
* Ensure disk 1 data is available
*/
void dem1() {
/* Deprecated in ScummVM
int k;
/* Deprecated in ScummVM
// -- demande de disk 1 --
assign(f, "mort.005");
//*$i-*
Expand Down Expand Up @@ -83,13 +86,13 @@ void takesav(int n) {

dem1();
// -- Load the file 'sauve#n.mor'
Common::String saveName = Common::String::format("sav%d.mor", n);
Common::InSaveFile *f = g_system->getSaveManager().openForLoading(st);
Common::String saveName = Common::String::format("sav%d.mor", n);
Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading(saveName);

Common::Serializer sz(f, NULL);
sync_save(sz);

if (f.err()) {
if (f->err()) {
i = do_alert(err_mess, 1);
mortevielle_exit(0);
}
Expand Down Expand Up @@ -125,7 +128,7 @@ void sv_game(int n) {
if (s1.mlieu == 26) s1.mlieu = 15;

Common::String saveName = Common::String::format("sav%d.mor", n);
f = g_system->getSaveFileManager().openForSaving(saveName);
f = g_system->getSavefileManager()->openForSaving(saveName);

Common::Serializer sz(NULL, f);
sync_save(sz);
Expand Down
4 changes: 2 additions & 2 deletions engines/mortevielle/droite.cpp
Expand Up @@ -47,7 +47,7 @@ void droite(int x, int y, int xx, int yy, int coul) {
if (y > yy) step = -1;
else step = 1;
do {
putpix(gd, trunc(a * i + b), i, coul);
putpix(gd, abs((int)(a * i + b)), i, coul);
i = i + step;
} while (!(i == yy));
/*writeln(le_file,'X == ',a:3:3,' * Y + ',b:3:3);*/
Expand All @@ -58,7 +58,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, trunc(a * i + b), coul);
putpix(gd, i, abs((int)(a * i + b)), coul);
i = i + step;
} while (!(i == xx));
/*writeln(le_file,'Y == ',a:3:3,' * X + ',b:3:3);*/
Expand Down
9 changes: 5 additions & 4 deletions engines/mortevielle/level15.cpp
Expand Up @@ -86,7 +86,8 @@ void writepal(int n) {
}
break;
case cga : {
pal = palcga[n].a;
warning("TODO: If this code is needed, resolve the incompatible types");
// pal = palcga[n].a;
if (n < 89) palette(palcga[n].p);
for (i = 0; i <= 15; i ++) outbloc(i, tpt[pal[i].n], pal);
}
Expand Down Expand Up @@ -152,8 +153,8 @@ end;
void adzon() {
Common::File f;
// Common::File g;
byte a;
int i;
// byte a;
// int i;

if (!f.open("don.mor"))
error("Missing file - don.mor");
Expand All @@ -173,7 +174,7 @@ void adzon() {

if (!f.open("dec.mor"))
error("Missing files - dec.moir");
f.read(mem[0x73a2 + 0], 1);
f.read(&mem[0x73a2 + 0], 1);
/*i:=0;
repeat
read(g,a);
Expand Down
4 changes: 2 additions & 2 deletions engines/mortevielle/mor.cpp
Expand Up @@ -329,7 +329,7 @@ int hazard(int min, int max) {
/* debug('hazard'); */
int hazard_result;
ha2 = Random();
ha1 = trunc(ha2 * (max - min));
ha1 = abs((int)(ha2 * (max - min)));
hazard_result = min + ha1;
return hazard_result;
}
Expand Down Expand Up @@ -404,7 +404,7 @@ void repon(int f, int m) {
Common::String str_;
Common::String str1;
char st[1410];
text1 fic;
// text1 fic;
int i, xco, dx, caspe, tay;

/* debug('repon fenetre nø'+chr(f+48));*/
Expand Down
4 changes: 2 additions & 2 deletions engines/mortevielle/mor2.cpp
Expand Up @@ -53,7 +53,7 @@ void tinke() {
const char d4 = ']';
const char d5 = '1';
const char d6[] = "OK";
int cx, cy, haz, nh, cf, j, h, m, cd;
int cx, haz, nh, cf, j, h, m;
Common::String stpo;
bool am;

Expand Down Expand Up @@ -380,7 +380,7 @@ void sparl(float adr, float rep) {
int key, ad, tay, repint;
char st[1410];

repint = trunc(rep);
repint = abs((int)rep);
hide_mouse();
deline(repint + c_paroles, st, tay);
afftex(st, 230, 4, 65, 24, 5);
Expand Down
2 changes: 1 addition & 1 deletion engines/mortevielle/mort.cpp
Expand Up @@ -69,7 +69,7 @@ void divers(int np, bool b) {
int main(int argc, const char *argv[]) {
/*init_debug;*/
/* ecri_seg;*/
pio_initialize(argc, argv);
//pio_initialize(argc, argv);
gd = cga;
newgd = gd;
zuul = false;
Expand Down
10 changes: 4 additions & 6 deletions engines/mortevielle/mouse.cpp
Expand Up @@ -46,7 +46,7 @@ int s_s[12][6];


void init_mouse() {
int i, j;
// int i, j;
registres reg;

mouse_shwn = 0;
Expand Down Expand Up @@ -88,7 +88,7 @@ begin
end; */

void hide_mouse() {
int i, j, k, ps, ds;
int i, j, k, ps;;
bool imp;

mouse_shwn = pred(int, mouse_shwn);
Expand Down Expand Up @@ -176,10 +176,8 @@ void hide_mouse() {
}

void show_mouse() {
int i, j, k, l,
ps, ds;
int i, j, k, l;
bool imp;
char c;

mouse_shwn = mouse_shwn + 1;
if (mouse_shwn != 1) return;
Expand Down Expand Up @@ -383,7 +381,7 @@ void mov_mouse(bool &funct, char &key) {
case '\33' : {
p_key = keypressed();

if ((p_key >= ';') && (p_key <= 'D')) {
if ((in2 >= ';') && (in2 <= 'D')) {
funct = true;
key = in2;
return;
Expand Down
2 changes: 1 addition & 1 deletion engines/mortevielle/mouse.h
Expand Up @@ -30,7 +30,7 @@

namespace Mortevielle {

extern bool clic;
extern bool clic, int_m;

extern int m_show,
x_s,
Expand Down
16 changes: 9 additions & 7 deletions engines/mortevielle/outtext.cpp
Expand Up @@ -62,24 +62,26 @@ const byte tab31[32]= {
void deline(int num , char *l , int &tl);
typedef unsigned char uchar;

static void cinq_huit(char &c, int &ind, byte &pt, bool &the_end) {
static void cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
/*
const uchar rap[32] = {
(uchar)',', (uchar)':', (uchar)'@', (uchar)'!', (uchar)'?', (uchar)'-', (uchar)'\207',
(uchar)'\240', (uchar)'\205', (uchar)'\203', (uchar)'\202', (uchar)'\212', (uchar)'\210', (uchar)'/',
(uchar)'\213', (uchar)'\214', (uchar)'\242', (uchar)'\047', (uchar)'\223', (uchar)'"', (uchar)'\227',
(uchar)'\226', (uchar)'0', (uchar)'1', (uchar)'2', (uchar)'3', (uchar)'4', (uchar)'5',
(uchar)'6', (uchar)'7', (uchar)'8', (uchar)'9'
};
*/
int oct, ocd;

/* 5-8 */
oct = t_mot[ind];
oct = t_mot[idx];
oct = (uint)(oct << (16 - pt)) >> (16 - pt);
if (pt < 6) {
ind = ind + 1;
idx = idx + 1;
oct = oct << (5 - pt);
pt = pt + 11;
oct = oct | ((uint)t_mot[ind] >> pt);
oct = oct | ((uint)t_mot[idx] >> pt);
} else {
pt = pt - 5;
oct = (uint)oct >> pt;
Expand All @@ -93,13 +95,13 @@ static void cinq_huit(char &c, int &ind, byte &pt, bool &the_end) {
break;
case 30:
case 31 : {
ocd = t_mot[ind];
ocd = t_mot[idx];
ocd = (uint)(ocd << (16 - pt)) >> (16 - pt);
if (pt < 6) {
ind = ind + 1;
idx = idx + 1;
ocd = ocd << (5 - pt);
pt = pt + 11;
ocd = ocd | ((uint)t_mot[ind] >> pt);
ocd = ocd | ((uint)t_mot[idx] >> pt);
} else {
pt = pt - 5;
ocd = (uint)ocd >> pt;
Expand Down

0 comments on commit c6fb8d6

Please sign in to comment.