aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/cruise/actor.cpp23
-rw-r--r--engines/cruise/actor.h4
-rw-r--r--engines/cruise/background.h2
-rw-r--r--engines/cruise/backgroundIncrust.h2
-rw-r--r--engines/cruise/ctp.h4
-rw-r--r--engines/cruise/dataLoader.cpp2
-rw-r--r--engines/cruise/gfxModule.h3
-rw-r--r--engines/cruise/mainDraw.cpp2
-rw-r--r--engines/cruise/menu.h2
-rw-r--r--engines/cruise/object.h4
-rw-r--r--engines/cruise/overlay.h20
-rw-r--r--engines/cruise/perso.cpp4
-rw-r--r--engines/cruise/perso.h9
-rw-r--r--engines/cruise/script.h4
-rw-r--r--engines/cruise/stack.h4
-rw-r--r--engines/cruise/vars.h24
16 files changed, 18 insertions, 95 deletions
diff --git a/engines/cruise/actor.cpp b/engines/cruise/actor.cpp
index 3d8e856d49..3b430fae1a 100644
--- a/engines/cruise/actor.cpp
+++ b/engines/cruise/actor.cpp
@@ -581,7 +581,7 @@ void valide_noeud(int16 table[], int16 p, int *nclick, int16 solution0[20 + 3][2
}
//computePathfinding(returnVar2, params.X, params.Y, var34, var35, currentActor->stepX, currentActor->stepY);
-int16 computePathfinding(int16 *pSolution, int16 _X, int16 _Y, int16 destX,
+int16 computePathfinding(int16 *pSolution, int16 x, int16 y, int16 destX,
int16 destY, int16 stepX, int16 stepY, int16 oldPathId) {
persoStruct *perso;
int num;
@@ -603,14 +603,13 @@ int16 computePathfinding(int16 *pSolution, int16 _X, int16 _Y, int16 destX,
int i;
int16 *ptr;
- for (i = 0; i < 10; i++) // 10 = num perso
- {
+ for (i = 0; i < NUM_PERSONS; i++) { // 10 = num perso
if (!persoTable[i]) {
break;
}
}
- if (i == 10) {
+ if (i == NUM_PERSONS) {
pSolution[0] = -1;
pSolution[1] = -1;
@@ -625,8 +624,8 @@ int16 computePathfinding(int16 *pSolution, int16 _X, int16 _Y, int16 destX,
perso->inc_jo1 = stepX;
perso->inc_jo2 = stepY;
- *(ptr++) = _X;
- *(ptr++) = _Y;
+ *(ptr++) = x;
+ *(ptr++) = y;
*(ptr++) = pSolution[0] = destX;
*(ptr++) = pSolution[1] = destY;
*(ptr++) = -1;
@@ -643,7 +642,7 @@ int16 computePathfinding(int16 *pSolution, int16 _X, int16 _Y, int16 destX,
ctpVar19 = ctpVar11;
flag_aff_chemin = 0;
- if (_X == destX && _Y == destY) {
+ if (x == destX && y == destY) {
pSolution[0] = -1;
pSolution[1] = -1;
@@ -652,12 +651,12 @@ int16 computePathfinding(int16 *pSolution, int16 _X, int16 _Y, int16 destX,
/******* cherche le premier noeud ******/
- getPixel(_X, _Y);
+ getPixel(x, y);
pSolution[4] = computedVar14;
- x_mouse = _X;
- y_mouse = _Y;
+ x_mouse = x;
+ y_mouse = y;
if (!flag_obstacle
|| (point_select = point_proche(ctp_routeCoords)) == -1) {
@@ -674,10 +673,10 @@ int16 computePathfinding(int16 *pSolution, int16 _X, int16 _Y, int16 destX,
/******* cherche le deuxieme noeud ******/
num = 0;
- while (num < 10 && persoTable[num] != NULL)
+ while (num < NUM_PERSONS && persoTable[num] != NULL)
num++;
- if (num == 10) {
+ if (num == NUM_PERSONS) {
pSolution[0] = -1;
pSolution[1] = -1;
return (-1);
diff --git a/engines/cruise/actor.h b/engines/cruise/actor.h
index 8df405f32e..0485fcc003 100644
--- a/engines/cruise/actor.h
+++ b/engines/cruise/actor.h
@@ -35,8 +35,6 @@ enum animPhase {
ANIM_PHASE_END = 4
};
-typedef enum animPhase animPhase;
-
struct actorStruct {
struct actorStruct *next;
struct actorStruct *prev;
@@ -62,8 +60,6 @@ struct actorStruct {
int16 freeze;
};
-typedef struct actorStruct actorStruct;
-
extern int raoul_move[][13];
extern int raoul_end[][13];
extern int raoul_stat[][13];
diff --git a/engines/cruise/background.h b/engines/cruise/background.h
index c5299b2b16..07364a947f 100644
--- a/engines/cruise/background.h
+++ b/engines/cruise/background.h
@@ -32,8 +32,6 @@ struct backgroundTableStruct {
char extention[6];
};
-typedef struct backgroundTableStruct backgroundTableStruct;
-
extern short int cvtPalette[0x20];
extern int CVTLoaded;
extern uint8 *backgroundPtrtable[8];
diff --git a/engines/cruise/backgroundIncrust.h b/engines/cruise/backgroundIncrust.h
index c1e20609fd..abbe837ad7 100644
--- a/engines/cruise/backgroundIncrust.h
+++ b/engines/cruise/backgroundIncrust.h
@@ -50,8 +50,6 @@ struct backgroundIncrustStruct {
uint16 var34;
};
-typedef struct backgroundIncrustStruct backgroundIncrustStruct;
-
extern backgroundIncrustStruct backgroundIncrustHead;
void resetBackgroundIncrustList(backgroundIncrustStruct * pHead);
diff --git a/engines/cruise/ctp.h b/engines/cruise/ctp.h
index dcde2cced8..f6a31d387d 100644
--- a/engines/cruise/ctp.h
+++ b/engines/cruise/ctp.h
@@ -36,15 +36,11 @@ struct ctpVar19SubStruct {
uint16 maxY; //A
};
-typedef struct ctpVar19SubStruct ctpVar19SubStruct;
-
struct ctpVar19Struct {
struct ctpVar19Struct *field_0; //0
ctpVar19SubStruct subStruct;
};
-typedef struct ctpVar19Struct ctpVar19Struct;
-
extern ctpVar19Struct *ptr_something;
extern ctpVar19Struct *polyStruct;
extern ctpVar19Struct *ctpVar11;
diff --git a/engines/cruise/dataLoader.cpp b/engines/cruise/dataLoader.cpp
index 285279b437..92d830418c 100644
--- a/engines/cruise/dataLoader.cpp
+++ b/engines/cruise/dataLoader.cpp
@@ -37,8 +37,6 @@ enum fileTypeEnum {
type_FNT
};
-typedef enum fileTypeEnum fileTypeEnum;
-
int loadSingleFile;
// TODO: Unify decodeGfxFormat1, decodeGfxFormat4 and decodeGfxFormat5
diff --git a/engines/cruise/gfxModule.h b/engines/cruise/gfxModule.h
index 86521d5641..46b8ee4c37 100644
--- a/engines/cruise/gfxModule.h
+++ b/engines/cruise/gfxModule.h
@@ -44,9 +44,6 @@ struct palEntry {
uint8 A;
};
-typedef struct gfxModuleDataStruct gfxModuleDataStruct;
-typedef struct palEntry palEntry;
-
extern gfxModuleDataStruct gfxModuleData;
extern short globalAtariScreen[320 * 200 / 4];
diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp
index c1a52814df..8210f6d404 100644
--- a/engines/cruise/mainDraw.cpp
+++ b/engines/cruise/mainDraw.cpp
@@ -38,8 +38,6 @@ struct autoCellStruct {
cellStruct *pCell;
};
-typedef struct autoCellStruct autoCellStruct;
-
autoCellStruct autoCellHead;
void addAutoCell(int overlayIdx, int idx, int type, int newVal, cellStruct *pObject) {
diff --git a/engines/cruise/menu.h b/engines/cruise/menu.h
index 9fb477556c..cf4941c96b 100644
--- a/engines/cruise/menu.h
+++ b/engines/cruise/menu.h
@@ -36,8 +36,6 @@ struct menuStruct {
menuElementStruct *ptrNextElement;
};
-typedef struct menuStruct menuStruct;
-
extern menuStruct *menuTable[8];
menuStruct *createMenu(int X, int Y, const char *menuName);
diff --git a/engines/cruise/object.h b/engines/cruise/object.h
index e946d22c66..439cdcf3a2 100644
--- a/engines/cruise/object.h
+++ b/engines/cruise/object.h
@@ -35,8 +35,6 @@ struct gfxEntryStruct {
int width; // for font: max right border; for sprite: just width
};
-typedef struct gfxEntryStruct gfxEntryStruct;
-
#define OBJ_SPRITE 4
struct objectParamsQuery {
@@ -50,8 +48,6 @@ struct objectParamsQuery {
int16 var7;
};
-typedef struct objectParamsQuery objectParamsQuery;
-
objDataStruct *getObjectDataFromOverlay(int ovlIdx, int objIdx);
int16 getSingleObjectParam(int16 overlayIdx, int16 param2, int16 param3, int16 * returnParam);
int16 getMultipleObjectParam(int16 overlayIdx, int16 objectIdx, objectParamsQuery * returnParam);
diff --git a/engines/cruise/overlay.h b/engines/cruise/overlay.h
index 1f61087892..07f814701c 100644
--- a/engines/cruise/overlay.h
+++ b/engines/cruise/overlay.h
@@ -35,8 +35,6 @@ struct importScriptStruct {
uint16 offsetToName;
};
-typedef struct importScriptStruct importScriptStruct;
-
struct exportEntryStruct {
uint16 var0;
uint16 var2;
@@ -45,8 +43,6 @@ struct exportEntryStruct {
uint16 offsetToName;
};
-typedef struct exportEntryStruct exportEntryStruct;
-
struct ovlData3Struct {
uint8 *dataPtr; //0
short int sizeOfData; //4
@@ -63,16 +59,12 @@ struct ovlData3Struct {
short int var1A;
};
-typedef struct ovlData3Struct ovlData3Struct;
-
struct stringEntryStruct {
char *string;
short int length;
short int idx;
};
-typedef struct stringEntryStruct stringEntryStruct;
-
struct linkDataStruct {
uint16 field_0;
uint16 field_2;
@@ -94,8 +86,6 @@ struct linkDataStruct {
int16 field_20;
};
-typedef struct linkDataStruct linkDataStruct;
-
struct importDataStruct {
uint16 var0; // 0
uint16 var1; // 2
@@ -104,8 +94,6 @@ struct importDataStruct {
uint16 nameOffset;
};
-typedef struct importDataStruct importDataStruct;
-
#define MULTIPLE 0
#define VARIABLE 1
#define UNIQUE 2
@@ -121,8 +109,6 @@ struct objDataStruct {
int16 stateTableIdx;
};
-typedef struct objDataStruct objDataStruct;
-
struct objectParams {
int16 X;
int16 Y;
@@ -132,8 +118,6 @@ struct objectParams {
int16 state;
};
-typedef struct objectParams objectParams;
-
struct ovlDataStruct {
ovlData3Struct *data3Table;
uint8 *ptr1;
@@ -168,8 +152,6 @@ struct ovlDataStruct {
unsigned short int scriptNumber;
};
-typedef struct ovlDataStruct ovlDataStruct;
-
struct overlayStruct {
char overlayName[14];
ovlDataStruct *ovlData;
@@ -195,8 +177,6 @@ struct overlayStruct {
short int executeScripts;
};
-typedef struct overlayStruct overlayStruct;
-
extern overlayStruct overlayTable[90];
extern int numOfLoadedOverlay;
diff --git a/engines/cruise/perso.cpp b/engines/cruise/perso.cpp
index 60867a6dec..e8f8c91743 100644
--- a/engines/cruise/perso.cpp
+++ b/engines/cruise/perso.cpp
@@ -27,7 +27,7 @@
namespace Cruise {
-persoStruct *persoTable[10];
+persoStruct *persoTable[NUM_PERSONS];
int16 computedVar14;
@@ -41,7 +41,7 @@ void freePerso(int persoIdx) {
void freeAllPerso(void) {
int i;
- for (i = 0; i < 10; i++) {
+ for (i = 0; i < NUM_PERSONS; i++) {
freePerso(i);
}
diff --git a/engines/cruise/perso.h b/engines/cruise/perso.h
index b26b85f634..5a600e2d7f 100644
--- a/engines/cruise/perso.h
+++ b/engines/cruise/perso.h
@@ -27,7 +27,10 @@
namespace Cruise {
-#define NUM_NODES 20
+enum {
+ NUM_NODES = 20,
+ NUM_PERSONS = 10
+};
struct persoStruct {
int16 inc_droite; // 2
@@ -41,9 +44,7 @@ struct persoStruct {
int16 inc_jo0; // 2
};
-typedef struct persoStruct persoStruct;
-
-extern persoStruct *persoTable[10];
+extern persoStruct *persoTable[NUM_PERSONS];
extern int16 computedVar14;
void freePerso(int persoIdx);
diff --git a/engines/cruise/script.h b/engines/cruise/script.h
index 671f8d0221..5b938b92b1 100644
--- a/engines/cruise/script.h
+++ b/engines/cruise/script.h
@@ -34,8 +34,6 @@ enum scriptTypeEnum {
scriptType_REL = 30
};
-typedef enum scriptTypeEnum scriptTypeEnum;
-
struct scriptInstanceStruct {
struct scriptInstanceStruct *nextScriptPtr;
int16 var4;
@@ -53,8 +51,6 @@ struct scriptInstanceStruct {
int16 bitMask;
};
-typedef struct scriptInstanceStruct scriptInstanceStruct;
-
extern scriptInstanceStruct relHead;
extern scriptInstanceStruct procHead;
extern scriptInstanceStruct *currentScriptPtr;
diff --git a/engines/cruise/stack.h b/engines/cruise/stack.h
index 1ddcac85da..c7635d6d1a 100644
--- a/engines/cruise/stack.h
+++ b/engines/cruise/stack.h
@@ -36,8 +36,6 @@ enum stackElementTypeEnum {
STACK_PTR
};
-typedef enum stackElementTypeEnum stackElementTypeEnum;
-
struct stackElementStruct {
stackElementTypeEnum type;
@@ -47,8 +45,6 @@ struct stackElementStruct {
} data;
};
-typedef struct stackElementStruct stackElementStruct;
-
int16 popVar(void);
void pushVar(int16 var);
diff --git a/engines/cruise/vars.h b/engines/cruise/vars.h
index 7f66ed389f..71368218ad 100644
--- a/engines/cruise/vars.h
+++ b/engines/cruise/vars.h
@@ -35,8 +35,6 @@ struct menuElementSubStruct {
int16 var4;
};
-typedef struct menuElementSubStruct menuElementSubStruct;
-
struct menuElementStruct {
struct menuElementStruct *next;
const char *string;
@@ -49,8 +47,6 @@ struct menuElementStruct {
menuElementSubStruct *ptrSub;
};
-typedef struct menuElementStruct menuElementStruct;
-
typedef int32(*opcodeTypeFunction) (void);
typedef int16(*opcodeFunction) (void);
@@ -83,28 +79,20 @@ struct mediumVarStruct {
int16 field_20;
};
-typedef struct mediumVarStruct mediumVarStruct;
-
struct filesDataStruct {
uint8 *field_0;
uint8 *field_4;
};
-typedef struct filesDataStruct filesDataStruct;
-
struct filesData2Struct {
int16 field_0;
int16 field_2;
};
-typedef struct filesData2Struct filesData2Struct;
-
struct fileName {
uint8 name[13];
};
-typedef struct fileName fileName;
-
struct setHeaderEntry {
int16 field_0; // offset ptr part 1
int16 field_2; // offset ptr part 2
@@ -116,8 +104,6 @@ struct setHeaderEntry {
int16 field_E;
};
-typedef struct setHeaderEntry setHeaderEntry;
-
struct volumeDataStruct {
char ident[10];
fileName *ptr;
@@ -125,8 +111,6 @@ struct volumeDataStruct {
int32 size;
};
-typedef struct volumeDataStruct volumeDataStruct;
-
struct fileEntry {
uint8 name[14];
int32 offset;
@@ -135,8 +119,6 @@ struct fileEntry {
int32 unk3; // unused
};
-typedef struct fileEntry fileEntry;
-
struct dataFileEntrySub {
uint8 *ptr;
int16 index; // sprite index
@@ -148,8 +130,6 @@ struct dataFileEntrySub {
int16 field_1C;
};
-typedef struct dataFileEntrySub dataFileEntrySub;
-
struct dataFileEntry {
int16 widthInColumn;
int16 width;
@@ -158,16 +138,12 @@ struct dataFileEntry {
dataFileEntrySub subData;
};
-typedef struct dataFileEntry dataFileEntry;
-
struct systemStringsStruct {
int8 param;
uint8 string[12];
uint8 bootScriptName[8];
};
-typedef struct systemStringsStruct systemStringsStruct;
-
extern filesDataStruct filesData[90];
extern filesData2Struct filesData2[90];