Use LONGVECTOR, LONGQUATERNION instead of long[4].

TODO: Determine where LONGQUATERNION should be used.
This commit is contained in:
Fireboyd78 2020-10-30 17:57:58 -07:00
parent 633cfe9eb5
commit d75311ef01
21 changed files with 157 additions and 174 deletions

View File

@ -553,7 +553,7 @@ void ApplyDamage(CAR_DATA *cp, char region, int value, char fakeDamage)
// decompiled code
// original method signature:
// int /*$ra*/ DamageCar3D(CAR_DATA *cp /*$s1*/, long (*delta)[4] /*$t4*/, int strikeVel /*$t6*/, CAR_DATA *pOtherCar /*$s2*/)
// int /*$ra*/ DamageCar3D(CAR_DATA *cp /*$s1*/, LONGVECTOR* delta /*$t4*/, int strikeVel /*$t6*/, CAR_DATA *pOtherCar /*$s2*/)
// line 470, offset 0x0001d0b0
/* begin block 1 */
// Start line: 471
@ -562,8 +562,8 @@ void ApplyDamage(CAR_DATA *cp, char region, int value, char fakeDamage)
// int l; // $v1
// int w; // $v0
// int region; // $a1
// long nose[4]; // stack offset -56
// long door[4]; // stack offset -40
// LONGVECTOR nose; // stack offset -56
// LONGVECTOR door; // stack offset -40
// int impact; // $s3
// int QQQ; // $t7
@ -592,7 +592,7 @@ void ApplyDamage(CAR_DATA *cp, char region, int value, char fakeDamage)
// End Line: 1169
// [D] [T]
int DamageCar3D(CAR_DATA *cp, long(*delta)[4], int strikeVel, CAR_DATA *pOtherCar)
int DamageCar3D(CAR_DATA *cp, LONGVECTOR* delta, int strikeVel, CAR_DATA *pOtherCar)
{
char region;
int value;
@ -845,9 +845,9 @@ void DamageCar(CAR_DATA *cp, CDATA2D *cd, CRET2D *collisionResult, int strikeVel
// Start offset: 0x0001DA64
// Variables:
// VECTOR velocity; // stack offset -144
// long pointVel[4]; // stack offset -128
// long reaction[4]; // stack offset -112
// long lever[4]; // stack offset -96
// LONGVECTOR pointVel; // stack offset -128
// LONGVECTOR reaction; // stack offset -112
// LONGVECTOR lever; // stack offset -96
// int strikeVel; // $s1
/* begin block 1.2.1.1 */
@ -949,9 +949,9 @@ int CarBuildingCollision(CAR_DATA *cp, BUILDING_BOX *building, CELL_OBJECT *cop,
VECTOR tempwhere;
SVECTOR boxDisp;
VECTOR velocity;
long pointVel[4];
long reaction[4];
long lever[4];
LONGVECTOR pointVel;
LONGVECTOR reaction;
LONGVECTOR lever;
VECTOR LeafPosition;
VECTOR lamp_velocity;
int debris_colour;

View File

@ -11,7 +11,7 @@ extern int bFindCollisionTime(CDATA2D *cd, CRET2D *collisionResult); // 0x0001CC
extern void ApplyDamage(CAR_DATA *cp, char region, int value, char fakeDamage); // 0x0001CEEC
extern int DamageCar3D(CAR_DATA *cp, long (*delta)[4], int strikeVel, CAR_DATA *pOtherCar); // 0x0001D0B0
extern int DamageCar3D(CAR_DATA *cp, LONGVECTOR* delta, int strikeVel, CAR_DATA *pOtherCar); // 0x0001D0B0
extern void DamageCar(CAR_DATA *cp, CDATA2D *cd, CRET2D *collisionResult, int strikeVel); // 0x0001D454

View File

@ -561,9 +561,9 @@ int BombCollisionCheck(CAR_DATA *cp, VECTOR *pPos)
// Start offset: 0x0001EF94
// Variables:
// VECTOR velocity; // stack offset -104
// long pointVel[4]; // stack offset -88
// long reaction[4]; // stack offset -72
// long lever[4]; // stack offset -56
// LONGVECTOR pointVel; // stack offset -88
// LONGVECTOR reaction; // stack offset -72
// LONGVECTOR lever; // stack offset -56
// int strikeVel; // $s0
/* begin block 1.1.4.1.1 */
@ -630,9 +630,9 @@ void ExplosionCollisionCheck(CAR_DATA *cp, EXOBJECT *pE)
int carLength[2];
CRET2D collisionResult;
VECTOR velocity;
long pointVel[4];
long reaction[4];
long lever[4];
LONGVECTOR pointVel;
LONGVECTOR reaction;
LONGVECTOR lever;
isCar = (cp != &car_data[CAMERA_COLLIDER_CARID]);

View File

@ -46,7 +46,7 @@ unsigned short paddCamera;
char cameraview = 0;
int CameraCnt = 0;
static long basePos[4]; // [A]
static LONGVECTOR basePos; // [A]
static long baseDir = 0;
char tracking_car = 0;

View File

@ -87,7 +87,7 @@ int test555 = 0;
// decompiled code
// original method signature:
// int /*$ra*/ InitCar(CAR_DATA *cp /*$s0*/, int direction /*$s6*/, long (*startPos)[4] /*$s2*/, unsigned char control /*$s4*/, int model /*stack 16*/, int palette /*stack 20*/, char *extraData /*stack 24*/)
// int /*$ra*/ InitCar(CAR_DATA *cp /*$s0*/, int direction /*$s6*/, LONGVECTOR* startPos /*$s2*/, unsigned char control /*$s4*/, int model /*stack 16*/, int palette /*stack 20*/, char *extraData /*stack 24*/)
// line 717, offset 0x00023de8
/* begin block 1 */
// Start line: 718
@ -104,7 +104,7 @@ int test555 = 0;
// End Line: 1435
// [D] [T]
int InitCar(CAR_DATA* cp, int direction, long(*startPos)[4], unsigned char control, int model, int palette, char* extraData)
int InitCar(CAR_DATA* cp, int direction, LONGVECTOR* startPos, unsigned char control, int model, int palette, char* extraData)
{
VECTOR tmpStart;
@ -132,7 +132,7 @@ int InitCar(CAR_DATA* cp, int direction, long(*startPos)[4], unsigned char contr
if (control == CONTROL_TYPE_NONE)
return 1;
InitCarPhysics(cp, (long(*)[4]) & tmpStart, direction);
InitCarPhysics(cp, (LONGVECTOR *)&tmpStart, direction);
cp->ap.palette = palette;
cp->controlType = control;
@ -2907,7 +2907,7 @@ void InitCivCars(void)
// decompiled code
// original method signature:
// int /*$ra*/ CreateCivCarWotDrivesABitThenStops(int direction /*$s5*/, long (*startPos)[4] /*$s2*/, long (*stopPos)[4] /*$a2*/, unsigned char internalModel /*$s4*/, int palette /*stack 16*/)
// int /*$ra*/ CreateCivCarWotDrivesABitThenStops(int direction /*$s5*/, LONGVECTOR* startPos /*$s2*/, LONGVECTOR* stopPos /*$a2*/, unsigned char internalModel /*$s4*/, int palette /*stack 16*/)
// line 2176, offset 0x000286e0
/* begin block 1 */
// Start line: 2177
@ -2952,7 +2952,7 @@ const int EVENT_CAR_SPEED = 60;
const int DistanceTriggerCarMoves = 700; // 5000;
// [D] [T] [A]
int CreateCivCarWotDrivesABitThenStops(int direction, long(*startPos)[4], long(*stopPos)[4], unsigned char internalModel, int palette)
int CreateCivCarWotDrivesABitThenStops(int direction, LONGVECTOR* startPos, LONGVECTOR* stopPos, unsigned char internalModel, int palette)
{
unsigned char* slot;
CAR_DATA* carCnt;
@ -3028,7 +3028,7 @@ int CreateCivCarWotDrivesABitThenStops(int direction, long(*startPos)[4], long(*
// decompiled code
// original method signature:
// int /*$ra*/ CreateStationaryCivCar(int direction /*$t4*/, long orientX /*$s2*/, long orientZ /*$s1*/, long (*startPos)[4] /*$a2*/, int externalModel /*stack 16*/, int palette /*stack 20*/, int controlFlags /*stack 24*/)
// int /*$ra*/ CreateStationaryCivCar(int direction /*$t4*/, long orientX /*$s2*/, long orientZ /*$s1*/, LONGVECTOR* startPos /*$a2*/, int externalModel /*stack 16*/, int palette /*stack 20*/, int controlFlags /*stack 24*/)
// line 2248, offset 0x00028960
/* begin block 1 */
// Start line: 2249
@ -3070,7 +3070,7 @@ int CreateCivCarWotDrivesABitThenStops(int direction, long(*startPos)[4], long(*
// End Line: 5132
// [D] [T]
int CreateStationaryCivCar(int direction, long orientX, long orientZ, long(*startPos)[4], int externalModel, int palette, int controlFlags)
int CreateStationaryCivCar(int direction, long orientX, long orientZ, LONGVECTOR* startPos, int externalModel, int palette, int controlFlags)
{
unsigned char* slot;
CAR_DATA* newCar;
@ -6016,7 +6016,7 @@ void CreateRoadblock(void)
if((str && ROAD_IS_AI_LANE(str, laneNo) || crv && ROAD_IS_AI_LANE(crv, laneNo)) &&
CellEmpty(&currentPos, lbody))
{
newSlot = CreateStationaryCivCar(dir2NextRow + (Random2(0) * 0x10001 >> (laneNo) & 0x3ffU) - 512, 0, 0, (long(*)[4]) & currentPos, externalCopModel, 0, 2);
newSlot = CreateStationaryCivCar(dir2NextRow + (Random2(0) * 0x10001 >> (laneNo) & 0x3ffU) - 512, 0, 0, (LONGVECTOR *)&currentPos, externalCopModel, 0, 2);
if (newSlot == -1)
break;
@ -6093,7 +6093,7 @@ void CreateRoadblock(void)
test42 = delta;
newSlot = CreateStationaryCivCar(faceDir + (Random2(0) * 0x10001 >> (delta >> 9 & 0x1fU) & 0x3ffU) - 512, 0, 0, (long(*)[4]) & currentPos, externalCopModel, 0, 2);
newSlot = CreateStationaryCivCar(faceDir + (Random2(0) * 0x10001 >> (delta >> 9 & 0x1fU) & 0x3ffU) - 512, 0, 0, (LONGVECTOR *)&currentPos, externalCopModel, 0, 2);
if (newSlot == -1)
break;

View File

@ -12,7 +12,7 @@ extern char makeLimoPullOver;
extern char junctionLightsPhase[2];
extern int InitCar(CAR_DATA *cp, int direction, long (*startPos)[4], unsigned char control, int model, int palette, char *extraData); // 0x00023DE8
extern int InitCar(CAR_DATA *cp, int direction, LONGVECTOR* startPos, unsigned char control, int model, int palette, char *extraData); // 0x00023DE8
extern CAR_DATA * FindClosestCar(int x, int y, int z, int *distToCarSq); // 0x0002D11C
@ -46,9 +46,9 @@ extern int TrafficLightCycle(int exit); // 0x0002CF18
extern void InitCivCars(); // 0x0002CDA4
extern int CreateCivCarWotDrivesABitThenStops(int direction, long (*startPos)[4], long (*stopPos)[4], unsigned char internalModel, int palette); // 0x000286E0
extern int CreateCivCarWotDrivesABitThenStops(int direction, LONGVECTOR* startPos, LONGVECTOR* stopPos, unsigned char internalModel, int palette); // 0x000286E0
extern int CreateStationaryCivCar(int direction, long orientX, long orientZ, long (*startPos)[4], int externalModel, int palette, int controlFlags); // 0x00028960
extern int CreateStationaryCivCar(int direction, long orientX, long orientZ, LONGVECTOR* startPos, int externalModel, int palette, int controlFlags); // 0x00028960
extern int PingInCivCar(int minPingInDist); // 0x00028DB4

View File

@ -914,7 +914,7 @@ int TriggerInGameCutsceneSystem(int cutscene)
InitPlayer(&player[player_id], cp,
stream->SourceType.controlType,
stream->SourceType.rotation,
(long(*)[4])&stream->SourceType.position,
(LONGVECTOR* )&stream->SourceType.position,
stream->SourceType.model,
stream->SourceType.palette,
&padid[player_id]);
@ -940,7 +940,7 @@ int TriggerInGameCutsceneSystem(int cutscene)
else
{
slot = CreateStationaryCivCar(stream->SourceType.rotation, 0, 1024,
(long(*)[4])&stream->SourceType.position,
(LONGVECTOR* )&stream->SourceType.position,
stream->SourceType.model,
stream->SourceType.palette, 0);

View File

@ -368,7 +368,7 @@ MATRIX leaf_mat;
// Start line: 954
// Start offset: 0x000330A4
// Variables:
// long n[4]; // stack offset -128
// LONGVECTOR n; // stack offset -128
/* end block 1.4 */
// End offset: 0x0003316C
// End Line: 960
@ -452,7 +452,7 @@ void PlacePoolForCar(CAR_DATA *cp, CVECTOR *col, int front, int in_car)
VECTOR averagepos;
VECTOR mid_position;
VECTOR toss;
long n[4];
LONGVECTOR n;
long z[15];
int local_30;

View File

@ -29,7 +29,7 @@
// decompiled code
// original method signature:
// void /*$ra*/ InitCarPhysics(CAR_DATA *cp /*$s0*/, long (*startpos)[4] /*$t0*/, int direction /*$a2*/)
// void /*$ra*/ InitCarPhysics(CAR_DATA *cp /*$s0*/, LONGVECTOR* startpos /*$t0*/, int direction /*$a2*/)
// line 998, offset 0x0005381c
/* begin block 1 */
// Start line: 999
@ -423,8 +423,8 @@ void FixCarCos(CAR_COSMETICS* carCos, int externalModelNumber)
// Start line: 1301
// Start offset: 0x00053E18
// Variables:
// long AV[4]; // stack offset -248
// long delta_orientation[4]; // stack offset -232
// LONGVECTOR AV; // stack offset -248
// LONGQUATERNION delta_orientation; // stack offset -232
/* end block 1.1.2 */
// End offset: 0x00053FF8
// End Line: 1321
@ -463,7 +463,7 @@ void FixCarCos(CAR_COSMETICS* carCos, int externalModelNumber)
// Start line: 1193
// Start offset: 0x000540EC
// Variables:
// long AV[4]; // stack offset -248
// LONGVECTOR AV; // stack offset -248
/* end block 1.2.1.1.1.1 */
// End offset: 0x000540EC
// End Line: 1193
@ -483,10 +483,10 @@ void FixCarCos(CAR_COSMETICS* carCos, int externalModelNumber)
// Start offset: 0x00054340
// Variables:
// int strength; // $s5
// long centre0[4]; // stack offset -248
// long centre1[4]; // stack offset -232
// long normal[4]; // stack offset -216
// long collisionpoint[4]; // stack offset -200
// LONGVECTOR centre0; // stack offset -248
// LONGVECTOR centre1; // stack offset -232
// LONGVECTOR normal; // stack offset -216
// LONGVECTOR collisionpoint; // stack offset -200
/* begin block 1.2.1.1.2.1.1 */
// Start line: 1378
@ -511,11 +511,11 @@ void FixCarCos(CAR_COSMETICS* carCos, int externalModelNumber)
// Start line: 1419
// Start offset: 0x00054460
// Variables:
// long lever0[4]; // stack offset -184
// long lever1[4]; // stack offset -168
// long torque[4]; // stack offset -152
// long pointVel0[4]; // stack offset -136
// long pointVel1[4]; // stack offset -120
// LONGVECTOR lever0; // stack offset -184
// LONGVECTOR lever1; // stack offset -168
// LONGVECTOR torque; // stack offset -152
// LONGVECTOR pointVel0; // stack offset -136
// LONGVECTOR pointVel1; // stack offset -120
// int strikeVel; // stack offset -68
/* begin block 1.2.1.1.2.1.3.1 */
@ -560,7 +560,7 @@ void FixCarCos(CAR_COSMETICS* carCos, int externalModelNumber)
// Start line: 1548
// Start offset: 0x00054A50
// Variables:
// long force[4]; // stack offset -104
// LONGVECTOR force; // stack offset -104
// int strength1; // $a0
// int twistY; // $t4
/* end block 1.2.1.1.2.1.3.3.1 */
@ -571,7 +571,7 @@ void FixCarCos(CAR_COSMETICS* carCos, int externalModelNumber)
// Start line: 1581
// Start offset: 0x00054CA8
// Variables:
// long force[4]; // stack offset -104
// LONGVECTOR force; // stack offset -104
// int strength2; // $a1
// int twistY; // $t2
/* end block 1.2.1.1.2.1.3.3.2 */
@ -702,14 +702,14 @@ void GlobalTimeStep(void)
RigidBodyState* tp;
RigidBodyState* d0;
RigidBodyState* d1;
long AV[4];
long delta_orientation[4];
long normal[4];
long collisionpoint[4];
long lever0[4];
long lever1[4];
long torque[4];
long pointVel0[4];
LONGVECTOR AV;
LONGQUATERNION delta_orientation;
LONGVECTOR normal;
LONGVECTOR collisionpoint;
LONGVECTOR lever0;
LONGVECTOR lever1;
LONGVECTOR torque;
LONGVECTOR pointVel0;
VECTOR velocity;
int depth;
int RKstep;
@ -928,10 +928,10 @@ void GlobalTimeStep(void)
if (howHard > 0 && RKstep > -1)
{
if (DamageCar3D(c1, (long(*)[4])lever1, howHard >> 1, cp))
if (DamageCar3D(c1, &lever1, howHard >> 1, cp))
c1->ap.needsDenting = 1;
if (DamageCar3D(cp, (long(*)[4])lever0, howHard >> 1, c1))
if (DamageCar3D(cp, &lever0, howHard >> 1, c1))
cp->ap.needsDenting = 1;
if (howHard > 0x32000)
@ -1279,7 +1279,7 @@ void SetShadowPoints(CAR_DATA* c0, VECTOR* outpoints)
// decompiled code
// original method signature:
// void /*$ra*/ LongQuaternion2Matrix(long (*qua)[4] /*$a0*/, MATRIX *m /*$a1*/)
// void /*$ra*/ LongQuaternion2Matrix(LONGQUATERNION* qua /*$a0*/, MATRIX *m /*$a1*/)
// line 1753, offset 0x000553cc
/* begin block 1 */
// Start line: 1754
@ -1314,41 +1314,26 @@ void SetShadowPoints(CAR_DATA* c0, VECTOR* outpoints)
// End Line: 4834
// [D] [T]
void LongQuaternion2Matrix(long(*qua)[4], MATRIX* m)
void LongQuaternion2Matrix(LONGQUATERNION *qua, MATRIX* m)
{
int xx;
int xy;
int xz;
int xw;
int yy;
int yz;
int yw;
int zz;
int zw;
int qx = (*qua)[0];
int qy = (*qua)[1];
int qz = (*qua)[2];
int qw = (*qua)[3];
int qy;
int qx;
int qw;
int qz;
int yy = FixHalfRound(qy * qy, 11);
int zz = FixHalfRound(qz * qz, 11);
int xx = FixHalfRound(qx * qx, 11);
int zw = FixHalfRound(qz * qw, 11);
int xy = FixHalfRound(qx * qy, 11);
int xz = FixHalfRound(qx * qz, 11);
int yw = FixHalfRound(qy * qw, 11);
int xw = FixHalfRound(qx * qw, 11);
int yz = FixHalfRound(qy * qz, 11);
qx = (*qua)[0];
qy = (*qua)[1];
qz = (*qua)[2];
qw = (*qua)[3];
yy = FixHalfRound(qy * qy, 11);
zz = FixHalfRound(qz * qz, 11);
xx = FixHalfRound(qx * qx, 11);
zw = FixHalfRound(qz * qw, 11);
xy = FixHalfRound(qx * qy, 11);
xz = FixHalfRound(qx * qz, 11);
yw = FixHalfRound(qy * qw, 11);
xw = FixHalfRound(qx * qw, 11);
yz = FixHalfRound(qy * qz, 11);
m->m[0][0] = 4096 - (yy + zz);
m->m[1][1] = 4096 - (xx + zz);
m->m[2][2] = 4096 - (xx + yy);
m->m[0][0] = ONE - (yy + zz);
m->m[1][1] = ONE - (xx + zz);
m->m[2][2] = ONE - (xx + yy);
m->m[0][1] = xy - zw;
m->m[0][2] = xz + yw;
m->m[1][0] = xy + zw;
@ -1520,7 +1505,7 @@ void RebuildCarMatrix(RigidBodyState* st, CAR_DATA* cp)
}
st->n.orientation[3] = sm;
LongQuaternion2Matrix((long(*)[4])st->n.orientation, &cp->hd.where);
LongQuaternion2Matrix(&st->n.orientation, &cp->hd.where);
initOBox(cp);
}

View File

@ -6,7 +6,7 @@ extern int playerghost;
extern int playerhitcopsanyway;
extern char continuous_track;
extern void InitCarPhysics(CAR_DATA *cp, long (*startpos)[4], int direction); // 0x0005381C
extern void InitCarPhysics(CAR_DATA *cp, LONGVECTOR* startpos, int direction); // 0x0005381C
extern void TempBuildHandlingMatrix(CAR_DATA *cp, int init); // 0x000539E8
@ -18,7 +18,7 @@ extern void GlobalTimeStep(); // 0x00053C00
extern void SetShadowPoints(CAR_DATA *c0, VECTOR* outpoints); // 0x000551EC
extern void LongQuaternion2Matrix(long (*qua)[4], MATRIX *m); // 0x000553CC
extern void LongQuaternion2Matrix(LONGQUATERNION* qua, MATRIX *m); // 0x000553CC
extern void initOBox(CAR_DATA *cp); // 0x000554F0

View File

@ -298,7 +298,7 @@ void LeadUpdateState(CAR_DATA *cp)
tmpStart.vy = MapHeight(&tmpStart);
tmpStart.vy = tmpStart.vy - ((cp->ap).carCos)->wheelDisp[0].vy;
InitCarPhysics(cp, (long(*)[4]) & tmpStart, (int)cp->ai.l.targetDir);
InitCarPhysics(cp, (LONGVECTOR *)&tmpStart, (int)cp->ai.l.targetDir);
cp->ai.l.dstate = 3;
}

View File

@ -857,7 +857,7 @@ void GameInit(void)
gStartOnFoot = (pSVar3->type == 2);
InitPlayer(&player[i], &car_data[i], pSVar3->controlType, pSVar3->rotation, (long(*)[4]) & pSVar3->position, pSVar3->model, pSVar3->palette, &padid);
InitPlayer(&player[i], &car_data[i], pSVar3->controlType, pSVar3->rotation, (LONGVECTOR *)&pSVar3->position, pSVar3->model, pSVar3->palette, &padid);
if (gStartOnFoot == 0)
{

View File

@ -976,7 +976,7 @@ void DoMissionSound(void)
}
else
{
long V[4];
LONGVECTOR V;
long* C = (long*)bodgevar; // Ahhh, Reflections...
x = car_data[player[0].playerCarId].hd.where.t[0];

View File

@ -2557,7 +2557,7 @@ void MRSetVariable(MR_THREAD *thread, ulong var, long value)
// Start offset: 0x00062BFC
// Variables:
// int direction; // $s0
// long pos[4]; // stack offset -64
// LONGVECTOR pos; // stack offset -64
// int *inform; // $s4
// CAR_DATA *cp; // $v0
/* end block 1.2 */
@ -2568,7 +2568,7 @@ void MRSetVariable(MR_THREAD *thread, ulong var, long value)
// Start line: 3069
// Start offset: 0x00063028
// Variables:
// long pos[4]; // stack offset -64
// LONGVECTOR pos; // stack offset -64
/* end block 1.3 */
// End offset: 0x00063090
// End Line: 3076
@ -2625,7 +2625,7 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
int ret;
VECTOR tv;
VECTOR pv;
long pos[4];
LONGVECTOR pos;
int slot;
ret = 0;
@ -2880,7 +2880,7 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
cp->inform = NULL;
PingOutCar(&car_data[slot]);
slot = CreateCivCarWotDrivesABitThenStops(direction, (long(*)[4])pos, NULL, model, palette);
slot = CreateCivCarWotDrivesABitThenStops(direction, &pos, NULL, model, palette);
cp->inform = inform;
@ -3351,7 +3351,7 @@ void MRHandleCarRequests(void)
// Start line: 3312
// Start offset: 0x00063728
// Variables:
// long pos[4]; // stack offset -64
// LONGVECTOR pos; // stack offset -64
// int actAsCop; // $s2
// int damaged; // $s7
// int model; // $s4
@ -3379,7 +3379,7 @@ int MRCreateCar(MS_TARGET *target)
{
int curslot;
int newslot;
long pos[4];
LONGVECTOR pos;
char playerid;
pos[0] = target->data[3];
@ -3393,7 +3393,7 @@ int MRCreateCar(MS_TARGET *target)
}
else
{
curslot = CreateStationaryCivCar(target->data[5], 0, ((target->data[10] & 0x40000) != 0) << 10, (long(*)[4])pos, target->data[7], target->data[8], (target->data[10] & 8) != 0);
curslot = CreateStationaryCivCar(target->data[5], 0, ((target->data[10] & 0x40000) != 0) << 10, &pos, target->data[7], target->data[8], (target->data[10] & 8) != 0);
}
if (curslot < 0)
@ -3416,7 +3416,7 @@ int MRCreateCar(MS_TARGET *target)
{
playerid = 0xff;
InitPlayer((PLAYER *)(player + 1), &car_data[curslot], 4, target->data[5], (long(*)[4])pos, target->data[7], target->data[8], (char *)&playerid);
InitPlayer((PLAYER *)(player + 1), &car_data[curslot], 4, target->data[5], &pos, target->data[7], target->data[8], (char *)&playerid);
EnablePercentageBar(&DamageBar, target->data[13]);
NewLeadDelay = 0;

View File

@ -143,8 +143,8 @@ int powerCounter = 0;
void IHaveThePower(void)
{
CAR_DATA* cp;
long force[4] = { 0x9000, 0, 0, 0 };
long point[4] = { 0, 0, 90, 0 };
LONGVECTOR force = { 0x9000, 0, 0, 0 };
LONGVECTOR point = { 0, 0, 90, 0 };
if (GameLevel != 1)
return;
@ -828,7 +828,7 @@ void DestroyPedestrian(PEDESTRIAN* pPed)
// decompiled code
// original method signature:
// int /*$ra*/ ActivatePlayerPedestrian(CAR_DATA *pCar /*$s6*/, char *padId /*stack 4*/, int direction /*$a1*/, long (*position)[4] /*$a3*/, int playerType /*stack 16*/)
// int /*$ra*/ ActivatePlayerPedestrian(CAR_DATA *pCar /*$s6*/, char *padId /*stack 4*/, int direction /*$a1*/, LONGVECTOR* position /*$a3*/, int playerType /*stack 16*/)
// line 1623, offset 0x0006e6c4
/* begin block 1 */
// Start line: 1624
@ -889,7 +889,7 @@ void DestroyPedestrian(PEDESTRIAN* pPed)
/* WARNING: Type propagation algorithm not settling */
// [D] [T]
int ActivatePlayerPedestrian(CAR_DATA* pCar, char* padId, int direction, long(*position)[4], PED_MODEL_TYPES playerType)
int ActivatePlayerPedestrian(CAR_DATA* pCar, char* padId, int direction, LONGVECTOR* position, PED_MODEL_TYPES playerType)
{
int wbody;
int side;
@ -1182,8 +1182,8 @@ PEDESTRIAN* CreatePedestrian(void)
// int s1; // $s1
// int s2; // $a3
// VECTOR vert; // stack offset -88
// long disp[4]; // stack offset -72
// long dir[4]; // stack offset -56
// LONGVECTOR disp; // stack offset -72
// LONGVECTOR dir; // stack offset -56
// int alpha; // $s1
/* end block 1.1 */
// End offset: 0x0006EFDC
@ -1226,7 +1226,7 @@ void PlaceRoadBlockCops(void)
int i;
int numCops;
CAR_DATA* pCopCars[16];
long disp[4];
LONGVECTOR disp;
if (numCopPeds >= 8)
return;
@ -1270,14 +1270,14 @@ void PlaceRoadBlockCops(void)
disp[1] = -pCar->hd.where.t[1];
disp[2] = pCar->hd.where.t[2] + FIXED(wbody * sn) + FIXED(lbody * cs);
if (CreatePedAtLocation((long(*)[4])disp, 12) != 0)
if (CreatePedAtLocation(&disp, 12) != 0)
numCopPeds++;
disp[0] = pCar->hd.where.t[0] - (FIXED(wbody * cs) - FIXED(-lbody * sn));
disp[1] = -pCar->hd.where.t[1];
disp[2] = pCar->hd.where.t[2] + FIXED(wbody * sn) + FIXED(-lbody * cs);
if (CreatePedAtLocation((long(*)[4])disp, 13) != 0)
if (CreatePedAtLocation(&disp, 13) != 0)
numCopPeds++;
i++;
@ -1288,7 +1288,7 @@ void PlaceRoadBlockCops(void)
// decompiled code
// original method signature:
// int /*$ra*/ CreatePedAtLocation(long (*pPos)[4] /*$s2*/, int pedType /*$s1*/)
// int /*$ra*/ CreatePedAtLocation(LONGVECTOR* pPos /*$s2*/, int pedType /*$s1*/)
// line 1975, offset 0x0006f00c
/* begin block 1 */
// Start line: 1976
@ -1305,7 +1305,7 @@ void PlaceRoadBlockCops(void)
// End Line: 4496
// [D] [T]
int CreatePedAtLocation(long(*pPos)[4], int pedType)
int CreatePedAtLocation(LONGVECTOR* pPos, int pedType)
{
PEDESTRIAN* pPed;
@ -2249,8 +2249,8 @@ void PedGetOutCar(PEDESTRIAN* pPed)
// Start offset: 0x0006F80C
// Variables:
// int alpha; // $s2
// long disp[4]; // stack offset -80
// long dir[4]; // stack offset -64
// LONGVECTOR disp; // stack offset -80
// LONGVECTOR dir; // stack offset -64
// SVECTOR vert; // stack offset -48
// int x; // $s4
// int z; // $s0
@ -2330,8 +2330,8 @@ void SetupGetOutCar(PEDESTRIAN* pPed, CAR_DATA* pCar, int side)
// Start offset: 0x0006FA3C
// Variables:
// int alpha; // $s1
// long disp[4]; // stack offset -72
// long dir[4]; // stack offset -56
// LONGVECTOR disp; // stack offset -72
// LONGVECTOR dir; // stack offset -56
// SVECTOR vert; // stack offset -40
/* begin block 1.1 */
@ -2351,7 +2351,7 @@ void SetupGetOutCar(PEDESTRIAN* pPed, CAR_DATA* pCar, int side)
// Start line: 2968
// Start offset: 0x0006FC70
// Variables:
// long pos[4]; // stack offset -32
// LONGVECTOR pos; // stack offset -32
/* end block 1.2 */
// End offset: 0x0006FC70
// End Line: 2969
@ -2383,7 +2383,7 @@ void SetupGetInCar(PEDESTRIAN* pPed)
int playerId;
int entrySide;
long pos[4];
LONGVECTOR pos;
pPed->flags &= ~4;
pPed->speed = 0;
@ -2447,8 +2447,8 @@ void SetupGetInCar(PEDESTRIAN* pPed)
// Start line: 2995
// Start offset: 0x00072B5C
// Variables:
// long disp[4]; // stack offset -48
// long dir[4]; // stack offset -32
// LONGVECTOR disp; // stack offset -48
// LONGVECTOR dir; // stack offset -32
// SVECTOR vert; // stack offset -16
/* end block 1 */
// End offset: 0x00072BEC
@ -3462,9 +3462,9 @@ int FindPointOfCollision(CAR_DATA* pCar, PEDESTRIAN* pPed)
// Start offset: 0x00070C04
// Variables:
// VECTOR velocity; // stack offset -104
// long pointVel[4]; // stack offset -88
// long reaction[4]; // stack offset -72
// long lever[4]; // stack offset -56
// LONGVECTOR pointVel; // stack offset -88
// LONGVECTOR reaction; // stack offset -72
// LONGVECTOR lever; // stack offset -56
// int strikeVel; // $t1
/* begin block 1.1.2.1 */
@ -3517,9 +3517,9 @@ int FindPointOfCollision(CAR_DATA* pCar, PEDESTRIAN* pPed)
int TannerCarCollisionCheck(VECTOR* pPos, int dir, int bQuick)
{
CAR_DATA* cp1;
long pointVel[4];
long reaction[4];
long lever[4];
LONGVECTOR pointVel;
LONGVECTOR reaction;
LONGVECTOR lever;
int strikeVel;
SVECTOR boxDisp;
CAR_COSMETICS* car_cos;
@ -3681,8 +3681,8 @@ int PingOutPed(PEDESTRIAN* pPed)
// Start line: 3947
// Start offset: 0x00071054
// Variables:
// long disp[4]; // stack offset -48
// long dir[4]; // stack offset -32
// LONGVECTOR disp; // stack offset -48
// LONGVECTOR dir; // stack offset -32
// int angle; // $s0
/* begin block 1.1 */
@ -3721,7 +3721,7 @@ void SetupCivJump(PEDESTRIAN* pPed, CAR_DATA* cp)
short scale;
int dx;
short angle;
long dir[4];
LONGVECTOR dir;
if (pPed->type != PED_ACTION_JUMP)
{

View File

@ -28,13 +28,13 @@ extern void DestroyCivPedestrians(); // 0x00072FD0
extern void DestroyPedestrian(PEDESTRIAN *pPed); // 0x00071FB4
extern int ActivatePlayerPedestrian(CAR_DATA *pCar, char *padId, int direction, long (*position)[4], PED_MODEL_TYPES playerType); // 0x0006E6C4
extern int ActivatePlayerPedestrian(CAR_DATA *pCar, char *padId, int direction, LONGVECTOR* position, PED_MODEL_TYPES playerType); // 0x0006E6C4
extern PEDESTRIAN * CreatePedestrian(); // 0x000720AC
extern void PlaceRoadBlockCops(); // 0x0006EC88
extern int CreatePedAtLocation(long (*pPos)[4], int pedType); // 0x0006F00C
extern int CreatePedAtLocation(LONGVECTOR* pPos, int pedType); // 0x0006F00C
extern void DrawAllPedestrians(); // 0x00072290

View File

@ -15,7 +15,7 @@
// decompiled code
// original method signature:
// void /*$ra*/ InitPlayer(PLAYER *locPlayer /*$s1*/, CAR_DATA *cp /*$s2*/, char carCtrlType /*$s3*/, int direction /*$s6*/, long (*startPos)[4] /*stack 16*/, int externModel /*stack 20*/, int palette /*stack 24*/, char *padid /*stack 28*/)
// void /*$ra*/ InitPlayer(PLAYER *locPlayer /*$s1*/, CAR_DATA *cp /*$s2*/, char carCtrlType /*$s3*/, int direction /*$s6*/, LONGVECTOR* startPos /*stack 16*/, int externModel /*stack 20*/, int palette /*stack 24*/, char *padid /*stack 28*/)
// line 75, offset 0x000739d8
/* begin block 1 */
// Start line: 76
@ -38,7 +38,7 @@ PEDESTRIAN *pPlayerPed = NULL;
PLAYER player[8];
// [D] [T]
void InitPlayer(PLAYER *locPlayer, CAR_DATA *cp, char carCtrlType, int direction, long(*startPos)[4], int externModel, int palette, char *padid)
void InitPlayer(PLAYER *locPlayer, CAR_DATA *cp, char carCtrlType, int direction, LONGVECTOR* startPos, int externModel, int palette, char *padid)
{
int model;
uint playerType;

View File

@ -4,7 +4,7 @@
extern PLAYER player[8];
extern PEDESTRIAN *pPlayerPed;
extern void InitPlayer(PLAYER *locPlayer, CAR_DATA *cp, char carCtrlType, int direction, long (*startPos)[4], int externModel, int palette, char *padid); // 0x000739D8
extern void InitPlayer(PLAYER *locPlayer, CAR_DATA *cp, char carCtrlType, int direction, LONGVECTOR* startPos, int externModel, int palette, char *padid); // 0x000739D8
extern void ChangeCarPlayerToPed(int playerID); // 0x00073334

View File

@ -20,7 +20,7 @@
#define SPU_CHANNEL_COUNT 24
long dummylong[4] = { 0, 0, 0, 0 };
LONGVECTOR dummylong = { 0, 0, 0, 0 };
long bankaddr[2] = { 0 };
long banksize[2] = { 88064, 412672 };

View File

@ -126,9 +126,9 @@ void StepCars(void)
// Start line: 133
// Start offset: 0x0008127C
// Variables:
// long deepestNormal[4]; // stack offset -208
// long deepestLever[4]; // stack offset -192
// long deepestPoint[4]; // stack offset -176
// LONGVECTOR deepestNormal; // stack offset -208
// LONGVECTOR deepestLever; // stack offset -192
// LONGVECTOR deepestPoint; // stack offset -176
// int lift; // $s5
// int count; // $a0
// int friToUse; // $s6
@ -138,10 +138,10 @@ void StepCars(void)
// Start line: 156
// Start offset: 0x00081314
// Variables:
// long pointPos[4]; // stack offset -160
// long surfacePoint[4]; // stack offset -144
// long surfaceNormal[4]; // stack offset -128
// long lever[4]; // stack offset -112
// LONGVECTOR pointPos; // stack offset -160
// LONGVECTOR surfacePoint; // stack offset -144
// LONGVECTOR surfaceNormal; // stack offset -128
// LONGVECTOR lever; // stack offset -112
// int newLift; // $a0
/* end block 1.2.1 */
// End offset: 0x00081410
@ -151,8 +151,8 @@ void StepCars(void)
// Start line: 201
// Start offset: 0x00081428
// Variables:
// long pointVel[4]; // stack offset -112
// long reaction[4]; // stack offset -96
// LONGVECTOR pointVel; // stack offset -112
// LONGVECTOR reaction; // stack offset -96
// int strikeVel; // $a2
// int componant; // $t3
// static int frictionLimit[6]; // offset 0x0
@ -249,14 +249,14 @@ void StepOneCar(CAR_DATA* cp)
int a, b, speed;
int count, i;
CAR_LOCALS _cl;
long deepestNormal[4];
long deepestLever[4];
long deepestPoint[4];
long pointPos[4];
long surfacePoint[4];
long surfaceNormal[4];
long lever[4];
long reaction[4];
LONGVECTOR deepestNormal;
LONGVECTOR deepestLever;
LONGVECTOR deepestPoint;
LONGVECTOR pointPos;
LONGVECTOR surfacePoint;
LONGVECTOR surfaceNormal;
LONGVECTOR lever;
LONGVECTOR reaction;
VECTOR direction;
sdPlane* SurfacePtr;
@ -631,7 +631,7 @@ void GetFrictionScalesDriver1(CAR_DATA* cp, CAR_LOCALS* cl, int* frontFS, int* r
// Start line: 413
// Start offset: 0x00081E20
// Variables:
// long nose[4]; // stack offset -16
// LONGVECTOR nose; // stack offset -16
// int zd; // $a3
// int i; // $t4
// int twistY; // $t0
@ -717,9 +717,9 @@ void ConvertTorqueToAngularAcceleration(CAR_DATA* cp, CAR_LOCALS* cl)
// int oldCompression; // $s5
// int newCompression; // $s3
// int susForce; // $s0
// long wheelPos[4]; // stack offset -176
// long surfacePoint[4]; // stack offset -160
// long surfaceNormal[4]; // stack offset -144
// LONGVECTOR wheelPos; // stack offset -176
// LONGVECTOR surfacePoint; // stack offset -160
// LONGVECTOR surfaceNormal; // stack offset -144
/* begin block 1.1.1 */
// Start line: 488
@ -744,7 +744,7 @@ void ConvertTorqueToAngularAcceleration(CAR_DATA* cp, CAR_LOCALS* cl)
// Start offset: 0x00082380
// Variables:
// VECTOR force; // stack offset -128
// long pointVel[4]; // stack offset -112
// LONGVECTOR pointVel; // stack offset -112
// int lfx; // $a2
// int lfz; // $t2
// int sidevel; // $t0
@ -813,11 +813,11 @@ void AddWheelForcesDriver1(CAR_DATA* cp, CAR_LOCALS* cl)
int friction_coef;
int oldSpeed;
int wheelspd;
long wheelPos[4];
long surfacePoint[4];
long surfaceNormal[4];
LONGVECTOR wheelPos;
LONGVECTOR surfacePoint;
LONGVECTOR surfaceNormal;
VECTOR force;
long pointVel[4];
LONGVECTOR pointVel;
int frontFS;
int rearFS;
sdPlane* SurfacePtr;

View File

@ -3,6 +3,11 @@
// Driver 2 system types
typedef short SHORTVECTOR[4];
typedef long LONGVECTOR[4];
typedef long LONGQUATERNION[4];
struct VECTOR2 // hashcode: 0x7572A047 (dec: 1970446407)
{
int vx; // size=0, offset=0
@ -205,7 +210,7 @@ union RigidBodyState // Hashcode: 0x60B16C22 (dec: 1622240290)
long v[13]; // size=52, offset=0
struct {
long fposition[3]; // size=12, offset=0
long orientation[4]; // size=16, offset=12
LONGQUATERNION orientation; // size=16, offset=12
long linearVelocity[3]; // size=12, offset=28
long angularVelocity[3]; // size=12, offset=40
} n; // size=52, offset=0, found in object files: obj\dr2roads.obj, obj\dr2roads.obj
@ -575,13 +580,6 @@ typedef unsigned short gid_t;
typedef void (*SsMarkCallbackProc)();
typedef short SHORTVECTOR[4];
typedef long LONGVECTOR[4];
typedef long LONGQUATERNION[4];
struct MODEL // hashcode: 0x3A42A4FE (dec: 977446142)
{
unsigned short shape_flags; // size=0, offset=0