mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
Removed lot of unnecessary typedefs; added a NUM_PERSONS constant; renamed _X/_Y vars to avoid conflicts with system headers on various systems (see bug #1716109)
svn-id: r26798
This commit is contained in:
parent
a6095b93d9
commit
441fddf01c
@ -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);
|
||||
|
@ -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];
|
||||
|
@ -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];
|
||||
|
@ -50,8 +50,6 @@ struct backgroundIncrustStruct {
|
||||
uint16 var34;
|
||||
};
|
||||
|
||||
typedef struct backgroundIncrustStruct backgroundIncrustStruct;
|
||||
|
||||
extern backgroundIncrustStruct backgroundIncrustHead;
|
||||
|
||||
void resetBackgroundIncrustList(backgroundIncrustStruct * pHead);
|
||||
|
@ -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;
|
||||
|
@ -37,8 +37,6 @@ enum fileTypeEnum {
|
||||
type_FNT
|
||||
};
|
||||
|
||||
typedef enum fileTypeEnum fileTypeEnum;
|
||||
|
||||
int loadSingleFile;
|
||||
|
||||
// TODO: Unify decodeGfxFormat1, decodeGfxFormat4 and decodeGfxFormat5
|
||||
|
@ -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];
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user