From c0dd470d7ba89e9cc508297a4d99cd48c06c2223 Mon Sep 17 00:00:00 2001 From: Ilya Shurumov Date: Mon, 26 Jul 2021 21:16:10 +0600 Subject: [PATCH] - misc stuff for readability (& trigger appveyor) --- src_rebuild/Game/C/bcollide.c | 4 ++-- src_rebuild/Game/C/handling.c | 11 +++-------- src_rebuild/Game/C/wheelforces.c | 21 +++++++++------------ 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/src_rebuild/Game/C/bcollide.c b/src_rebuild/Game/C/bcollide.c index 96f2f0c1..5a2d9001 100644 --- a/src_rebuild/Game/C/bcollide.c +++ b/src_rebuild/Game/C/bcollide.c @@ -45,8 +45,8 @@ int bcollided2d(CDATA2D *body, int* boxOverlap) } // hmmm, why? - as = rcossin_tbl[(dtheta & 0x7ff) * 2]; - ac = rcossin_tbl[(dtheta + 1024 & 0x7ff) * 2]; + as = RSIN(dtheta & 0x7ff); // rcossin_tbl[(dtheta & 0x7ff) * 2]; + ac = RSIN(dtheta + 1024 & 0x7ff); // rcossin_tbl[(dtheta + 1024 & 0x7ff) * 2]; delta.vx = body[0].x.vx - body[1].x.vx; delta.vz = body[0].x.vz - body[1].x.vz; diff --git a/src_rebuild/Game/C/handling.c b/src_rebuild/Game/C/handling.c index 44311dac..891b4773 100644 --- a/src_rebuild/Game/C/handling.c +++ b/src_rebuild/Game/C/handling.c @@ -971,15 +971,11 @@ void InitialiseCarHandling(void) // [D] [T] void CheckCarToCarCollisions(void) { - int fz; - int fx; - int sz; - int sx; + int fx, fz; + int sx, sz; int loop1, loop2; - int lbod; - int wbod; - int hbod; + int lbod, wbod, hbod; int xx, zz; BOUND_BOX* bb; @@ -988,7 +984,6 @@ void CheckCarToCarCollisions(void) CAR_DATA* cp; SVECTOR* colBox; - if (ghost_mode == 1) return; diff --git a/src_rebuild/Game/C/wheelforces.c b/src_rebuild/Game/C/wheelforces.c index b81b652c..e8b343ba 100644 --- a/src_rebuild/Game/C/wheelforces.c +++ b/src_rebuild/Game/C/wheelforces.c @@ -13,6 +13,8 @@ #include "glaunch.h" #include "system.h" +#define GRAVITY_FORCE (-7456) // D1 has -10922 + struct CAR_LOCALS { LONGVECTOR4 vel; @@ -520,9 +522,9 @@ void AddWheelForcesDriver1(CAR_DATA* cp, CAR_LOCALS* cl) void StepOneCar(CAR_DATA* cp) { static int frictionLimit[6] = { - 0x3ED000, 0x178E000, - 0x3ED000, 0x13A1000, - 0x75C6000,0x13A1000 + 1005 * ONE, 6030 * ONE, + 1005 * ONE, 5025 * ONE, + 1884 * ONE, 5025 * ONE }; volatile int impulse; @@ -532,14 +534,9 @@ void StepOneCar(CAR_DATA* cp) int a, b, speed; int count, i; CAR_LOCALS _cl; - LONGVECTOR4 deepestNormal; - LONGVECTOR4 deepestLever; - LONGVECTOR4 deepestPoint; - LONGVECTOR4 pointPos; - LONGVECTOR4 surfacePoint; - LONGVECTOR4 surfaceNormal; - LONGVECTOR4 lever; - LONGVECTOR4 reaction; + LONGVECTOR4 deepestNormal, deepestLever, deepestPoint; + LONGVECTOR4 pointPos, surfacePoint, surfaceNormal; + LONGVECTOR4 lever, reaction; VECTOR direction; sdPlane* SurfacePtr; @@ -559,7 +556,7 @@ void StepOneCar(CAR_DATA* cp) } cp->hd.acc[0] = 0; - cp->hd.acc[1] = -7456; // apply gravity + cp->hd.acc[1] = GRAVITY_FORCE; // apply gravity cp->hd.acc[2] = 0; // calculate car speed