mirror of
https://github.com/OpenDriver2/REDRIVER2.git
synced 2024-11-22 10:22:48 +01:00
- change some declarations to support old compilers
This commit is contained in:
parent
cee65e7324
commit
09fc3195d7
@ -3,8 +3,8 @@
|
||||
#include "C/map.h"
|
||||
#include "C/dr2roads.h"
|
||||
|
||||
uint region_buffer_xor = 0;
|
||||
uint sdSelfModifyingCode = 8;
|
||||
u_int region_buffer_xor = 0;
|
||||
u_int sdSelfModifyingCode = 8;
|
||||
|
||||
extern int sdLevel;
|
||||
extern short* RoadMapDataRegions[4];
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef D2MAPASM_H
|
||||
#define D2MAPASM_H
|
||||
|
||||
extern uint region_buffer_xor;
|
||||
extern uint sdSelfModifyingCode; // 0x00012D18
|
||||
extern u_int region_buffer_xor;
|
||||
extern u_int sdSelfModifyingCode; // 0x00012D18
|
||||
|
||||
extern sdPlane* sdGetCell_asm(int param_2, short** roadMapData, int pos_x, int pos_z, int pos_y, int _sdLevel);
|
||||
|
||||
|
@ -107,7 +107,7 @@ void plotCarPolyB3(int numTris, CAR_POLY *src, SVECTOR *vlist, plotCarGlobals *p
|
||||
|
||||
if (Z > -1)
|
||||
{
|
||||
*(uint*)&prim->r0 = FT3rgb | 0x20000000;
|
||||
*(u_int*)&prim->r0 = FT3rgb | 0x20000000;
|
||||
|
||||
gte_stsxy3(&prim->x0, &prim->x1, &prim->x2);
|
||||
|
||||
@ -164,10 +164,10 @@ void plotCarPolyFT3(int numTris, CAR_POLY *src, SVECTOR *vlist, plotCarGlobals *
|
||||
if (Z > -1)
|
||||
{
|
||||
ofse = pg->damageLevel[src->originalindex];
|
||||
*(uint*)&prim->r0 = FT3rgb;
|
||||
*(uint*)&prim->u0 = src->clut_uv0 + ofse;
|
||||
*(uint*)&prim->u1 = src->tpage_uv1 + ofse;
|
||||
*(uint*)&prim->u2 = src->uv3_uv2 + ofse;
|
||||
*(u_int*)&prim->r0 = FT3rgb;
|
||||
*(u_int*)&prim->u0 = src->clut_uv0 + ofse;
|
||||
*(u_int*)&prim->u1 = src->tpage_uv1 + ofse;
|
||||
*(u_int*)&prim->u2 = src->uv3_uv2 + ofse;
|
||||
|
||||
gte_stsxy3(&prim->x0, &prim->x1, &prim->x2);
|
||||
|
||||
@ -193,9 +193,9 @@ void plotCarPolyGT3(int numTris, CAR_POLY *src, SVECTOR *vlist, SVECTOR *nlist,
|
||||
SVECTOR* v2;
|
||||
SVECTOR *v1;
|
||||
SVECTOR *v0;
|
||||
uint indices;
|
||||
u_int indices;
|
||||
POLY_GT3 *prim;
|
||||
uint r0,r1,r2;
|
||||
u_int r0,r1,r2;
|
||||
int ofse;
|
||||
|
||||
prim = (POLY_GT3 *)pg->primptr;
|
||||
@ -226,19 +226,19 @@ void plotCarPolyGT3(int numTris, CAR_POLY *src, SVECTOR *vlist, SVECTOR *nlist,
|
||||
{
|
||||
indices = src->nindices;
|
||||
|
||||
r0 = (uint)(ushort)nlist[indices & 0xff].pad;
|
||||
r1 = (uint)(ushort)nlist[indices >> 8 & 0xff].pad;
|
||||
r2 = (uint)(ushort)nlist[indices >> 16 & 0xff].pad;
|
||||
r0 = (u_int)(ushort)nlist[indices & 0xff].pad;
|
||||
r1 = (u_int)(ushort)nlist[indices >> 8 & 0xff].pad;
|
||||
r2 = (u_int)(ushort)nlist[indices >> 16 & 0xff].pad;
|
||||
|
||||
*(uint*)&prim->r0 = (r0 & 0xff) << 0x10 | r0;
|
||||
*(uint*)&prim->r1 = (r1 & 0xff) << 0x10 | r1;
|
||||
*(uint*)&prim->r2 = (r2 & 0xff) << 0x10 | r2;
|
||||
*(u_int*)&prim->r0 = (r0 & 0xff) << 0x10 | r0;
|
||||
*(u_int*)&prim->r1 = (r1 & 0xff) << 0x10 | r1;
|
||||
*(u_int*)&prim->r2 = (r2 & 0xff) << 0x10 | r2;
|
||||
|
||||
ofse = pg->damageLevel[src->originalindex];
|
||||
|
||||
*(uint*)&prim->u0 = (src->clut_uv0 & 0xffffU | pg->pciv_clut[palette + (src->clut_uv0 >> 0x10)] << 0x10) + ofse;
|
||||
*(uint*)&prim->u1 = src->tpage_uv1 + ofse;
|
||||
*(uint*)&prim->u2 = src->uv3_uv2 + ofse;
|
||||
*(u_int*)&prim->u0 = (src->clut_uv0 & 0xffffU | pg->pciv_clut[palette + (src->clut_uv0 >> 0x10)] << 0x10) + ofse;
|
||||
*(u_int*)&prim->u1 = src->tpage_uv1 + ofse;
|
||||
*(u_int*)&prim->u2 = src->uv3_uv2 + ofse;
|
||||
|
||||
gte_stsxy3(&prim->x0, &prim->x1, &prim->x2);
|
||||
|
||||
@ -263,7 +263,7 @@ void plotCarPolyGT3nolight(int numTris, CAR_POLY *src, SVECTOR *vlist, plotCarGl
|
||||
SVECTOR* v2;
|
||||
SVECTOR* v1;
|
||||
SVECTOR* v0;
|
||||
uint indices;
|
||||
u_int indices;
|
||||
POLY_FT3* prim;
|
||||
int ofse;
|
||||
|
||||
@ -293,13 +293,13 @@ void plotCarPolyGT3nolight(int numTris, CAR_POLY *src, SVECTOR *vlist, plotCarGl
|
||||
|
||||
if (Z > -1 && otz > 0)
|
||||
{
|
||||
*(uint*)&prim->r0 = GT3rgb;
|
||||
*(u_int*)&prim->r0 = GT3rgb;
|
||||
|
||||
ofse = pg->damageLevel[src->originalindex];
|
||||
|
||||
*(uint*)&prim->u0 = (src->clut_uv0 & 0xffffU | pg->pciv_clut[palette + (src->clut_uv0 >> 0x10)] << 0x10) + ofse;
|
||||
*(uint*)&prim->u1 = src->tpage_uv1 + ofse;
|
||||
*(uint*)&prim->u2 = src->uv3_uv2 + ofse;
|
||||
*(u_int*)&prim->u0 = (src->clut_uv0 & 0xffffU | pg->pciv_clut[palette + (src->clut_uv0 >> 0x10)] << 0x10) + ofse;
|
||||
*(u_int*)&prim->u1 = src->tpage_uv1 + ofse;
|
||||
*(u_int*)&prim->u2 = src->uv3_uv2 + ofse;
|
||||
|
||||
gte_stsxy3(&prim->x0, &prim->x1, &prim->x2);
|
||||
|
||||
@ -415,7 +415,7 @@ void ComputeCarLightingLevels(CAR_DATA* cp, char detail)
|
||||
|
||||
if (doLight)
|
||||
{
|
||||
uint rgbval = combointensity & 0xffffffU | 0x34000000;
|
||||
u_int rgbval = combointensity & 0xffffffU | 0x34000000;
|
||||
gte_ldrgb(&rgbval);
|
||||
|
||||
cp->ap.qy = cp->st.n.orientation[1];
|
||||
@ -518,11 +518,11 @@ void DrawWheelObject(MODEL* model, SVECTOR* verts, int transparent, int wheelnum
|
||||
addPrim(current->ot + (otZ >> 1) + 5, poly);
|
||||
|
||||
if (i < 2 || Z < 0)
|
||||
*(uint*)&poly->r0 = 0x2c000000;
|
||||
*(u_int*)&poly->r0 = 0x2c000000;
|
||||
else if (((i ^ wheelnum >> 1) & 1) == 0)
|
||||
*(uint*)&poly->r0 = dim;
|
||||
*(u_int*)&poly->r0 = dim;
|
||||
else
|
||||
*(uint*)&poly->r0 = bright;
|
||||
*(u_int*)&poly->r0 = bright;
|
||||
|
||||
setSemiTrans(poly, transparent);
|
||||
|
||||
@ -924,7 +924,7 @@ void buildNewCarFromModel(CAR_MODEL *car, MODEL *model, int first)
|
||||
case 18:
|
||||
if (pass == 2) // F3
|
||||
{
|
||||
cp->vindices = (uint)polyList[1] | ((uint)polyList[2] | (uint)polyList[3] << 8) << 8;
|
||||
cp->vindices = (u_int)polyList[1] | ((u_int)polyList[2] | (u_int)polyList[3] << 8) << 8;
|
||||
cp->originalindex = i;
|
||||
|
||||
newNumPolys++;
|
||||
@ -934,12 +934,12 @@ void buildNewCarFromModel(CAR_MODEL *car, MODEL *model, int first)
|
||||
case 19:
|
||||
if (pass == 2) // F4
|
||||
{
|
||||
cp->vindices = (uint)polyList[4] | ((uint)polyList[5] | (uint)polyList[6] << 8) << 8;
|
||||
cp->vindices = (u_int)polyList[4] | ((u_int)polyList[5] | (u_int)polyList[6] << 8) << 8;
|
||||
cp->originalindex = i;
|
||||
|
||||
cp = carPolyBuffer + newNumPolys + 1;
|
||||
|
||||
cp->vindices = (uint)polyList[4] | ((uint)polyList[6] | (uint)polyList[7] << 8) << 8;
|
||||
cp->vindices = (u_int)polyList[4] | ((u_int)polyList[6] | (u_int)polyList[7] << 8) << 8;
|
||||
cp->originalindex = i;
|
||||
|
||||
newNumPolys += 2;
|
||||
@ -1051,9 +1051,9 @@ void MangleWheelModels(void)
|
||||
UV_INFO tmpUV2;
|
||||
unsigned char tmpUV;
|
||||
int i;
|
||||
uint v0;
|
||||
uint v1;
|
||||
uint v2;
|
||||
u_int v0;
|
||||
u_int v1;
|
||||
u_int v2;
|
||||
POLYFT4*src;
|
||||
MODEL *m;
|
||||
int j;
|
||||
@ -1071,40 +1071,40 @@ void MangleWheelModels(void)
|
||||
// do some fuckery swaps
|
||||
src = (POLYFT4*)m->poly_block;
|
||||
|
||||
v0 = *(uint *)&src[2].v0;
|
||||
v1 = *(uint *)&src[2].uv0;
|
||||
v2 = *(uint *)&src[2].uv2;
|
||||
*(uint *)src = *(uint *)(src + 2);
|
||||
*(uint *)&src->v0 = v0;
|
||||
*(uint *)&src->uv0 = v1;
|
||||
*(uint *)&src->uv2 = v2;
|
||||
v0 = *(u_int *)&src[2].v0;
|
||||
v1 = *(u_int *)&src[2].uv0;
|
||||
v2 = *(u_int *)&src[2].uv2;
|
||||
*(u_int *)src = *(u_int *)(src + 2);
|
||||
*(u_int *)&src->v0 = v0;
|
||||
*(u_int *)&src->uv0 = v1;
|
||||
*(u_int *)&src->uv2 = v2;
|
||||
src->color = src[2].color;
|
||||
|
||||
v0 = *(uint *)&src[3].v0;
|
||||
v1 = *(uint *)&src[3].uv0;
|
||||
v2 = *(uint *)&src[3].uv2;
|
||||
*(uint *)(src + 1) = *(uint *)(src + 3);
|
||||
*(uint *)&src[1].v0 = v0;
|
||||
*(uint *)&src[1].uv0 = v1;
|
||||
*(uint *)&src[1].uv2 = v2;
|
||||
v0 = *(u_int *)&src[3].v0;
|
||||
v1 = *(u_int *)&src[3].uv0;
|
||||
v2 = *(u_int *)&src[3].uv2;
|
||||
*(u_int *)(src + 1) = *(u_int *)(src + 3);
|
||||
*(u_int *)&src[1].v0 = v0;
|
||||
*(u_int *)&src[1].uv0 = v1;
|
||||
*(u_int *)&src[1].uv2 = v2;
|
||||
src[1].color = src[3].color;
|
||||
|
||||
v0 = *(uint *)&src[4].v0;
|
||||
v1 = *(uint *)&src[4].uv0;
|
||||
v2 = *(uint *)&src[4].uv2;
|
||||
*(uint *)(src + 2) = *(uint *)(src + 4);
|
||||
*(uint *)&src[2].v0 = v0;
|
||||
*(uint *)&src[2].uv0 = v1;
|
||||
*(uint *)&src[2].uv2 = v2;
|
||||
v0 = *(u_int *)&src[4].v0;
|
||||
v1 = *(u_int *)&src[4].uv0;
|
||||
v2 = *(u_int *)&src[4].uv2;
|
||||
*(u_int *)(src + 2) = *(u_int *)(src + 4);
|
||||
*(u_int *)&src[2].v0 = v0;
|
||||
*(u_int *)&src[2].uv0 = v1;
|
||||
*(u_int *)&src[2].uv2 = v2;
|
||||
src[2].color = src[4].color;
|
||||
|
||||
v0 = *(uint *)&src[6].v0;
|
||||
v1 = *(uint *)&src[6].uv0;
|
||||
v2 = *(uint *)&src[6].uv2;
|
||||
*(uint *)(src + 3) = *(uint *)(src + 6);
|
||||
*(uint *)&src[3].v0 = v0;
|
||||
*(uint *)&src[3].uv0 = v1;
|
||||
*(uint *)&src[3].uv2 = v2;
|
||||
v0 = *(u_int *)&src[6].v0;
|
||||
v1 = *(u_int *)&src[6].uv0;
|
||||
v2 = *(u_int *)&src[6].uv2;
|
||||
*(u_int *)(src + 3) = *(u_int *)(src + 6);
|
||||
*(u_int *)&src[3].v0 = v0;
|
||||
*(u_int *)&src[3].uv0 = v1;
|
||||
*(u_int *)&src[3].uv2 = v2;
|
||||
src[3].color = src[6].color;
|
||||
|
||||
src[2].v0 = 16;
|
||||
|
@ -22,7 +22,7 @@ PACKED_CELL_OBJECT * GetFirstPackedCop(int cellx, int cellz, CELL_ITERATOR *pci,
|
||||
{
|
||||
PACKED_CELL_OBJECT *ppco;
|
||||
|
||||
uint value;
|
||||
u_int value;
|
||||
unsigned short index;
|
||||
unsigned short num;
|
||||
int cbr;
|
||||
@ -118,7 +118,7 @@ PACKED_CELL_OBJECT * GetFirstPackedCop(int cellx, int cellz, CELL_ITERATOR *pci,
|
||||
PACKED_CELL_OBJECT* GetNextPackedCop(CELL_ITERATOR* pci)
|
||||
{
|
||||
ushort num;
|
||||
uint value;
|
||||
u_int value;
|
||||
PACKED_CELL_OBJECT* ppco;
|
||||
CELL_DATA* celld;
|
||||
|
||||
|
@ -168,9 +168,9 @@ int InitCar(CAR_DATA* cp, int direction, LONGVECTOR4* startPos, unsigned char co
|
||||
// [D] [T]
|
||||
CAR_DATA* FindClosestCar(int x, int y, int z, int* distToCarSq)
|
||||
{
|
||||
uint distSq;
|
||||
u_int distSq;
|
||||
CAR_DATA* lcp;
|
||||
uint retDistSq;
|
||||
u_int retDistSq;
|
||||
CAR_DATA* retCar;
|
||||
int dx; // $a0
|
||||
int dz; // $v1
|
||||
@ -1101,7 +1101,7 @@ int CheckChangeLanes(DRIVER2_STRAIGHT* straight, DRIVER2_CURVE* curve, int distA
|
||||
CAR_COSMETICS* car_cos;
|
||||
int dx;
|
||||
int dz;
|
||||
uint theta;
|
||||
u_int theta;
|
||||
int length;
|
||||
CAR_DATA* lcp;
|
||||
|
||||
@ -1958,7 +1958,7 @@ int PingInCivCar(int minPingInDist)
|
||||
int lane;
|
||||
int i;
|
||||
u_char cookieCountStart;
|
||||
uint retDistSq;
|
||||
u_int retDistSq;
|
||||
unsigned char* slot;
|
||||
|
||||
//straight = NULL;
|
||||
@ -2401,7 +2401,7 @@ int PingInCivCar(int minPingInDist)
|
||||
if (carCnt->controlType != CONTROL_TYPE_NONE)
|
||||
{
|
||||
int dx, dy, dz;
|
||||
uint sqDist;
|
||||
u_int sqDist;
|
||||
|
||||
dy = randomLoc.vy - carCnt->hd.where.t[1];
|
||||
dy = ABS(dy);
|
||||
|
@ -756,8 +756,8 @@ void CopControl1(CAR_DATA *cp)
|
||||
void ControlCopDetection(void)
|
||||
{
|
||||
bool spotted;
|
||||
uint distanceToPlayer;
|
||||
uint minDistanceToPlayer;
|
||||
u_int distanceToPlayer;
|
||||
u_int minDistanceToPlayer;
|
||||
int heading;
|
||||
int dx, dz;
|
||||
CAR_DATA *cp;
|
||||
|
@ -134,7 +134,7 @@ void SetupSpecCosmetics(char *loadbuffer)
|
||||
// [D] [T]
|
||||
void AddIndicatorLight(CAR_DATA *cp, int Type)
|
||||
{
|
||||
uint brightness;
|
||||
u_int brightness;
|
||||
char *life;
|
||||
CAR_COSMETICS *car_cos;
|
||||
char *life2;
|
||||
@ -149,7 +149,7 @@ void AddIndicatorLight(CAR_DATA *cp, int Type)
|
||||
life2 = &cp->ap.life2;
|
||||
|
||||
if (cp->ap.life < 0)
|
||||
brightness = (0xff - (uint)cp->ap.life) * 2;
|
||||
brightness = (0xff - (u_int)cp->ap.life) * 2;
|
||||
else
|
||||
brightness = cp->ap.life << 1;
|
||||
|
||||
@ -328,7 +328,7 @@ void AddCopCarLight(CAR_DATA *cp)
|
||||
int num_lights;
|
||||
CAR_COSMETICS *car_cos;
|
||||
char *coplife;
|
||||
uint pos;
|
||||
u_int pos;
|
||||
int side;
|
||||
SVECTOR v1;
|
||||
CVECTOR col;
|
||||
|
@ -648,11 +648,11 @@ void AddLeaf(VECTOR *Position, int num_leaves, int Type)
|
||||
// apply colors
|
||||
if (gTimeOfDay == 3)
|
||||
{
|
||||
*(uint*)&myleaf->rgb = *(uint*)&myleaf->rgb >> 2 & 0x3f3f3f3f;
|
||||
*(u_int*)&myleaf->rgb = *(u_int*)&myleaf->rgb >> 2 & 0x3f3f3f3f;
|
||||
}
|
||||
else if (gWeather == 1 || gWeather == 2)
|
||||
{
|
||||
*(uint*)&myleaf->rgb = *(uint*)&myleaf->rgb >> 1 & 0x7f7f7f7f;
|
||||
*(u_int*)&myleaf->rgb = *(u_int*)&myleaf->rgb >> 1 & 0x7f7f7f7f;
|
||||
}
|
||||
|
||||
myleaf->sin_index1 = temprand & 0xfff;
|
||||
@ -2846,10 +2846,10 @@ void DisplayDebris(DEBRIS *debris, char type)
|
||||
else
|
||||
uVar3 = debris->rgb.b << 0x10 | debris->rgb.g << 8 | 0x3c000000 | debris->rgb.r;
|
||||
|
||||
*(uint *)&poly1->r0 = uVar3;
|
||||
*(uint *)&poly1->r2 = uVar3;
|
||||
*(uint *)&poly1->r1 = uVar3 + 0x202020;
|
||||
*(uint *)&poly1->r3 = uVar3 + 0x303030;
|
||||
*(u_int *)&poly1->r0 = uVar3;
|
||||
*(u_int *)&poly1->r2 = uVar3;
|
||||
*(u_int *)&poly1->r1 = uVar3 + 0x202020;
|
||||
*(u_int *)&poly1->r3 = uVar3 + 0x303030;
|
||||
|
||||
setPolyGT4(poly1);
|
||||
addPrim(current->ot + (z >> 3), poly1);
|
||||
@ -3511,15 +3511,15 @@ void DrawRainDrops(void)
|
||||
RainPtr->position.vx -= drift.vx * 2;
|
||||
RainPtr->position.vz -= drift.vz * 2;
|
||||
|
||||
*(uint *)&poly->x0 = *(uint *)&RainPtr->oldposition;
|
||||
*(u_int *)&poly->x0 = *(u_int *)&RainPtr->oldposition;
|
||||
}
|
||||
|
||||
gte_ldv0(&v);
|
||||
gte_rtps();
|
||||
|
||||
*(uint *)&poly->r2 = col;
|
||||
*(uint *)&poly->r1 = col;
|
||||
*(uint *)&poly->r0 = 0;
|
||||
*(u_int *)&poly->r2 = col;
|
||||
*(u_int *)&poly->r1 = col;
|
||||
*(u_int *)&poly->r0 = 0;
|
||||
|
||||
setPolyGT3(poly);
|
||||
setSemiTrans(poly, 1);
|
||||
@ -3532,13 +3532,13 @@ void DrawRainDrops(void)
|
||||
poly->x2 > -101 && poly->x2 < 421 &&
|
||||
poly->y2 > -51 && poly->y2 < 257)
|
||||
{
|
||||
if (*(uint *)&RainPtr->oldposition != 0)
|
||||
if (*(u_int *)&RainPtr->oldposition != 0)
|
||||
{
|
||||
poly->x1 = poly->x2 - ((z >> 10) - 1);
|
||||
poly->x2 = poly->x2 + ((z >> 10) - 1);
|
||||
poly->y1 = poly->y2;
|
||||
|
||||
*(uint *)&RainPtr->oldposition = *(uint *)&poly->x2;
|
||||
*(u_int *)&RainPtr->oldposition = *(u_int *)&poly->x2;
|
||||
|
||||
poly->clut = light_texture.clutid;
|
||||
poly->tpage = light_texture.tpageid | 0x20;
|
||||
@ -3551,7 +3551,7 @@ void DrawRainDrops(void)
|
||||
poly++;
|
||||
}
|
||||
else
|
||||
*(uint *)&RainPtr->oldposition = *(uint *)&poly->x2;
|
||||
*(u_int *)&RainPtr->oldposition = *(u_int *)&poly->x2;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -17,7 +17,7 @@
|
||||
((*(ushort*)&(rd)->NumLanes & 0xFFFF) == 0xFF01)
|
||||
|
||||
// those macros can be applied to straights and junctions
|
||||
#define ROAD_LANES_COUNT(rd) ((uint)(rd)->NumLanes & 0xF) // lane count
|
||||
#define ROAD_LANES_COUNT(rd) ((u_int)(rd)->NumLanes & 0xF) // lane count
|
||||
#define ROAD_WIDTH_IN_LANES(rd) (ROAD_LANES_COUNT(rd) * 2) // width in lanes
|
||||
#define ROAD_IS_AI_LANE(rd, lane) ((u_char)(rd)->AILanes >> ((lane) / 2) & 1U) // lane AI driveable flag
|
||||
#define ROAD_IS_LEFTMOST_LANE_PARKING(rd) (((u_char)(rd)->NumLanes & 0x40) != 0) // allows parking on leftmost lane
|
||||
|
@ -102,7 +102,7 @@ MATRIX inv_camera_matrix;
|
||||
MATRIX face_camera;
|
||||
MATRIX2 CompoundMatrix[64];
|
||||
|
||||
uint farClip2Player = 36000;
|
||||
u_int farClip2Player = 36000;
|
||||
|
||||
int goFaster = 0; // [A] was 1
|
||||
int fasterToggle = 0;
|
||||
@ -165,8 +165,8 @@ void DrawSprites(PACKED_CELL_OBJECT** sprites, int numFound)
|
||||
{
|
||||
int i;
|
||||
int z;
|
||||
uint spriteColour;
|
||||
uint lightdd;
|
||||
u_int spriteColour;
|
||||
u_int lightdd;
|
||||
unsigned char lightLevel;
|
||||
MODEL* model;
|
||||
PACKED_CELL_OBJECT* pco;
|
||||
@ -253,7 +253,7 @@ void DrawSprites(PACKED_CELL_OBJECT** sprites, int numFound)
|
||||
SVECTOR* verts;
|
||||
int numPolys;
|
||||
|
||||
numPolys = (uint)model->num_polys;
|
||||
numPolys = (u_int)model->num_polys;
|
||||
src = (POLYFT4*)model->poly_block;
|
||||
verts = (SVECTOR*)model->vertices;
|
||||
|
||||
@ -322,11 +322,11 @@ void DrawSprites(PACKED_CELL_OBJECT** sprites, int numFound)
|
||||
}
|
||||
|
||||
// [D] [T]
|
||||
void SetupPlaneColours(uint ambient)
|
||||
void SetupPlaneColours(u_int ambient)
|
||||
{
|
||||
uint r;
|
||||
uint g;
|
||||
uint b;
|
||||
u_int r;
|
||||
u_int g;
|
||||
u_int b;
|
||||
|
||||
if ((gWeather - 1U > 1) && gTimeOfDay != 0 && gTimeOfDay != 2)
|
||||
{
|
||||
@ -575,7 +575,7 @@ void DrawAllTheCars(int view)
|
||||
|
||||
|
||||
// [D] [T]
|
||||
u_int normalIndex(SVECTOR* verts, uint vidx)
|
||||
u_int normalIndex(SVECTOR* verts, u_int vidx)
|
||||
{
|
||||
SVECTOR* v0;
|
||||
SVECTOR* v1;
|
||||
@ -725,7 +725,7 @@ void PlotBuildingModelSubdivNxN(MODEL* model, int rot, _pct* pc, int n)
|
||||
temp = polys->th;
|
||||
|
||||
if ((polys->th & 0x80) == 0) // cache normal index if it were not
|
||||
temp = polys->th = normalIndex(srcVerts, *(uint*)&polys->v0);
|
||||
temp = polys->th = normalIndex(srcVerts, *(u_int*)&polys->v0);
|
||||
|
||||
pc->colour = pc->f4colourTable[(r >> 3) * 4 - temp & 31];
|
||||
}
|
||||
@ -778,7 +778,7 @@ void PlotBuildingModelSubdivNxN(MODEL* model, int rot, _pct* pc, int n)
|
||||
prims = (POLY_FT4*)pc->primptr;
|
||||
|
||||
setPolyFT4(prims);
|
||||
*(uint*)&prims->r0 = pc->colour;
|
||||
*(u_int*)&prims->r0 = pc->colour;
|
||||
|
||||
// retrieve first three verts
|
||||
gte_stsxy3(&prims->x0, &prims->x1, &prims->x2);
|
||||
|
@ -56,7 +56,7 @@ extern char CurrentPVS[444];
|
||||
|
||||
extern void DrawMapPSX(int *comp_val); // 0x0003F6B0
|
||||
|
||||
extern void SetupPlaneColours(uint ambient); // 0x00040218
|
||||
extern void SetupPlaneColours(u_int ambient); // 0x00040218
|
||||
extern void SetupDrawMapPSX(); // 0x00040408
|
||||
|
||||
extern void InitFrustrumMatrix(); // 0x00040534
|
||||
|
@ -461,7 +461,7 @@ void HandleDrivingGames(void)
|
||||
}
|
||||
|
||||
if (gTrailblazerConeIndex == 100)
|
||||
MissionTargets[NumPlayers - 1].target_flags |= TARGET_FLAG_COMPLETED_ALLP;
|
||||
MissionTargets[NumPlayers - 1].s.target_flags |= TARGET_FLAG_COMPLETED_ALLP;
|
||||
}
|
||||
else if (GameType == GAME_TRAILBLAZER)
|
||||
{
|
||||
@ -502,7 +502,7 @@ void HandleDrivingGames(void)
|
||||
}
|
||||
|
||||
if (gTrailblazerConeIndex == 100)
|
||||
MissionTargets[NumPlayers - 1].target_flags |= TARGET_FLAG_COMPLETED_ALLP;
|
||||
MissionTargets[NumPlayers - 1].s.target_flags |= TARGET_FLAG_COMPLETED_ALLP;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1896,7 +1896,7 @@ void StepPathEvent(EVENT* ev)
|
||||
// move train
|
||||
if ((flags & 0x7000) == 0x1000)
|
||||
{
|
||||
uint loop; // unsigned on purspose
|
||||
u_int loop; // unsigned on purspose
|
||||
|
||||
if (flags & 0x8000)
|
||||
{
|
||||
|
@ -313,7 +313,7 @@ void LoadLevelSFX(int missionNum)
|
||||
{
|
||||
int index;
|
||||
int i;
|
||||
uint city_night_fx;
|
||||
u_int city_night_fx;
|
||||
|
||||
city_night_fx = (gTimeOfDay == 3);
|
||||
|
||||
@ -983,16 +983,16 @@ void DoDopplerSFX(void)
|
||||
short* playerFelony;
|
||||
int i, j;
|
||||
int car;
|
||||
uint car_flags;
|
||||
u_int car_flags;
|
||||
int num_noisy_cars;
|
||||
int sirens;
|
||||
|
||||
uint car_dist[MAX_CARS];
|
||||
u_int car_dist[MAX_CARS];
|
||||
ushort indexlist[MAX_CARS];
|
||||
|
||||
CAR_DATA* car_ptr;
|
||||
int dx, dz;
|
||||
uint dist;
|
||||
u_int dist;
|
||||
|
||||
num_noisy_cars = 0;
|
||||
|
||||
@ -1362,7 +1362,7 @@ void DoDopplerSFX(void)
|
||||
}
|
||||
|
||||
// [D] [T]
|
||||
void DoPoliceLoudhailer(int cars, ushort* indexlist, uint* dist)
|
||||
void DoPoliceLoudhailer(int cars, ushort* indexlist, u_int* dist)
|
||||
{
|
||||
int rnd;
|
||||
int carId;
|
||||
|
@ -46,7 +46,7 @@ extern void MissionSay(int phrase); // 0x000526D0
|
||||
|
||||
extern void InitDopplerSFX(); // 0x0004E710
|
||||
extern void DoDopplerSFX(); // 0x0004E790
|
||||
extern void DoPoliceLoudhailer(int cars, unsigned short *indexlist, uint* dist); // 0x0004F4A0
|
||||
extern void DoPoliceLoudhailer(int cars, unsigned short *indexlist, u_int* dist); // 0x0004F4A0
|
||||
|
||||
extern void CollisionSound(char player_id, CAR_DATA *cp, int impact, int car_car); // 0x0004F668
|
||||
extern void ExplosionSound(VECTOR *pos, int type); // 0x0004F984
|
||||
|
@ -234,7 +234,7 @@ void DrawExplosion(int time, VECTOR position, int hscale, int rscale)
|
||||
int red, green, blue;
|
||||
int sf, sf1, sf2;
|
||||
|
||||
uint u0, u1,u2,u3;
|
||||
u_int u0, u1,u2,u3;
|
||||
int i;
|
||||
VECTOR v;
|
||||
MATRIX workmatrix;
|
||||
@ -285,8 +285,8 @@ void DrawExplosion(int time, VECTOR position, int hscale, int rscale)
|
||||
gte_ldv3(&src[0], &src[1], &src[2]);
|
||||
gte_rtpt();
|
||||
|
||||
*(uint *)&poly[0].r0 = rgb;
|
||||
*(uint *)&poly[1].r0 = rgb;
|
||||
*(u_int *)&poly[0].r0 = rgb;
|
||||
*(u_int *)&poly[1].r0 = rgb;
|
||||
|
||||
setPolyFT4(&poly[0]);
|
||||
setSemiTrans(&poly[0], 1);
|
||||
@ -305,15 +305,15 @@ void DrawExplosion(int time, VECTOR position, int hscale, int rscale)
|
||||
gte_ldv3(&src[3], &src[4], &src[5]);
|
||||
gte_rtpt();
|
||||
|
||||
*(uint *)&poly[0].u0 = u0;
|
||||
*(uint *)&poly[0].u1 = u1;
|
||||
*(uint *)&poly[0].u2 = u2;
|
||||
*(uint *)&poly[0].u3 = u3;
|
||||
*(u_int *)&poly[0].u0 = u0;
|
||||
*(u_int *)&poly[0].u1 = u1;
|
||||
*(u_int *)&poly[0].u2 = u2;
|
||||
*(u_int *)&poly[0].u3 = u3;
|
||||
|
||||
*(uint *)&poly[1].u0 = u0;
|
||||
*(uint *)&poly[1].u1 = u1;
|
||||
*(uint *)&poly[1].u2 = u2;
|
||||
*(uint *)&poly[1].u3 = u3;
|
||||
*(u_int *)&poly[1].u0 = u0;
|
||||
*(u_int *)&poly[1].u1 = u1;
|
||||
*(u_int *)&poly[1].u2 = u2;
|
||||
*(u_int *)&poly[1].u3 = u3;
|
||||
|
||||
setPolyFT4(poly);
|
||||
setSemiTrans(poly, 1);
|
||||
@ -370,8 +370,8 @@ void DrawExplosion(int time, VECTOR position, int hscale, int rscale)
|
||||
|
||||
gte_rtpt();
|
||||
|
||||
*(uint *)&poly[1].r0 = rgb;
|
||||
*(uint *)&poly[0].r0 = rgb;
|
||||
*(u_int *)&poly[1].r0 = rgb;
|
||||
*(u_int *)&poly[0].r0 = rgb;
|
||||
|
||||
gte_stsxy3(&poly[0].x0, &poly[0].x1, &poly[0].x2);
|
||||
|
||||
@ -384,14 +384,14 @@ void DrawExplosion(int time, VECTOR position, int hscale, int rscale)
|
||||
gte_ldv3(&src[3], &src[4], &src[5]);
|
||||
gte_rtpt();
|
||||
|
||||
*(uint *)&poly[0].u0 = u0;
|
||||
*(uint *)&poly[0].u1 = u1;
|
||||
*(uint *)&poly[0].u2 = u2;
|
||||
*(uint *)&poly[0].u3 = u3;
|
||||
*(uint *)&poly[1].u0 = u0;
|
||||
*(uint *)&poly[1].u1 = u1;
|
||||
*(uint *)&poly[1].u2 = u2;
|
||||
*(uint *)&poly[1].u3 = u3;
|
||||
*(u_int *)&poly[0].u0 = u0;
|
||||
*(u_int *)&poly[0].u1 = u1;
|
||||
*(u_int *)&poly[0].u2 = u2;
|
||||
*(u_int *)&poly[0].u3 = u3;
|
||||
*(u_int *)&poly[1].u0 = u0;
|
||||
*(u_int *)&poly[1].u1 = u1;
|
||||
*(u_int *)&poly[1].u2 = u2;
|
||||
*(u_int *)&poly[1].u3 = u3;
|
||||
|
||||
setPolyFT4(poly);
|
||||
setSemiTrans(poly, 1);
|
||||
|
@ -1861,7 +1861,7 @@ void UpdateRoadPosition(CAR_DATA* cp, VECTOR* basePos, int intention)
|
||||
}
|
||||
}
|
||||
#else
|
||||
intention_lt_2 = (uint)intention < 2;
|
||||
intention_lt_2 = (u_int)intention < 2;
|
||||
intention_minus_2 = intention - 2;
|
||||
|
||||
if (intention_lt_2)
|
||||
@ -2210,7 +2210,7 @@ void UpdateRoadPosition(CAR_DATA* cp, VECTOR* basePos, int intention)
|
||||
}
|
||||
|
||||
penalty = 0;
|
||||
while ((uint)left < 41)
|
||||
while ((u_int)left < 41)
|
||||
{
|
||||
roadAhead[left] -= penalty;
|
||||
|
||||
@ -2222,7 +2222,7 @@ void UpdateRoadPosition(CAR_DATA* cp, VECTOR* basePos, int intention)
|
||||
}
|
||||
|
||||
penalty = 0;
|
||||
while ((uint)right < 41)
|
||||
while ((u_int)right < 41)
|
||||
{
|
||||
roadAhead[right] -= penalty;
|
||||
|
||||
@ -2273,7 +2273,7 @@ void UpdateRoadPosition(CAR_DATA* cp, VECTOR* basePos, int intention)
|
||||
}
|
||||
|
||||
__right = 0;
|
||||
while ((uint)left < 0x29)
|
||||
while ((u_int)left < 0x29)
|
||||
{
|
||||
roadAhead[left] = roadAhead[left] - __right;
|
||||
|
||||
@ -2285,7 +2285,7 @@ void UpdateRoadPosition(CAR_DATA* cp, VECTOR* basePos, int intention)
|
||||
}
|
||||
|
||||
__right = 0;
|
||||
while ((uint)right < 0x29)
|
||||
while ((u_int)right < 0x29)
|
||||
{
|
||||
roadAhead[right] = roadAhead[right] - __right;
|
||||
|
||||
|
@ -142,7 +142,7 @@ void ShowLoadingScreen(char *screen_name, int effect, int loading_steps)
|
||||
SPRT *sprt;
|
||||
POLY_FT3 *null;
|
||||
|
||||
uint tp;
|
||||
u_int tp;
|
||||
int i;
|
||||
int j;
|
||||
int fade;
|
||||
|
@ -144,7 +144,7 @@ static PAUSEMODE PauseMode = PAUSEMODE_PAUSE;
|
||||
unsigned char defaultPlayerModel[2] = { 0 }; // offset 0xAA604
|
||||
unsigned char defaultPlayerPalette = 0; // offset 0xAA606
|
||||
|
||||
uint* transparent_buffer;
|
||||
u_int* transparent_buffer;
|
||||
|
||||
// system?
|
||||
int gameinit = 0;
|
||||
@ -855,7 +855,7 @@ void StepSim(void)
|
||||
|
||||
oldsp = SetSp(0x1f8003e8); // i don't know what this does
|
||||
|
||||
lead_pad = (uint)controller_bits;
|
||||
lead_pad = (u_int)controller_bits;
|
||||
|
||||
if (player[0].playerCarId < 0)
|
||||
playerFelony = &pedestrianFelony;
|
||||
|
@ -666,7 +666,7 @@ void PVSDecode(char *output, char *celldata, ushort sz, int havanaCorruptCellBod
|
||||
void GetPVSRegionCell2(int source_region, int region, int cell, char *output)
|
||||
{
|
||||
int k;
|
||||
uint havanaCorruptCellBodge;
|
||||
u_int havanaCorruptCellBodge;
|
||||
char *tbp;
|
||||
char *bp;
|
||||
ushort length;
|
||||
|
@ -484,7 +484,7 @@ void DoMissionSound(void)
|
||||
{
|
||||
if (MissionTargets[i].type == Target_Car)
|
||||
{
|
||||
holdall = MissionTargets[i].car.slot;
|
||||
holdall = MissionTargets[i].s.car.slot;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -642,7 +642,7 @@ void DoMissionSound(void)
|
||||
}
|
||||
else if (holdall == 20)
|
||||
{
|
||||
holdall = MissionTargets[i].car.slot;
|
||||
holdall = MissionTargets[i].s.car.slot;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,10 +38,10 @@ void DrawTimer(MR_TIMER* timer)
|
||||
SetTextColour(32, 128, 32);
|
||||
}
|
||||
|
||||
sprintf(string, "%02d:%02d", (uint)timer->min, (uint)timer->sec);
|
||||
sprintf(string, "%02d:%02d", (u_int)timer->min, (u_int)timer->sec);
|
||||
digit_pos = PrintDigit((int)timer->x, (int)timer->y, string);
|
||||
|
||||
sprintf(string, ".%02d", (uint)timer->frac);
|
||||
sprintf(string, ".%02d", (u_int)timer->frac);
|
||||
PrintString(string, digit_pos, (int)timer->y + 0xd);
|
||||
}
|
||||
}
|
||||
@ -144,7 +144,7 @@ void DrawOverheadTarget(MS_TARGET *target)
|
||||
if (TargetComplete(target, -1))
|
||||
return;
|
||||
|
||||
if ((target->target_flags & TARGET_FLAG_VISIBLE_ALLP) == 0)
|
||||
if ((target->s.target_flags & TARGET_FLAG_VISIBLE_ALLP) == 0)
|
||||
return;
|
||||
|
||||
switch(target->type)
|
||||
@ -152,22 +152,22 @@ void DrawOverheadTarget(MS_TARGET *target)
|
||||
case Target_Point: // point or car target
|
||||
case Target_Car:
|
||||
{
|
||||
tv.vx = target->car.posX;
|
||||
tv.vz = target->car.posZ;
|
||||
tv.vx = target->s.car.posX;
|
||||
tv.vz = target->s.car.posZ;
|
||||
tv.vy = 0;
|
||||
break;
|
||||
}
|
||||
case Target_Event: // event target
|
||||
tv = *target->event.eventPos;
|
||||
tv = *target->s.event.eventPos;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (target->display_flags & 0x10)
|
||||
if (target->s.display_flags & 0x10)
|
||||
DrawTargetBlip(&tv, 64, 64, 64, 0x11);
|
||||
|
||||
if (target->display_flags & 0x40)
|
||||
if (target->s.display_flags & 0x40)
|
||||
DrawTargetArrow(&tv, 1);
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ void DrawFullscreenTarget(MS_TARGET *target)
|
||||
if (TargetComplete(target, -1))
|
||||
return;
|
||||
|
||||
if ((target->target_flags & TARGET_FLAG_VISIBLE_ALLP) == 0)
|
||||
if ((target->s.target_flags & TARGET_FLAG_VISIBLE_ALLP) == 0)
|
||||
return;
|
||||
|
||||
switch(target->type)
|
||||
@ -187,29 +187,29 @@ void DrawFullscreenTarget(MS_TARGET *target)
|
||||
case Target_Point: // point or car target
|
||||
case Target_Car:
|
||||
{
|
||||
tv.vx = target->car.posX;
|
||||
tv.vz = target->car.posZ;
|
||||
tv.vx = target->s.car.posX;
|
||||
tv.vz = target->s.car.posZ;
|
||||
tv.vy = 0;
|
||||
break;
|
||||
}
|
||||
case Target_Event: // event target
|
||||
tv = *target->event.eventPos;
|
||||
tv = *target->s.event.eventPos;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (target->display_flags & 0x10)
|
||||
if (target->s.display_flags & 0x10)
|
||||
DrawTargetBlip(&tv, 64, 64, 64, 0x14);
|
||||
|
||||
if (target->display_flags & 0x40)
|
||||
if (target->s.display_flags & 0x40)
|
||||
DrawTargetArrow(&tv, 4);
|
||||
}
|
||||
|
||||
// [D] [T]
|
||||
void DrawWorldTarget(MS_TARGET *target)
|
||||
{
|
||||
uint flags;
|
||||
u_int flags;
|
||||
VECTOR tv;
|
||||
|
||||
if (TargetComplete(target, CurrentPlayerView))
|
||||
@ -226,12 +226,12 @@ void DrawWorldTarget(MS_TARGET *target)
|
||||
{
|
||||
case Target_Point:
|
||||
{
|
||||
tv.vx = target->point.posX;
|
||||
tv.vz = target->point.posZ;
|
||||
tv.vx = target->s.point.posX;
|
||||
tv.vz = target->s.point.posZ;
|
||||
tv.vy = 10000;
|
||||
|
||||
// Capture the Flag target properties
|
||||
switch(target->target_flags & (TARGET_FLAG_POINT_CTF_BASE_P1 | TARGET_FLAG_POINT_CTF_BASE_P2 | TARGET_FLAG_POINT_CTF_FLAG))
|
||||
switch(target->s.target_flags & (TARGET_FLAG_POINT_CTF_BASE_P1 | TARGET_FLAG_POINT_CTF_BASE_P2 | TARGET_FLAG_POINT_CTF_FLAG))
|
||||
{
|
||||
case TARGET_FLAG_POINT_CTF_BASE_P1:
|
||||
{
|
||||
@ -274,8 +274,8 @@ void DrawWorldTarget(MS_TARGET *target)
|
||||
}
|
||||
}
|
||||
|
||||
if (target->point.height != 0)
|
||||
tv.vy = target->point.posY;
|
||||
if (target->s.point.height != 0)
|
||||
tv.vy = target->s.point.posY;
|
||||
else
|
||||
tv.vy = -MapHeight(&tv);
|
||||
|
||||
@ -284,7 +284,7 @@ void DrawWorldTarget(MS_TARGET *target)
|
||||
case Target_Car:
|
||||
{
|
||||
int slot;
|
||||
slot = target->car.slot;
|
||||
slot = target->s.car.slot;
|
||||
|
||||
if (slot == -1)
|
||||
return;
|
||||
@ -296,7 +296,7 @@ void DrawWorldTarget(MS_TARGET *target)
|
||||
}
|
||||
case Target_Event:
|
||||
{
|
||||
tv = *target->event.eventPos;
|
||||
tv = *target->s.event.eventPos;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -307,10 +307,10 @@ void DrawWorldTarget(MS_TARGET *target)
|
||||
{
|
||||
if((flags & 0x10) == 0)
|
||||
{
|
||||
if (target->display_flags & 0x20)
|
||||
if (target->s.display_flags & 0x20)
|
||||
flags |= 0x1;
|
||||
|
||||
if (target->display_flags & 0x80)
|
||||
if (target->s.display_flags & 0x80)
|
||||
flags |= 0x20;
|
||||
}
|
||||
|
||||
@ -358,12 +358,12 @@ void DrawMultiplayerTarget(MS_TARGET *target)
|
||||
{
|
||||
case Target_Point:
|
||||
{
|
||||
tv.vx = target->point.posX;
|
||||
tv.vz = target->point.posZ;
|
||||
tv.vx = target->s.point.posX;
|
||||
tv.vz = target->s.point.posZ;
|
||||
tv.vy = 10000;
|
||||
|
||||
// Capture the Flag target properties
|
||||
switch(target->target_flags & (TARGET_FLAG_POINT_CTF_BASE_P1 | TARGET_FLAG_POINT_CTF_BASE_P2 | TARGET_FLAG_POINT_CTF_FLAG))
|
||||
switch(target->s.target_flags & (TARGET_FLAG_POINT_CTF_BASE_P1 | TARGET_FLAG_POINT_CTF_BASE_P2 | TARGET_FLAG_POINT_CTF_FLAG))
|
||||
{
|
||||
case TARGET_FLAG_POINT_CTF_BASE_P1:
|
||||
{
|
||||
@ -391,8 +391,8 @@ void DrawMultiplayerTarget(MS_TARGET *target)
|
||||
}
|
||||
}
|
||||
|
||||
if (target->point.height != 0)
|
||||
tv.vy = target->point.posY;
|
||||
if (target->s.point.height != 0)
|
||||
tv.vy = target->s.point.posY;
|
||||
else
|
||||
tv.vy = -MapHeight(&tv);
|
||||
|
||||
@ -401,7 +401,7 @@ void DrawMultiplayerTarget(MS_TARGET *target)
|
||||
case Target_Car:
|
||||
{
|
||||
int slot;
|
||||
slot = target->car.slot;
|
||||
slot = target->s.car.slot;
|
||||
|
||||
if (slot == -1)
|
||||
return;
|
||||
@ -413,14 +413,14 @@ void DrawMultiplayerTarget(MS_TARGET *target)
|
||||
}
|
||||
case Target_Event:
|
||||
{
|
||||
tv = *target->event.eventPos;
|
||||
tv = *target->s.event.eventPos;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (target->display_flags & 0x10)
|
||||
if (target->s.display_flags & 0x10)
|
||||
{
|
||||
DrawTargetBlip(&tv, r, g, b, 0x30);
|
||||
}
|
||||
|
@ -103,10 +103,10 @@ void StoreCarPosition(MS_TARGET *target, SAVED_CAR_POS *data)
|
||||
CAR_DATA* cp;
|
||||
|
||||
// if target is a swapable, make sure it gonna be previous player car
|
||||
if (target->car.flags & CARTARGET_FLAG_BACK_TO_PLAYERCAR)
|
||||
if (target->s.car.flags & CARTARGET_FLAG_BACK_TO_PLAYERCAR)
|
||||
slot = Mission.PhantomCarId;
|
||||
else
|
||||
slot = target->car.slot;
|
||||
slot = target->s.car.slot;
|
||||
|
||||
if (slot == -1)
|
||||
return;
|
||||
@ -136,7 +136,7 @@ void StoreCarPosition(MS_TARGET *target, SAVED_CAR_POS *data)
|
||||
|
||||
data->active = 1;
|
||||
|
||||
if (target->target_flags & TARGET_FLAG_CAR_SWAPPED)
|
||||
if (target->s.target_flags & TARGET_FLAG_CAR_SWAPPED)
|
||||
data->active |= 0x80;
|
||||
}
|
||||
|
||||
@ -231,7 +231,7 @@ void StoreEndData(void)
|
||||
carpos = &MissionEndData.CarPos[numStored];
|
||||
|
||||
if (target->type == Target_Car &&
|
||||
(target->target_flags & TARGET_FLAG_CAR_SAVED))
|
||||
(target->s.target_flags & TARGET_FLAG_CAR_SAVED))
|
||||
{
|
||||
StoreCarPosition(target, carpos);
|
||||
|
||||
|
@ -283,7 +283,7 @@ void InitialiseMissionDefaults(void)
|
||||
Mission.message_string[i] = NULL;
|
||||
}
|
||||
|
||||
Driver2TempJunctionsPtr = (uint*)_overlay_buffer;
|
||||
Driver2TempJunctionsPtr = (u_int*)_overlay_buffer;
|
||||
NumTempJunctions = 0;
|
||||
gPlayerWithTheFlag = -1;
|
||||
last_flag = -1;
|
||||
@ -381,7 +381,7 @@ void LoadMission(int missionnum)
|
||||
{
|
||||
int missionSize;
|
||||
ROUTE_INFO* rinfo;
|
||||
uint loadsize;
|
||||
u_int loadsize;
|
||||
char filename[32];
|
||||
u_int header;
|
||||
u_int length;
|
||||
@ -662,7 +662,7 @@ void LoadMission(int missionnum)
|
||||
NumTempJunctions = rinfo->nJunctions;
|
||||
memcpy((u_char*)Driver2TempJunctionsPtr, (u_char*)rinfo->data, NumTempJunctions << 2);
|
||||
LeadValues = rinfo->parameters;
|
||||
|
||||
|
||||
mallocptr = MissionStrings + MissionHeader->route;
|
||||
#ifdef PSX
|
||||
Loadfile("LEAD.BIN", 0xE7000);
|
||||
@ -1148,9 +1148,9 @@ void RegisterChaseHit(int car1, int car2)
|
||||
{
|
||||
if (gPlayerWithTheFlag == -1)
|
||||
{
|
||||
if (car1 == Mission.ChaseTarget->car.slot || car2 == Mission.ChaseTarget->car.slot)
|
||||
if (car1 == Mission.ChaseTarget->s.car.slot || car2 == Mission.ChaseTarget->s.car.slot)
|
||||
{
|
||||
Mission.ChaseTarget->car.chasing.maxDamage--;
|
||||
Mission.ChaseTarget->s.car.chasing.maxDamage--;
|
||||
Mission.ChaseHitDelay = 20;
|
||||
DamageBar.position++;
|
||||
}
|
||||
@ -1241,7 +1241,7 @@ int TargetComplete(MS_TARGET *target, int player)
|
||||
else
|
||||
flag = TARGET_FLAG_COMPLETED_ALLP;
|
||||
|
||||
return (target->target_flags & flag) == flag;
|
||||
return (target->s.target_flags & flag) == flag;
|
||||
}
|
||||
|
||||
|
||||
@ -1257,7 +1257,7 @@ int TargetActive(MS_TARGET *target, int player)
|
||||
else
|
||||
flag = TARGET_FLAG_ACTIVE_ALLP;
|
||||
|
||||
return (target->target_flags & flag) == flag;
|
||||
return (target->s.target_flags & flag) == flag;
|
||||
}
|
||||
|
||||
// [D] [T]
|
||||
@ -1408,10 +1408,10 @@ int Swap2Cars(int curslot, int newslot)
|
||||
|
||||
if (swapTgt->type == Target_Car)
|
||||
{
|
||||
if (swapTgt->car.slot == curslot)
|
||||
swapTgt->car.slot = newslot;
|
||||
else if (swapTgt->car.slot == newslot)
|
||||
swapTgt->car.slot = curslot;
|
||||
if (swapTgt->s.car.slot == curslot)
|
||||
swapTgt->s.car.slot = newslot;
|
||||
else if (swapTgt->s.car.slot == newslot)
|
||||
swapTgt->s.car.slot = curslot;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1445,7 +1445,7 @@ void HandleMissionThreads(void)
|
||||
u_int value;
|
||||
|
||||
for (i = 0; i < MAX_MISSION_TARGETS; i++)
|
||||
MissionTargets[i].target_flags &= ~TARGET_FLAG_VISIBLE_ALLP;
|
||||
MissionTargets[i].s.target_flags &= ~TARGET_FLAG_VISIBLE_ALLP;
|
||||
|
||||
for (i = 0; i < MAX_MISSION_THREADS; i++)
|
||||
{
|
||||
@ -1943,9 +1943,9 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
return 1;
|
||||
|
||||
if (thread->player == 0)
|
||||
target->target_flags |= (TARGET_FLAG_VISIBLE_P1 | TARGET_FLAG_ACTIVE_P1);
|
||||
target->s.target_flags |= (TARGET_FLAG_VISIBLE_P1 | TARGET_FLAG_ACTIVE_P1);
|
||||
else
|
||||
target->target_flags |= (TARGET_FLAG_VISIBLE_P2 | TARGET_FLAG_ACTIVE_P2);
|
||||
target->s.target_flags |= (TARGET_FLAG_VISIBLE_P2 | TARGET_FLAG_ACTIVE_P2);
|
||||
|
||||
playerId = thread->player;
|
||||
pv.vx = player[playerId].pos[0];
|
||||
@ -1956,43 +1956,43 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
{
|
||||
case Target_Point: // point target
|
||||
{
|
||||
if (target->target_flags & TARGET_FLAG_POINT_ON_BOAT)
|
||||
if (target->s.target_flags & TARGET_FLAG_POINT_ON_BOAT)
|
||||
{
|
||||
tv.vx = target->point.boatOffsetX;
|
||||
tv.vz = target->point.boatOffsetZ;
|
||||
tv.vx = target->s.point.boatOffsetX;
|
||||
tv.vz = target->s.point.boatOffsetZ;
|
||||
|
||||
OffsetTarget(&tv);
|
||||
|
||||
target->point.posX = tv.vx;
|
||||
target->point.posZ = tv.vz;
|
||||
target->s.point.posX = tv.vx;
|
||||
target->s.point.posZ = tv.vz;
|
||||
}
|
||||
else if (target->target_flags & TARGET_FLAG_POINT_STOP_COPS_TRIGGER) // set stop cops
|
||||
else if (target->s.target_flags & TARGET_FLAG_POINT_STOP_COPS_TRIGGER) // set stop cops
|
||||
{
|
||||
target->target_flags &= ~TARGET_FLAG_POINT_STOP_COPS_TRIGGER;
|
||||
target->s.target_flags &= ~TARGET_FLAG_POINT_STOP_COPS_TRIGGER;
|
||||
|
||||
gStopCops.radius = target->point.radius;
|
||||
gStopCops.pos.vx = target->point.posX;
|
||||
gStopCops.radius = target->s.point.radius;
|
||||
gStopCops.pos.vx = target->s.point.posX;
|
||||
gStopCops.pos.vy = 0;
|
||||
gStopCops.pos.vz = target->point.posZ;
|
||||
gStopCops.pos.vz = target->s.point.posZ;
|
||||
}
|
||||
else
|
||||
{
|
||||
tv.vx = target->point.posX;
|
||||
tv.vz = target->point.posZ;
|
||||
tv.vx = target->s.point.posX;
|
||||
tv.vz = target->s.point.posZ;
|
||||
tv.vy = 0;
|
||||
}
|
||||
|
||||
if (Long2DDistance(&tv, &pv) <= target->point.radius)
|
||||
if (Long2DDistance(&tv, &pv) <= target->s.point.radius)
|
||||
{
|
||||
if (target->point.height != 0) // if target is at height (Train pursuit)
|
||||
if (target->s.point.height != 0) // if target is at height (Train pursuit)
|
||||
{
|
||||
if (target->point.height < ABS(target->point.posY + pv.vy))
|
||||
target->point.actionFlag &= ~0xFFF0;
|
||||
if (target->s.point.height < ABS(target->s.point.posY + pv.vy))
|
||||
target->s.point.actionFlag &= ~0xFFF0;
|
||||
}
|
||||
|
||||
if (GameType == GAME_SECRET)
|
||||
{
|
||||
switch(target->target_flags & (TARGET_FLAG_POINT_SECRET_POINT1 | TARGET_FLAG_POINT_SECRET_POINT2 | TARGET_FLAG_POINT_SECRET_STARTFINISH))
|
||||
switch(target->s.target_flags & (TARGET_FLAG_POINT_SECRET_POINT1 | TARGET_FLAG_POINT_SECRET_POINT2 | TARGET_FLAG_POINT_SECRET_STARTFINISH))
|
||||
{
|
||||
case 0: // TARGET_FLAG_POINT_SECRET_POINT0
|
||||
{
|
||||
@ -2043,12 +2043,12 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (target->target_flags & (TARGET_FLAG_POINT_CTF_BASE_P1 | TARGET_FLAG_POINT_CTF_BASE_P2 | TARGET_FLAG_POINT_CTF_FLAG))
|
||||
switch (target->s.target_flags & (TARGET_FLAG_POINT_CTF_BASE_P1 | TARGET_FLAG_POINT_CTF_BASE_P2 | TARGET_FLAG_POINT_CTF_FLAG))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
int actionFlag;
|
||||
actionFlag = target->point.actionFlag;
|
||||
actionFlag = target->s.point.actionFlag;
|
||||
|
||||
if (actionFlag)
|
||||
{
|
||||
@ -2062,7 +2062,7 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
SetPlayerMessage(thread->player, message, 2, 0);
|
||||
}
|
||||
|
||||
target->point.actionFlag = (actionFlag >> 0x10) << 0x10 | (val << 4) | actionFlag & 0xf;
|
||||
target->s.point.actionFlag = (actionFlag >> 0x10) << 0x10 | (val << 4) | actionFlag & 0xf;
|
||||
gTannerActionNeeded = 1;
|
||||
|
||||
if (TannerActionHappening())
|
||||
@ -2073,12 +2073,12 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
else
|
||||
{
|
||||
// Handling of Lose Tail message
|
||||
if (target->point.loseTailMessage != -1 && copsAreInPursuit)
|
||||
if (target->s.point.loseTailMessage != -1 && copsAreInPursuit)
|
||||
{
|
||||
if (Mission.message_timer[0] == 0 && prevCopsInPursuit == 0)
|
||||
{
|
||||
// lose tail
|
||||
SetPlayerMessage(thread->player, MissionStrings + target->point.loseTailMessage, 2, 2);
|
||||
SetPlayerMessage(thread->player, MissionStrings + target->s.point.loseTailMessage, 2, 2);
|
||||
prevCopsInPursuit = copsAreInPursuit;
|
||||
}
|
||||
}
|
||||
@ -2092,10 +2092,10 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
if (ret == 0)
|
||||
return 0;
|
||||
|
||||
if (target->target_flags & 0x400000)
|
||||
if (target->s.target_flags & 0x400000)
|
||||
return 1;
|
||||
|
||||
if ((target->target_flags & TARGET_FLAG_POINT_PLAYER_MUSTHAVE_CAR) && player[thread->player].playerType != 1)
|
||||
if ((target->s.target_flags & TARGET_FLAG_POINT_PLAYER_MUSTHAVE_CAR) && player[thread->player].playerType != 1)
|
||||
ret = 0;
|
||||
|
||||
break;
|
||||
@ -2107,8 +2107,8 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
{
|
||||
int correctZone;
|
||||
|
||||
correctZone = (target->target_flags & TARGET_FLAG_POINT_CTF_BASE_P1) && thread->player == 0 ||
|
||||
(target->target_flags & TARGET_FLAG_POINT_CTF_BASE_P2) && thread->player == 1;
|
||||
correctZone = (target->s.target_flags & TARGET_FLAG_POINT_CTF_BASE_P1) && thread->player == 0 ||
|
||||
(target->s.target_flags & TARGET_FLAG_POINT_CTF_BASE_P2) && thread->player == 1;
|
||||
|
||||
if(correctZone)
|
||||
{
|
||||
@ -2151,7 +2151,7 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
}
|
||||
else
|
||||
{
|
||||
target->point.actionFlag &= ~0xFFF0;
|
||||
target->s.point.actionFlag &= ~0xFFF0;
|
||||
}
|
||||
|
||||
break;
|
||||
@ -2159,16 +2159,16 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
case Target_Car: // car target
|
||||
{
|
||||
CAR_DATA* cp;
|
||||
tv.vx = target->car.posX;
|
||||
tv.vz = target->car.posZ;
|
||||
tv.vx = target->s.car.posX;
|
||||
tv.vz = target->s.car.posZ;
|
||||
tv.vy = 0;
|
||||
|
||||
dist = Long2DDistance(&tv, &pv);
|
||||
slot = target->car.slot;
|
||||
slot = target->s.car.slot;
|
||||
|
||||
if (slot == -1)
|
||||
{
|
||||
if (dist < 18000 || target->car.type == 3 && !(target->car.flags & CARTARGET_FLAG_RANDOMCHASE))
|
||||
if (dist < 18000 || target->s.car.type == 3 && !(target->s.car.flags & CARTARGET_FLAG_RANDOMCHASE))
|
||||
MRRequestCar(target);
|
||||
else
|
||||
MRCancelCarRequest(target);
|
||||
@ -2178,15 +2178,15 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
|
||||
cp = &car_data[slot];
|
||||
|
||||
if (target->target_flags & TARGET_FLAG_CAR_PINGED_IN)
|
||||
if (target->s.target_flags & TARGET_FLAG_CAR_PINGED_IN)
|
||||
{
|
||||
target->car.posX = cp->hd.where.t[0];
|
||||
target->car.posZ = cp->hd.where.t[2];
|
||||
target->s.car.posX = cp->hd.where.t[0];
|
||||
target->s.car.posZ = cp->hd.where.t[2];
|
||||
|
||||
// make Caine's Compound vans moving
|
||||
if (target->car.type == 1)
|
||||
if (target->s.car.type == 1)
|
||||
{
|
||||
if (target->car.maxDistance != 0 && dist < target->car.maxDistance)
|
||||
if (target->s.car.maxDistance != 0 && dist < target->s.car.maxDistance)
|
||||
{
|
||||
int direction, model, palette;
|
||||
int *inform;
|
||||
@ -2207,17 +2207,17 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
|
||||
cp->inform = inform;
|
||||
|
||||
target->car.slot = slot;
|
||||
target->car.maxDistance = 0;
|
||||
target->s.car.slot = slot;
|
||||
target->s.car.maxDistance = 0;
|
||||
}
|
||||
}
|
||||
else if (target->car.type == 3)
|
||||
else if (target->s.car.type == 3)
|
||||
{
|
||||
if((target->target_flags & TARGET_FLAG_CAR_PLAYERCONTROLLED) == 0)
|
||||
if((target->s.target_flags & TARGET_FLAG_CAR_PLAYERCONTROLLED) == 0)
|
||||
{
|
||||
if(target->car.flags & CARTARGET_FLAG_RANDOMCHASE)
|
||||
if(target->s.car.flags & CARTARGET_FLAG_RANDOMCHASE)
|
||||
{
|
||||
if (target->car.cutscene == -1)
|
||||
if (target->s.car.cutscene == -1)
|
||||
{
|
||||
if (gInGameChaseActive == 0)
|
||||
{
|
||||
@ -2225,9 +2225,9 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
player[0].targetCarId = -1;
|
||||
gBombTargetVehicle = NULL;
|
||||
|
||||
if ((target->car.flags & 0xf0) != CARTARGET_FLAG_STEAL_TARGET)
|
||||
if ((target->s.car.flags & 0xf0) != CARTARGET_FLAG_STEAL_TARGET)
|
||||
{
|
||||
if (target->car.flags & CARTARGET_FLAG_TO_BE_STOLEN)
|
||||
if (target->s.car.flags & CARTARGET_FLAG_TO_BE_STOLEN)
|
||||
SetCarToBeStolen(target, thread->player);
|
||||
else
|
||||
ret = 1;
|
||||
@ -2236,12 +2236,12 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dist < target->car.maxDistance && (MissionHeader->type & 4) == 0)
|
||||
if (dist < target->s.car.maxDistance && (MissionHeader->type & 4) == 0)
|
||||
{
|
||||
TriggerChase(&slot, target->car.cutscene);
|
||||
TriggerChase(&slot, target->s.car.cutscene);
|
||||
|
||||
target->car.cutscene = -1;
|
||||
target->car.slot = slot;
|
||||
target->s.car.cutscene = -1;
|
||||
target->s.car.slot = slot;
|
||||
|
||||
player[0].targetCarId = slot;
|
||||
Mission.ChaseTarget = target;
|
||||
@ -2250,13 +2250,13 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cp->totalDamage >= target->car.chasing.maxDamage)
|
||||
if (cp->totalDamage >= target->s.car.chasing.maxDamage)
|
||||
{
|
||||
if (NewLeadDelay != 1)
|
||||
{
|
||||
if (target->car.flags & CARTARGET_FLAG_TO_BE_STOLEN)
|
||||
if (target->s.car.flags & CARTARGET_FLAG_TO_BE_STOLEN)
|
||||
{
|
||||
DamageBar.position = target->car.chasing.maxDamage;
|
||||
DamageBar.position = target->s.car.chasing.maxDamage;
|
||||
|
||||
cp->totalDamage = MaxPlayerDamage[0];
|
||||
|
||||
@ -2269,7 +2269,7 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
{
|
||||
ret = 0;
|
||||
|
||||
DamageBar.position = target->car.chasing.maxDamage;
|
||||
DamageBar.position = target->s.car.chasing.maxDamage;
|
||||
|
||||
cp->totalDamage = MaxPlayerDamage[0] - 1;
|
||||
SetConfusedCar(slot);
|
||||
@ -2285,18 +2285,18 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
}
|
||||
}
|
||||
|
||||
if (target->car.flags & CARTARGET_FLAG_THROWS_BOMBS)
|
||||
if (target->s.car.flags & CARTARGET_FLAG_THROWS_BOMBS)
|
||||
{
|
||||
gBombTargetVehicle = &car_data[slot];
|
||||
}
|
||||
}
|
||||
|
||||
switch(target->car.flags & 0xf0)
|
||||
switch(target->s.car.flags & 0xf0)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
// check damage
|
||||
if (target->car.chasing.maxDamage > 0)
|
||||
if (target->s.car.chasing.maxDamage > 0)
|
||||
{
|
||||
// first we init damage bar
|
||||
if (DamageBar.active == 0)
|
||||
@ -2304,14 +2304,14 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
if (gCurrentMissionNumber != 2 &&
|
||||
gCurrentMissionNumber != 6)
|
||||
{
|
||||
EnablePercentageBar(&DamageBar, target->car.chasing.maxDamage);
|
||||
EnablePercentageBar(&DamageBar, target->s.car.chasing.maxDamage);
|
||||
}
|
||||
|
||||
if (gCurrentMissionNumber == 11 ||
|
||||
gCurrentMissionNumber == 13 ||
|
||||
gCurrentMissionNumber == 26)
|
||||
{
|
||||
target->car.chasing.maxDamage = (target->car.chasing.maxDamage * 3) / 4;
|
||||
target->s.car.chasing.maxDamage = (target->s.car.chasing.maxDamage * 3) / 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2326,7 +2326,7 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
|
||||
SetConfusedCar(slot);
|
||||
|
||||
if (target->car.flags & CARTARGET_FLAG_PED_ESCAPES)
|
||||
if (target->s.car.flags & CARTARGET_FLAG_PED_ESCAPES)
|
||||
{
|
||||
cp->controlFlags &= ~CONTROL_FLAG_WAS_PARKED;
|
||||
|
||||
@ -2337,7 +2337,7 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
CreatePedAtLocation(&pos, 8);
|
||||
}
|
||||
|
||||
if (target->car.flags & CARTARGET_FLAG_TO_BE_STOLEN)
|
||||
if (target->s.car.flags & CARTARGET_FLAG_TO_BE_STOLEN)
|
||||
{
|
||||
SetCarToBeStolen(target, thread->player);
|
||||
|
||||
@ -2357,7 +2357,7 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
// check distance
|
||||
if (dist > TAIL_TOOFAR)
|
||||
{
|
||||
message = MissionStrings + target->car.chasing.tooFarMessage;
|
||||
message = MissionStrings + target->s.car.chasing.tooFarMessage;
|
||||
|
||||
SetPlayerMessage(thread->player, message, 2, 2);
|
||||
SetMissionFailed(FAILED_MESSAGESET);
|
||||
@ -2367,9 +2367,9 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
|
||||
if (dist > TAIL_GETTINGFAR)
|
||||
{
|
||||
if (target->car.chasing.gettingFarMessage != 255 && TAIL_GETTINGFAR != lastsay)
|
||||
if (target->s.car.chasing.gettingFarMessage != 255 && TAIL_GETTINGFAR != lastsay)
|
||||
{
|
||||
MissionSay(target->car.chasing.gettingFarMessage);
|
||||
MissionSay(target->s.car.chasing.gettingFarMessage);
|
||||
lastsay = TAIL_GETTINGFAR;
|
||||
}
|
||||
|
||||
@ -2391,7 +2391,7 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
if (dist < TAIL_TOOCLOSE)
|
||||
{
|
||||
int messageId;
|
||||
messageId = target->car.tail.closeMessages >> 0xc & 0xfff;
|
||||
messageId = target->s.car.tail.closeMessages >> 0xc & 0xfff;
|
||||
|
||||
if (messageId != 0xfff)
|
||||
{
|
||||
@ -2407,7 +2407,7 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
if (dist < TAIL_GETTINGCLOSE)
|
||||
{
|
||||
int messageId;
|
||||
messageId = target->car.tail.closeMessages & 0xfff;
|
||||
messageId = target->s.car.tail.closeMessages & 0xfff;
|
||||
|
||||
if (messageId != 0xfff)
|
||||
{
|
||||
@ -2415,7 +2415,7 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
SetPlayerMessage(thread->player, message, 2, 1);
|
||||
}
|
||||
|
||||
phrase = target->car.tail.closeMessages >> 24 & 0xFF;
|
||||
phrase = target->s.car.tail.closeMessages >> 24 & 0xFF;
|
||||
|
||||
if (phrase != 0xff && lastsay != TAIL_GETTINGCLOSE)
|
||||
{
|
||||
@ -2429,7 +2429,7 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
if (dist > TAIL_TOOFAR)
|
||||
{
|
||||
int messageId;
|
||||
messageId = target->car.tail.farMessages >> 0xc & 0xfff;
|
||||
messageId = target->s.car.tail.farMessages >> 0xc & 0xfff;
|
||||
|
||||
if (messageId != 0xfff)
|
||||
{
|
||||
@ -2445,7 +2445,7 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
if (dist > TAIL_GETTINGFAR)
|
||||
{
|
||||
int messageId;
|
||||
messageId = target->car.tail.farMessages & 0xfff;
|
||||
messageId = target->s.car.tail.farMessages & 0xfff;
|
||||
|
||||
if (messageId != 0xfff)
|
||||
{
|
||||
@ -2453,7 +2453,7 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
SetPlayerMessage(thread->player, message, 2, 1);
|
||||
}
|
||||
|
||||
phrase = target->car.tail.farMessages >> 24 & 0xFF;
|
||||
phrase = target->s.car.tail.farMessages >> 24 & 0xFF;
|
||||
|
||||
if (phrase != 0xff && lastsay != TAIL_GETTINGFAR)
|
||||
{
|
||||
@ -2521,9 +2521,9 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
}
|
||||
case CARTARGET_FLAG_CnR_TARGET:
|
||||
{
|
||||
if(target->target_flags & TARGET_FLAG_CAR_PLAYERCONTROLLED)
|
||||
if(target->s.target_flags & TARGET_FLAG_CAR_PLAYERCONTROLLED)
|
||||
{
|
||||
MaxPlayerDamage[1] = target->car.chasing.maxDamage;
|
||||
MaxPlayerDamage[1] = target->s.car.chasing.maxDamage;
|
||||
|
||||
if (dist > TAIL_TOOFAR)
|
||||
{
|
||||
@ -2533,7 +2533,7 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
break;
|
||||
}
|
||||
|
||||
message = MissionStrings + target->car.chasing.tooFarMessage;
|
||||
message = MissionStrings + target->s.car.chasing.tooFarMessage;
|
||||
|
||||
SetPlayerMessage(thread->player, message, 2, 2);
|
||||
SetMissionFailed(FAILED_MESSAGESET);
|
||||
@ -2541,12 +2541,12 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
}
|
||||
}
|
||||
|
||||
if (cp->totalDamage >= target->car.chasing.maxDamage)
|
||||
if (cp->totalDamage >= target->s.car.chasing.maxDamage)
|
||||
{
|
||||
ret = 1;
|
||||
|
||||
// idk what it makes
|
||||
if (!(target->target_flags & TARGET_FLAG_CAR_PLAYERCONTROLLED))
|
||||
if (!(target->s.target_flags & TARGET_FLAG_CAR_PLAYERCONTROLLED))
|
||||
{
|
||||
SetConfusedCar(slot);
|
||||
}
|
||||
@ -2558,14 +2558,14 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
}
|
||||
else
|
||||
{
|
||||
target->car.slot = -1;
|
||||
target->s.car.slot = -1;
|
||||
|
||||
if (gCarWithABerm == slot)
|
||||
gCarWithABerm = -1;
|
||||
|
||||
if (target->car.type != 1)
|
||||
if (target->s.car.type != 1)
|
||||
{
|
||||
message = MissionStrings + target->car.chasing.tooFarMessage;
|
||||
message = MissionStrings + target->s.car.chasing.tooFarMessage;
|
||||
SetPlayerMessage(thread->player, message, 2, 2);
|
||||
SetMissionFailed(FAILED_MESSAGESET);
|
||||
}
|
||||
@ -2575,20 +2575,20 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
}
|
||||
case Target_Event: // event target
|
||||
{
|
||||
if (target->target_flags & TARGET_FLAG_EVENT_TRIGGERED)
|
||||
if (target->s.target_flags & TARGET_FLAG_EVENT_TRIGGERED)
|
||||
{
|
||||
// [A] Ahhhh, 32 bit pointers... for future full-scale refactoring
|
||||
if (target->event.loseMessage != -1 && Long2DDistance(target->event.eventPos, &pv) > 30000)
|
||||
if (target->s.event.loseMessage != -1 && Long2DDistance(target->s.event.eventPos, &pv) > 30000)
|
||||
{
|
||||
message = MissionStrings + target->event.loseMessage;
|
||||
message = MissionStrings + target->s.event.loseMessage;
|
||||
SetPlayerMessage(thread->player, message, 2, 2);
|
||||
SetMissionFailed(FAILED_MESSAGESET);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
target->event.eventPos = TriggerEvent(target->event.eventId);
|
||||
target->target_flags |= TARGET_FLAG_EVENT_TRIGGERED;
|
||||
target->s.event.eventPos = TriggerEvent(target->s.event.eventId);
|
||||
target->s.target_flags |= TARGET_FLAG_EVENT_TRIGGERED;
|
||||
}
|
||||
|
||||
break;
|
||||
@ -2598,12 +2598,12 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
|
||||
if (ret)
|
||||
{
|
||||
// keep only those flags
|
||||
target->target_flags &= ~TARGET_FLAG_COMPLETED_ALLP;
|
||||
target->s.target_flags &= ~TARGET_FLAG_COMPLETED_ALLP;
|
||||
|
||||
if (thread->player == 0)
|
||||
target->target_flags |= TARGET_FLAG_COMPLETED_P1;
|
||||
target->s.target_flags |= TARGET_FLAG_COMPLETED_P1;
|
||||
else
|
||||
target->target_flags |= TARGET_FLAG_COMPLETED_P2;
|
||||
target->s.target_flags |= TARGET_FLAG_COMPLETED_P2;
|
||||
|
||||
if (GameType == GAME_CHECKPOINT)
|
||||
{
|
||||
@ -2656,20 +2656,20 @@ int MRCreateCar(MS_TARGET *target)
|
||||
LONGVECTOR4 pos;
|
||||
char playerid;
|
||||
|
||||
pos[0] = target->car.posX;
|
||||
pos[2] = target->car.posZ;
|
||||
pos[0] = target->s.car.posX;
|
||||
pos[2] = target->s.car.posZ;
|
||||
pos[1] = 10000;
|
||||
|
||||
if (target->car.type == 2)
|
||||
if (target->s.car.type == 2)
|
||||
{
|
||||
curslot = PingInCivCar(666); // put Rio limo
|
||||
curslot--;
|
||||
}
|
||||
else
|
||||
{
|
||||
curslot = CreateStationaryCivCar(target->car.rotation, 0,
|
||||
((target->car.flags & CARTARGET_FLAG_FLIPPED) != 0) << 10, &pos,
|
||||
target->car.model, target->car.palette, (target->car.flags & CARTARGET_FLAG_ISCOP) != 0);
|
||||
curslot = CreateStationaryCivCar(target->s.car.rotation, 0,
|
||||
((target->s.car.flags & CARTARGET_FLAG_FLIPPED) != 0) << 10, &pos,
|
||||
target->s.car.model, target->s.car.palette, (target->s.car.flags & CARTARGET_FLAG_ISCOP) != 0);
|
||||
}
|
||||
|
||||
if (curslot < 0)
|
||||
@ -2678,7 +2678,7 @@ int MRCreateCar(MS_TARGET *target)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (target->car.flags & CARTARGET_FLAG_ISCOP)
|
||||
if (target->s.car.flags & CARTARGET_FLAG_ISCOP)
|
||||
{
|
||||
newslot = NumReplayStreams + cop_adjust;
|
||||
cop_adjust++;
|
||||
@ -2689,28 +2689,28 @@ int MRCreateCar(MS_TARGET *target)
|
||||
Mission.CarTarget = NULL;
|
||||
requestStationaryCivCar = 0;
|
||||
|
||||
if (target->car.type == 3 && !(target->car.flags & CARTARGET_FLAG_RANDOMCHASE))
|
||||
if (target->s.car.type == 3 && !(target->s.car.flags & CARTARGET_FLAG_RANDOMCHASE))
|
||||
{
|
||||
playerid = 0xFF;
|
||||
|
||||
InitPlayer((PLAYER *)(player + 1), &car_data[curslot],
|
||||
CONTROL_TYPE_LEAD_AI, target->car.rotation, &pos,
|
||||
target->car.model, target->car.palette, (char *)&playerid);
|
||||
InitPlayer((PLAYER *)(player + 1), &car_data[curslot],
|
||||
CONTROL_TYPE_LEAD_AI, target->s.car.rotation, &pos,
|
||||
target->s.car.model, target->s.car.palette, (char *)&playerid);
|
||||
|
||||
EnablePercentageBar(&DamageBar, target->car.chasing.maxDamage);
|
||||
EnablePercentageBar(&DamageBar, target->s.car.chasing.maxDamage);
|
||||
NewLeadDelay = 0;
|
||||
}
|
||||
|
||||
target->car.posX = car_data[curslot].hd.where.t[0];
|
||||
target->car.posZ = car_data[curslot].hd.where.t[2];
|
||||
target->s.car.posX = car_data[curslot].hd.where.t[0];
|
||||
target->s.car.posZ = car_data[curslot].hd.where.t[2];
|
||||
|
||||
target->car.slot = curslot;
|
||||
target->target_flags |= TARGET_FLAG_CAR_PINGED_IN;
|
||||
target->s.car.slot = curslot;
|
||||
target->s.target_flags |= TARGET_FLAG_CAR_PINGED_IN;
|
||||
|
||||
car_data[curslot].inform = &target->target_flags;
|
||||
car_data[curslot].inform = &target->s.target_flags;
|
||||
|
||||
// make fully damaged (Car bomb escape)
|
||||
if (target->car.flags & CARTARGET_FLAG_DAMAGED)
|
||||
if (target->s.car.flags & CARTARGET_FLAG_DAMAGED)
|
||||
{
|
||||
car_data[curslot].totalDamage = 65535;
|
||||
car_data[curslot].ap.damage[0] = 4095;
|
||||
@ -2722,7 +2722,7 @@ int MRCreateCar(MS_TARGET *target)
|
||||
car_data[curslot].ap.needsDenting = 1;
|
||||
}
|
||||
|
||||
if (target->car.flags & CARTARGET_FLAG_DETONATOR)
|
||||
if (target->s.car.flags & CARTARGET_FLAG_DETONATOR)
|
||||
gCarWithABerm = curslot;
|
||||
|
||||
return 1;
|
||||
@ -2745,45 +2745,45 @@ void PreProcessTargets(void)
|
||||
target = &MissionTargets[i];
|
||||
|
||||
if (target->type == Target_Player2Start ||
|
||||
target->type == Target_Car && (target->target_flags & TARGET_FLAG_CAR_PLAYERCONTROLLED))
|
||||
target->type == Target_Car && (target->s.target_flags & TARGET_FLAG_CAR_PLAYERCONTROLLED))
|
||||
{
|
||||
PlayerStartInfo[1] = &ReplayStreams[1].SourceType;
|
||||
|
||||
ReplayStreams[1].SourceType.type = 1;
|
||||
ReplayStreams[1].SourceType.position.vx = target->car.posX;
|
||||
ReplayStreams[1].SourceType.position.vx = target->s.car.posX;
|
||||
ReplayStreams[1].SourceType.position.vy = 0;
|
||||
ReplayStreams[1].SourceType.position.vz = target->car.posZ;
|
||||
ReplayStreams[1].SourceType.rotation = target->car.rotation;
|
||||
ReplayStreams[1].SourceType.model = target->car.model;
|
||||
ReplayStreams[1].SourceType.palette = target->car.palette;
|
||||
ReplayStreams[1].SourceType.position.vz = target->s.car.posZ;
|
||||
ReplayStreams[1].SourceType.rotation = target->s.car.rotation;
|
||||
ReplayStreams[1].SourceType.model = target->s.car.model;
|
||||
ReplayStreams[1].SourceType.palette = target->s.car.palette;
|
||||
ReplayStreams[1].SourceType.controlType = CONTROL_TYPE_PLAYER;
|
||||
ReplayStreams[1].SourceType.flags = 0;
|
||||
|
||||
if (target->car.type & 0x3)
|
||||
target->car.cutscene = -1;
|
||||
if (target->s.car.type & 0x3)
|
||||
target->s.car.cutscene = -1;
|
||||
|
||||
target->car.slot = 1;
|
||||
target->target_flags |= TARGET_FLAG_CAR_PINGED_IN;
|
||||
target->s.car.slot = 1;
|
||||
target->s.target_flags |= TARGET_FLAG_CAR_PINGED_IN;
|
||||
}
|
||||
|
||||
if (target->type == Target_Point)
|
||||
{
|
||||
if ((target->target_flags & TARGET_FLAG_POINT_CTF_FLAG) == TARGET_FLAG_POINT_CTF_FLAG)
|
||||
if ((target->s.target_flags & TARGET_FLAG_POINT_CTF_FLAG) == TARGET_FLAG_POINT_CTF_FLAG)
|
||||
{
|
||||
target->target_flags |= TARGET_FLAG_COMPLETED_ALLP;
|
||||
target->s.target_flags |= TARGET_FLAG_COMPLETED_ALLP;
|
||||
}
|
||||
|
||||
if (target->target_flags & TARGET_FLAG_POINT_ON_BOAT)
|
||||
if (target->s.target_flags & TARGET_FLAG_POINT_ON_BOAT)
|
||||
{
|
||||
target->point.boatOffsetX = target->point.posX;
|
||||
target->point.boatOffsetZ = target->point.posZ;
|
||||
target->s.point.boatOffsetX = target->s.point.posX;
|
||||
target->s.point.boatOffsetZ = target->s.point.posZ;
|
||||
}
|
||||
}
|
||||
else if (target->type == Target_Car)
|
||||
{
|
||||
if ((target->target_flags & TARGET_FLAG_CAR_PLAYERCONTROLLED) == 0)
|
||||
if ((target->s.target_flags & TARGET_FLAG_CAR_PLAYERCONTROLLED) == 0)
|
||||
{
|
||||
if (target->car.type == 3 && (target->car.flags & CARTARGET_FLAG_RANDOMCHASE))
|
||||
if (target->s.car.type == 3 && (target->s.car.flags & CARTARGET_FLAG_RANDOMCHASE))
|
||||
{
|
||||
PreLoadInGameCutscene(gRandomChase);
|
||||
}
|
||||
@ -2980,9 +2980,9 @@ void CompleteAllActiveTargets(int player)
|
||||
pTarget = &MissionTargets[i];
|
||||
|
||||
if (pTarget->type >= Target_Point &&
|
||||
pTarget->type <= Target_Event && (pTarget->target_flags & flag1))
|
||||
pTarget->type <= Target_Event && (pTarget->s.target_flags & flag1))
|
||||
{
|
||||
pTarget->target_flags |= flag2;
|
||||
pTarget->s.target_flags |= flag2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3090,7 +3090,7 @@ void ActivateNextFlag(void)
|
||||
if (last_flag == -1)
|
||||
last_flag = 0;
|
||||
else
|
||||
MissionTargets[last_flag].target_flags |= TARGET_FLAG_COMPLETED_ALLP;
|
||||
MissionTargets[last_flag].s.target_flags |= TARGET_FLAG_COMPLETED_ALLP;
|
||||
|
||||
j = last_flag;
|
||||
|
||||
@ -3102,11 +3102,11 @@ void ActivateNextFlag(void)
|
||||
|
||||
target = &MissionTargets[j];
|
||||
|
||||
if (target->type == Target_Point && (target->target_flags & TARGET_FLAG_POINT_CTF_FLAG) == TARGET_FLAG_POINT_CTF_FLAG)
|
||||
if (target->type == Target_Point && (target->s.target_flags & TARGET_FLAG_POINT_CTF_FLAG) == TARGET_FLAG_POINT_CTF_FLAG)
|
||||
break;
|
||||
}
|
||||
|
||||
target->target_flags &= ~TARGET_FLAG_COMPLETED_ALLP;
|
||||
target->s.target_flags &= ~TARGET_FLAG_COMPLETED_ALLP;
|
||||
last_flag = j;
|
||||
}
|
||||
|
||||
@ -3139,13 +3139,13 @@ void MakePhantomCarEqualPlayerCar(void)
|
||||
// [D] [T]
|
||||
void SetCarToBeStolen(MS_TARGET *target, int player)
|
||||
{
|
||||
if (target->car.flags & CARTARGET_FLAG_SET_PLAYERCAR)
|
||||
if (target->s.car.flags & CARTARGET_FLAG_SET_PLAYERCAR)
|
||||
MakePhantomCarEqualPlayerCar();
|
||||
|
||||
target->target_flags |= TARGET_FLAG_CAR_SAVED;
|
||||
target->car.type = 1;
|
||||
target->car.flags = CARTARGET_FLAG_STEAL_TARGET;
|
||||
target->car.maxDistance = 0;
|
||||
target->s.target_flags |= TARGET_FLAG_CAR_SAVED;
|
||||
target->s.car.type = 1;
|
||||
target->s.car.flags = CARTARGET_FLAG_STEAL_TARGET;
|
||||
target->s.car.maxDistance = 0;
|
||||
|
||||
SetPlayerMessage(player, Mission.StealMessage, 2, 2);
|
||||
}
|
||||
|
@ -542,7 +542,7 @@ void DrawBodySprite(PEDESTRIAN* pDrawingPed, int boneId, VERTTYPE v1[2], VERTTYP
|
||||
if (bone == JOINT_1)
|
||||
{
|
||||
// make ped thinner from side view
|
||||
uint ang;
|
||||
u_int ang;
|
||||
ang = rcossin_tbl[((pDrawingPed->dir.vy + camera_angle.vy) * 4 & 0xfffU) + 1] >> 6;
|
||||
|
||||
z2 += ang;
|
||||
@ -1427,7 +1427,7 @@ void DrawCiv(PEDESTRIAN* pPed)
|
||||
int boneId;
|
||||
int frame;
|
||||
int i, j;
|
||||
uint phase;
|
||||
u_int phase;
|
||||
SVECTOR pos;
|
||||
VECTOR pos1;
|
||||
SVECTOR rot;
|
||||
|
@ -786,7 +786,7 @@ int QuickBuildingCollisionCheck(VECTOR *pPos, int dir, int l, int w, int extra)
|
||||
int count;
|
||||
int num_cb;
|
||||
MODEL *model;
|
||||
uint yang;
|
||||
u_int yang;
|
||||
int sphereSq;
|
||||
COLLISION_PACKET *collide;
|
||||
CELL_OBJECT *cop;
|
||||
|
@ -645,7 +645,7 @@ void DrawCompass(void)
|
||||
void DrawBigCompass(VECTOR *root, int angle)
|
||||
{
|
||||
int i;
|
||||
uint ang2;
|
||||
u_int ang2;
|
||||
LINE_G2 *lineg2;
|
||||
int ang;
|
||||
int ang3;
|
||||
|
@ -212,9 +212,9 @@ void DebugDisplayObstacleMap()
|
||||
// [D] [T]
|
||||
tNode* popNode(tNode* __return_storage_ptr__)
|
||||
{
|
||||
uint child;
|
||||
u_int child;
|
||||
ushort d;
|
||||
uint here;
|
||||
u_int here;
|
||||
tNode res;
|
||||
|
||||
res = heap[1];
|
||||
@ -394,7 +394,7 @@ void BloodyHell(void)
|
||||
int p;
|
||||
int q;
|
||||
int px, pz;
|
||||
uint howMany;
|
||||
u_int howMany;
|
||||
int count;
|
||||
VECTOR bPos;
|
||||
int tile, i;
|
||||
@ -520,9 +520,9 @@ void iterate(void)
|
||||
ushort nr;
|
||||
ushort nl;
|
||||
int a;
|
||||
uint pnode;
|
||||
uint parent;
|
||||
uint i;
|
||||
u_int pnode;
|
||||
u_int parent;
|
||||
u_int i;
|
||||
int r;
|
||||
|
||||
if (numHeapEntries == 0)
|
||||
@ -878,8 +878,8 @@ void UpdateCopMap(void)
|
||||
int i, maxret;
|
||||
int res;
|
||||
tNode startNode;
|
||||
uint pnode;
|
||||
uint parent;
|
||||
u_int pnode;
|
||||
u_int parent;
|
||||
|
||||
BloodyHell();
|
||||
|
||||
|
@ -344,7 +344,7 @@ void PlaceRoadBlockCops(void)
|
||||
int wbody;
|
||||
int lbody;
|
||||
int cs, sn;
|
||||
uint dir;
|
||||
u_int dir;
|
||||
CAR_DATA* cp;
|
||||
CAR_DATA* pCar;
|
||||
int i;
|
||||
@ -732,7 +732,7 @@ CAR_DATA* pCivCarToGetIn = NULL;
|
||||
// [D] [T]
|
||||
void CivGetIn(PEDESTRIAN* pPed) // [A] UNUSED
|
||||
{
|
||||
uint padid;
|
||||
u_int padid;
|
||||
DRIVER2_CURVE* curve;
|
||||
DRIVER2_STRAIGHT* straight;
|
||||
|
||||
@ -1095,7 +1095,7 @@ void SetupGetOutCar(PEDESTRIAN* pPed, CAR_DATA* pCar, int side)
|
||||
{
|
||||
bool entrySide;
|
||||
int sn, cs;
|
||||
uint carDir;
|
||||
u_int carDir;
|
||||
int xOfs;
|
||||
int playerId;
|
||||
|
||||
@ -2567,7 +2567,7 @@ void IHaveThePower(void)
|
||||
}
|
||||
|
||||
// [D] [T]
|
||||
void ProcessTannerPad(PEDESTRIAN* pPed, uint pad, char PadSteer, char use_analogue)
|
||||
void ProcessTannerPad(PEDESTRIAN* pPed, u_int pad, char PadSteer, char use_analogue)
|
||||
{
|
||||
sdPlane* SurfacePtr;
|
||||
int direction;
|
||||
|
@ -22,7 +22,7 @@ void InitPlayer(PLAYER *locPlayer, CAR_DATA *cp, char carCtrlType, int direction
|
||||
{
|
||||
int playerId;
|
||||
int model;
|
||||
uint playerType;
|
||||
u_int playerType;
|
||||
|
||||
playerType = externModel & 0xFF;
|
||||
ClearMem((char *)locPlayer, sizeof(PLAYER));
|
||||
|
@ -225,7 +225,7 @@ int PrintString(char *string, int x, int y)
|
||||
{
|
||||
u_char chr;
|
||||
int width;
|
||||
uint index;
|
||||
u_int index;
|
||||
SPRT *font;
|
||||
|
||||
int showMap = gShowMap;
|
||||
|
@ -74,7 +74,7 @@ void InitPadRecording(void)
|
||||
|
||||
// FIXME: is that correct?
|
||||
bufferEnd = replayptr-13380;
|
||||
remain = (uint)ReplayStart - (uint)bufferEnd - CalcInGameCutsceneSize();
|
||||
remain = (u_int)ReplayStart - (u_int)bufferEnd - CalcInGameCutsceneSize();
|
||||
|
||||
for (i = 0; i < NumPlayers; i++)
|
||||
{
|
||||
@ -671,7 +671,7 @@ int Get(int stream, u_int *pt0)
|
||||
|
||||
if (rstream->PadRecordBuffer + 1 <= rstream->PadRecordBufferEnd)
|
||||
{
|
||||
uint t0 = (rstream->PadRecordBuffer->pad << 8) | rstream->PadRecordBuffer->analogue;
|
||||
u_int t0 = (rstream->PadRecordBuffer->pad << 8) | rstream->PadRecordBuffer->analogue;
|
||||
*pt0 = t0;
|
||||
|
||||
if (rstream->playbackrun < rstream->PadRecordBuffer->run)
|
||||
@ -856,7 +856,7 @@ void AllocateReplayStream(REPLAY_STREAM *stream, int maxpad)
|
||||
stream->InitialPadRecordBuffer->run = 238;
|
||||
}
|
||||
|
||||
replayptr = (char *)(((uint)replayptr + (maxpad+1) * sizeof(PADRECORD)) & -4);
|
||||
replayptr = (char *)(((u_int)replayptr + (maxpad+1) * sizeof(PADRECORD)) & -4);
|
||||
}
|
||||
|
||||
// [D] [T]
|
||||
|
@ -61,7 +61,7 @@ void ResetTyreTracks(CAR_DATA* cp, int player_id)
|
||||
void GetTyreTrackPositions(CAR_DATA *cp, int player_id)
|
||||
{
|
||||
int track;
|
||||
uint loop;
|
||||
u_int loop;
|
||||
CAR_COSMETICS *car_cos;
|
||||
VECTOR WheelPos;
|
||||
VECTOR CarPos;
|
||||
@ -343,8 +343,8 @@ void DrawTyreTracks(void)
|
||||
gte_ldv0(&ps[3]);
|
||||
gte_rtps();
|
||||
|
||||
*(uint *)&poly->x0 = *(uint *)&lasttyre->x2;
|
||||
*(uint *)&poly->x1 = *(uint *)&lasttyre->x3;
|
||||
*(u_int *)&poly->x0 = *(u_int *)&lasttyre->x2;
|
||||
*(u_int *)&poly->x1 = *(u_int *)&lasttyre->x3;
|
||||
|
||||
gte_stsxy(&poly->x3);
|
||||
}
|
||||
@ -502,8 +502,8 @@ void PlaceShadowForCar(VECTOR *shadowPoints, int subdiv, int zOfs, int flag)
|
||||
|
||||
POLYFT4* pft4 = &shadowpoly;
|
||||
|
||||
plotContext.clut = (uint)(*plotContext.ptexture_cluts)[pft4->texture_set][pft4->texture_id] << 0x10;
|
||||
plotContext.tpage = ((uint)(*plotContext.ptexture_pages)[pft4->texture_set] | 0x40) << 0x10;
|
||||
plotContext.clut = (u_int)(*plotContext.ptexture_cluts)[pft4->texture_set][pft4->texture_id] << 0x10;
|
||||
plotContext.tpage = ((u_int)(*plotContext.ptexture_pages)[pft4->texture_set] | 0x40) << 0x10;
|
||||
|
||||
copyVector(&subdivVerts[0][0], &points[pft4->v0]);
|
||||
subdivVerts[0][0].uv.val = *(ushort*)&pft4->uv0;
|
||||
@ -669,7 +669,7 @@ void clippedPoly(void)
|
||||
short *psVar9;
|
||||
int iVar10;
|
||||
int iVar11;
|
||||
uint *puVar12;
|
||||
u_int *puVar12;
|
||||
|
||||
pPVar4 = spolys;
|
||||
iVar11 = numcv + -1;
|
||||
@ -726,7 +726,7 @@ void clippedPoly(void)
|
||||
psVar8 = &(&cv)[lastcv].vy;
|
||||
do {
|
||||
iVar11 = iVar11 + -1;
|
||||
psVar8[1] = (short)((int)(((uint)(ushort)psVar8[1] + (int)*psVar8 * -2) * 0x10000) >>
|
||||
psVar8[1] = (short)((int)(((u_int)(ushort)psVar8[1] + (int)*psVar8 * -2) * 0x10000) >>
|
||||
0x11);
|
||||
psVar8 = psVar8 + -4;
|
||||
} while (iVar11 != -1);
|
||||
@ -772,8 +772,8 @@ void clippedPoly(void)
|
||||
iVar10 = 8;
|
||||
}
|
||||
spolys->tag = spolys->tag & 0xff000000 | current->ot[iVar10] & 0xffffff;
|
||||
puVar12 = (uint *)&spolys[1].x0;
|
||||
pDVar5->ot[iVar10] = pDVar5->ot[iVar10] & 0xff000000 | (uint)spolys & 0xffffff;
|
||||
puVar12 = (u_int *)&spolys[1].x0;
|
||||
pDVar5->ot[iVar10] = pDVar5->ot[iVar10] & 0xff000000 | (u_int)spolys & 0xffffff;
|
||||
*(undefined *)((int)&spolys[1].y0 + 1) = 7;
|
||||
*(undefined *)((int)&spolys[1].y1 + 1) = 0x24;
|
||||
pDVar5 = current;
|
||||
@ -787,7 +787,7 @@ void clippedPoly(void)
|
||||
*puVar12 = *puVar12 & 0xff000000 | pDVar5->ot[iVar10] & 0xffffff;
|
||||
iVar11 = iVar11 + -1;
|
||||
in_a1 = pDVar5->ot + iVar10;
|
||||
*in_a1 = *in_a1 & 0xff000000 | (uint)puVar12 & 0xffffff;
|
||||
*in_a1 = *in_a1 & 0xff000000 | (u_int)puVar12 & 0xffffff;
|
||||
spolys = (POLY_F3 *)&spolys[2].x2;
|
||||
pDVar5->primptr = pDVar5->primptr + 0x20;
|
||||
iVar3 = iVar3 + -1;
|
||||
|
@ -576,7 +576,7 @@ void DrawLensFlare(void)
|
||||
xgap = sun_pers_conv_position.vx - 160;
|
||||
ygap = sun_pers_conv_position.vy - 128;
|
||||
|
||||
//sun_pers_conv_position.vy = (short)((uint)sun_pers_conv_position >> 0x10);
|
||||
//sun_pers_conv_position.vy = (short)((u_int)sun_pers_conv_position >> 0x10);
|
||||
|
||||
distance_to_sun = SquareRoot0(xgap * xgap + ygap * ygap);
|
||||
|
||||
@ -874,10 +874,10 @@ void PlotSkyPoly(POLYFT4* polys, int skytexnum, unsigned char r, unsigned char g
|
||||
poly->g0 = g;
|
||||
poly->b0 = b;
|
||||
|
||||
*(uint*)&poly->x0 = *(uint*)&outpoints[src->v0].vx;
|
||||
*(uint*)&poly->x1 = *(uint*)&outpoints[src->v1].vx;
|
||||
*(uint*)&poly->x2 = *(uint*)&outpoints[src->v3].vx;
|
||||
*(uint*)&poly->x3 = *(uint*)&outpoints[src->v2].vx;
|
||||
*(u_int*)&poly->x0 = *(u_int*)&outpoints[src->v0].vx;
|
||||
*(u_int*)&poly->x1 = *(u_int*)&outpoints[src->v1].vx;
|
||||
*(u_int*)&poly->x2 = *(u_int*)&outpoints[src->v3].vx;
|
||||
*(u_int*)&poly->x3 = *(u_int*)&outpoints[src->v2].vx;
|
||||
|
||||
*(ushort*)&poly->u0 = *(ushort*)&skytexuv[skytexnum].u2;
|
||||
*(ushort*)&poly->u1 = *(ushort*)&skytexuv[skytexnum].u3;
|
||||
|
@ -540,7 +540,7 @@ int tsetinfo[32];
|
||||
void SendTPage(void)
|
||||
{
|
||||
unsigned char old;
|
||||
uint*clutptr;
|
||||
u_int*clutptr;
|
||||
int slot;
|
||||
int npalettes;
|
||||
int tpage2send;
|
||||
@ -573,7 +573,7 @@ void SendTPage(void)
|
||||
|
||||
LoadImage(&cluts, (u_long *)(model_spool_buffer + 0xE000 + 4));
|
||||
|
||||
clutptr = (uint*)(texture_cluts[tpage2send]);
|
||||
clutptr = (u_int*)(texture_cluts[tpage2send]);
|
||||
i = 0;
|
||||
|
||||
while (i < npalettes)
|
||||
@ -1498,8 +1498,8 @@ void unpack_cellpointers(int region_to_unpack, int target_barrel_region, char* c
|
||||
ushort* short_ptr;
|
||||
ushort* source_packed_data;
|
||||
int loop;
|
||||
uint bitpos;
|
||||
uint pcode;
|
||||
u_int bitpos;
|
||||
u_int pcode;
|
||||
|
||||
int packtype;
|
||||
|
||||
@ -1531,7 +1531,7 @@ void unpack_cellpointers(int region_to_unpack, int target_barrel_region, char* c
|
||||
else if (packtype == 2)
|
||||
{
|
||||
bitpos = 0x8000;
|
||||
pcode = (uint)*source_packed_data;
|
||||
pcode = (u_int)*source_packed_data;
|
||||
source_packed_data++;
|
||||
short_ptr = cell_ptrs + target_barrel_region * 1024;
|
||||
|
||||
@ -1579,7 +1579,7 @@ void Unpack_CellPtrs(void)
|
||||
// [D] [T]
|
||||
void GotRegion(void)
|
||||
{
|
||||
uint target_barrel_reg;
|
||||
u_int target_barrel_reg;
|
||||
|
||||
Unpack_CellPtrs();
|
||||
|
||||
|
@ -181,22 +181,22 @@ void ClearMem(char* mem, int size)
|
||||
char* end;
|
||||
end = mem + size;
|
||||
|
||||
while ((((uint)mem & 3) != 0 && (mem < end))) {
|
||||
while ((((u_int)mem & 3) != 0 && (mem < end))) {
|
||||
*mem = 0;
|
||||
mem = (char*)((int)mem + 1);
|
||||
}
|
||||
|
||||
while (mem <= end + -0x10) {
|
||||
*(uint*)mem = 0;
|
||||
((uint*)mem)[1] = 0;
|
||||
((uint*)mem)[2] = 0;
|
||||
((uint*)mem)[3] = 0;
|
||||
mem = (char*)((uint*)mem + 4);
|
||||
*(u_int*)mem = 0;
|
||||
((u_int*)mem)[1] = 0;
|
||||
((u_int*)mem)[2] = 0;
|
||||
((u_int*)mem)[3] = 0;
|
||||
mem = (char*)((u_int*)mem + 4);
|
||||
}
|
||||
|
||||
while (mem <= end + -4) {
|
||||
*(uint*)mem = 0;
|
||||
mem = (char*)((uint*)mem + 1);
|
||||
*(u_int*)mem = 0;
|
||||
mem = (char*)((u_int*)mem + 1);
|
||||
}
|
||||
|
||||
while (mem < end) {
|
||||
|
@ -113,7 +113,7 @@ void WorldToCameraPositions(VECTOR* pGlobalPositionIn, VECTOR* pCameraPositionOu
|
||||
// [D] [T]
|
||||
void DrawTargetArrowModel(TARGET_ARROW_MODEL *pTargetArrowModel, VECTOR *pPosition, int shadow, int invert)
|
||||
{
|
||||
uint numTris;
|
||||
u_int numTris;
|
||||
VECTOR *cameraPos;
|
||||
|
||||
char *tri_indices;
|
||||
|
@ -221,20 +221,20 @@ void makeMesh(MVERTEX(*VSP)[5][5], int m, int n)
|
||||
v4 = (*VSP)[0][2];
|
||||
|
||||
VecSubtract(&e1, &v2, &v1); // plane[1] - plane[0];
|
||||
e1.uv.u0 = (v2.uv.u0 - v1.uv.u0) / 2;
|
||||
e1.uv.v0 = (v2.uv.v0 - v1.uv.v0) / 2;
|
||||
e1.uv.s.u0 = (v2.uv.s.u0 - v1.uv.s.u0) / 2;
|
||||
e1.uv.s.v0 = (v2.uv.s.v0 - v1.uv.s.v0) / 2;
|
||||
|
||||
VecSubtract(&e2, &v3, &v4); // plane[2] - plane[3];
|
||||
e2.uv.u0 = (v3.uv.u0 - v4.uv.u0) / 2;
|
||||
e2.uv.v0 = (v3.uv.v0 - v4.uv.v0) / 2;
|
||||
e2.uv.s.u0 = (v3.uv.s.u0 - v4.uv.s.u0) / 2;
|
||||
e2.uv.s.v0 = (v3.uv.s.v0 - v4.uv.s.v0) / 2;
|
||||
|
||||
VecSubtract(&e3, &v4, &v1); // plane[3] - plane[0];
|
||||
e3.uv.u0 = (v4.uv.u0 - v1.uv.u0) / 2;
|
||||
e3.uv.v0 = (v4.uv.v0 - v1.uv.v0) / 2;
|
||||
e3.uv.s.u0 = (v4.uv.s.u0 - v1.uv.s.u0) / 2;
|
||||
e3.uv.s.v0 = (v4.uv.s.v0 - v1.uv.s.v0) / 2;
|
||||
|
||||
VecSubtract(&e4, &v3, &v2); // plane[2] - plane[1];
|
||||
e4.uv.u0 = (v3.uv.u0 - v2.uv.u0) / 2;
|
||||
e4.uv.v0 = (v3.uv.v0 - v2.uv.v0) / 2;
|
||||
e4.uv.s.u0 = (v3.uv.s.u0 - v2.uv.s.u0) / 2;
|
||||
e4.uv.s.v0 = (v3.uv.s.v0 - v2.uv.s.v0) / 2;
|
||||
|
||||
//-----------
|
||||
|
||||
@ -250,33 +250,33 @@ void makeMesh(MVERTEX(*VSP)[5][5], int m, int n)
|
||||
//-----------
|
||||
|
||||
VecAdd(&p1, &e1, &v1); // e1 * 0.5f + plane[0];
|
||||
p1.uv.u0 = e1.uv.u0 + v1.uv.u0;
|
||||
p1.uv.v0 = e1.uv.v0 + v1.uv.v0;
|
||||
p1.uv.s.u0 = e1.uv.s.u0 + v1.uv.s.u0;
|
||||
p1.uv.s.v0 = e1.uv.s.v0 + v1.uv.s.v0;
|
||||
|
||||
VecAdd(&p2, &e2, &v4); // e2 * 0.5f + plane[3];
|
||||
p2.uv.u0 = e2.uv.u0 + v4.uv.u0;
|
||||
p2.uv.v0 = e2.uv.v0 + v4.uv.v0;
|
||||
p2.uv.s.u0 = e2.uv.s.u0 + v4.uv.s.u0;
|
||||
p2.uv.s.v0 = e2.uv.s.v0 + v4.uv.s.v0;
|
||||
|
||||
VecAdd(&p3, &e3, &v1); // e3 * 0.5f + plane[0];
|
||||
p3.uv.u0 = e3.uv.u0 + v1.uv.u0;
|
||||
p3.uv.v0 = e3.uv.v0 + v1.uv.v0;
|
||||
p3.uv.s.u0 = e3.uv.s.u0 + v1.uv.s.u0;
|
||||
p3.uv.s.v0 = e3.uv.s.v0 + v1.uv.s.v0;
|
||||
|
||||
VecAdd(&p4, &e4, &v2); // e4 * 0.5f + plane[1];
|
||||
p4.uv.u0 = e4.uv.u0 + v2.uv.u0;
|
||||
p4.uv.v0 = e4.uv.v0 + v2.uv.v0;
|
||||
p4.uv.s.u0 = e4.uv.s.u0 + v2.uv.s.u0;
|
||||
p4.uv.s.v0 = e4.uv.s.v0 + v2.uv.s.v0;
|
||||
|
||||
//-----------
|
||||
|
||||
VecSubtract(&e5, &p2, &p1); // p2 - p1;
|
||||
e5.uv.u0 = (p2.uv.u0 - p1.uv.u0) / 2;
|
||||
e5.uv.v0 = (p2.uv.v0 - p1.uv.v0) / 2;
|
||||
e5.uv.s.u0 = (p2.uv.s.u0 - p1.uv.s.u0) / 2;
|
||||
e5.uv.s.v0 = (p2.uv.s.v0 - p1.uv.s.v0) / 2;
|
||||
|
||||
SetVec(&e5, e5.vx / 2, e5.vy / 2, e5.vz / 2);
|
||||
|
||||
|
||||
VecAdd(&p5, &e5, &p1); // e5 * 0.5f + p1;
|
||||
p5.uv.u0 = e5.uv.u0 + p1.uv.u0;
|
||||
p5.uv.v0 = e5.uv.v0 + p1.uv.v0;
|
||||
p5.uv.s.u0 = e5.uv.s.u0 + p1.uv.s.u0;
|
||||
p5.uv.s.v0 = e5.uv.s.v0 + p1.uv.s.v0;
|
||||
|
||||
//-----------
|
||||
|
||||
@ -381,8 +381,8 @@ void SubdivNxM(char *polys, int n, int m, int ofse)
|
||||
|
||||
POLYFT4* pft4 = (POLYFT4*)polys;
|
||||
|
||||
plotContext.clut = (uint)(*plotContext.ptexture_cluts)[pft4->texture_set][pft4->texture_id] << 0x10;
|
||||
plotContext.tpage = (uint)(*plotContext.ptexture_pages)[pft4->texture_set] << 0x10;
|
||||
plotContext.clut = (u_int)(*plotContext.ptexture_cluts)[pft4->texture_set][pft4->texture_id] << 0x10;
|
||||
plotContext.tpage = (u_int)(*plotContext.ptexture_pages)[pft4->texture_set] << 0x10;
|
||||
|
||||
copyVector(&subdivVerts[0][0], &verts[pft4->v0]);
|
||||
subdivVerts[0][0].uv.val = *(ushort*)&pft4->uv0;
|
||||
@ -407,9 +407,9 @@ void SubdivNxM(char *polys, int n, int m, int ofse)
|
||||
// [D] [T]
|
||||
void TileNxN(MODEL *model, int levels, int Dofse)
|
||||
{
|
||||
uint ttype;
|
||||
u_int ttype;
|
||||
unsigned char *polys;
|
||||
uint tileTypes;
|
||||
u_int tileTypes;
|
||||
int i;
|
||||
int ofse;
|
||||
|
||||
@ -419,7 +419,7 @@ void TileNxN(MODEL *model, int levels, int Dofse)
|
||||
plotContext.verts = (SVECTOR *)model->vertices;
|
||||
|
||||
// tile types comes right after model header it seems
|
||||
tileTypes = *(uint *)(model + 1) >> 2;
|
||||
tileTypes = *(u_int *)(model + 1) >> 2;
|
||||
|
||||
// grass should be under pavements and other things
|
||||
if((model->shape_flags & SHAPE_FLAG_SUBSURFACE) || (model->flags2 & 0x4000))
|
||||
|
@ -58,7 +58,7 @@ static unsigned short CurrentChannel;
|
||||
static unsigned short ID;
|
||||
static int StartPos;
|
||||
static CdlLOC pause_loc;
|
||||
static uint buffer[8];
|
||||
static u_int buffer[8];
|
||||
|
||||
|
||||
#ifndef PSX
|
||||
@ -402,7 +402,7 @@ void cbready(int intr, unsigned char *result)
|
||||
CdGetSector(buffer, 8);
|
||||
ID = buffer[3];
|
||||
|
||||
CurrentChannel = ((uint)buffer[3] & 0x7c00) >> 10; // there is buffer[3]+2 bytes
|
||||
CurrentChannel = ((u_int)buffer[3] & 0x7c00) >> 10; // there is buffer[3]+2 bytes
|
||||
|
||||
if (buffer[3] == 0x160)
|
||||
{
|
||||
|
@ -1363,7 +1363,7 @@ typedef struct _TARGET
|
||||
int loseMessage; // data 14
|
||||
} event;
|
||||
};
|
||||
};
|
||||
} s;
|
||||
};
|
||||
} MS_TARGET;
|
||||
|
||||
@ -1497,7 +1497,7 @@ struct FELONY_DATA
|
||||
//---------------------------------------------------------------------------------------
|
||||
// TODO: PEDEST.H
|
||||
|
||||
enum PED_ACTION_TYPE : char
|
||||
enum PED_ACTION_TYPE //: char
|
||||
{
|
||||
PED_ACTION_WALK = 0,
|
||||
PED_ACTION_RUN = 1,
|
||||
@ -1517,7 +1517,7 @@ enum PED_ACTION_TYPE : char
|
||||
PED_ACTION_STOPPING = 15,
|
||||
};
|
||||
|
||||
enum PED_MODEL_TYPES : char
|
||||
enum PED_MODEL_TYPES //: char
|
||||
{
|
||||
TANNER_MODEL = 0,
|
||||
OTHER_MODEL = 1,
|
||||
@ -1534,7 +1534,7 @@ typedef struct PEDESTRIAN
|
||||
pedFunc fpRestState;
|
||||
pedFunc fpAgitatedState;
|
||||
char padId;
|
||||
PED_MODEL_TYPES pedType;
|
||||
char pedType;
|
||||
VECTOR_NOPAD position;
|
||||
SVECTOR dir;
|
||||
SVECTOR velocity;
|
||||
@ -1552,7 +1552,7 @@ typedef struct PEDESTRIAN
|
||||
char finished_turn;
|
||||
char seat_index;
|
||||
u_char pallet;
|
||||
PED_ACTION_TYPE type;
|
||||
char type;
|
||||
} *LPPEDESTRIAN;
|
||||
|
||||
struct CAR_COLLISION_BOX
|
||||
@ -2126,7 +2126,7 @@ struct MVERTEX
|
||||
struct {
|
||||
u_char u0;
|
||||
u_char v0;
|
||||
};
|
||||
}s;
|
||||
}uv;
|
||||
};
|
||||
|
||||
|
@ -1,9 +1,6 @@
|
||||
#ifndef DRIVER2_H
|
||||
#define DRIVER2_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "KERNEL.H"
|
||||
#include "TYPES.H"
|
||||
#include "LIBCD.H"
|
||||
@ -24,6 +21,9 @@
|
||||
|
||||
#else
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define printMsg PsyX_Log
|
||||
#define printInfo PsyX_Log_Info
|
||||
#define printWarning PsyX_Log_Warning
|
||||
|
Loading…
Reference in New Issue
Block a user