mirror of
https://github.com/OpenDriver2/REDRIVER2.git
synced 2024-11-22 02:12:43 +01:00
Merge pull request #1 from OpenDriver2/develop-SoapyMan
Develop soapy man
This commit is contained in:
commit
deba1190f0
@ -607,7 +607,12 @@ int CarBuildingCollision(CAR_DATA *cp, BUILDING_BOX *building, CELL_OBJECT *cop,
|
||||
model = modelpointers[cop->type];
|
||||
player_id = GetPlayerId(cp);
|
||||
|
||||
cd[1].isCameraOrTanner = (cp->controlType == CONTROL_TYPE_TANNERCOLLIDER || cp->controlType == CONTROL_TYPE_CAMERACOLLIDER);
|
||||
cd[0].isCameraOrTanner = (cp->controlType == CONTROL_TYPE_TANNERCOLLIDER || cp->controlType == CONTROL_TYPE_CAMERACOLLIDER);
|
||||
|
||||
if (cp->controlType == CONTROL_TYPE_TANNERCOLLIDER)
|
||||
cd[0].isCameraOrTanner += 2;
|
||||
|
||||
cd[1].isCameraOrTanner = (flags & CollisionCheckFlag_MightBeABarrier) == 0;
|
||||
|
||||
boxDiffY = cp->hd.oBox.location.vy + building->pos.vy;
|
||||
boxDiffY = ABS(boxDiffY);
|
||||
@ -838,7 +843,7 @@ int CarBuildingCollision(CAR_DATA *cp, BUILDING_BOX *building, CELL_OBJECT *cop,
|
||||
pointVel[1] = FIXEDH(cp->st.n.angularVelocity[2] * lever[0] - cp->st.n.angularVelocity[0] * lever[2]) + cp->st.n.linearVelocity[1];
|
||||
pointVel[2] = FIXEDH(cp->st.n.angularVelocity[0] * lever[1] - cp->st.n.angularVelocity[1] * lever[0]) + cp->st.n.linearVelocity[2];
|
||||
|
||||
if (flags & 0x2) // [A] Vegas train velocity - added here
|
||||
if (flags & CollisionCheckFlag_IsVegasMovingTrain) // [A] Vegas train velocity - added here
|
||||
{
|
||||
pointVel[2] += 700000;
|
||||
}
|
||||
|
@ -1,6 +1,12 @@
|
||||
#ifndef BCOLLIDE_H
|
||||
#define BCOLLIDE_H
|
||||
|
||||
enum CollisionCheckFlags
|
||||
{
|
||||
CollisionCheckFlag_MightBeABarrier = 0x1,
|
||||
CollisionCheckFlag_IsVegasMovingTrain = 0x2,
|
||||
};
|
||||
|
||||
extern int bcollided2d(CDATA2D *body, int* boxOverlap = NULL); // 0x0001C51C
|
||||
|
||||
extern void bFindCollisionPoint(CDATA2D *body, CRET2D *collisionResult); // 0x0001C8C0
|
||||
|
@ -1776,7 +1776,7 @@ int CreateCivCarWotDrivesABitThenStops(int direction, LONGVECTOR4* startPos, LON
|
||||
|
||||
carCnt++;
|
||||
slot++;
|
||||
} while (carCnt < &car_data[MAX_TRAFFIC_CARS]);
|
||||
} while (carCnt < &car_data[MAX_CARS]);
|
||||
|
||||
if (pNewCar == NULL)
|
||||
return -1;
|
||||
@ -1869,7 +1869,7 @@ int CreateStationaryCivCar(int direction, long orientX, long orientZ, LONGVECTOR
|
||||
|
||||
carCnt++;
|
||||
slot++;
|
||||
} while (carCnt < &car_data[MAX_TRAFFIC_CARS]);
|
||||
} while (carCnt < &car_data[MAX_CARS]);
|
||||
}
|
||||
|
||||
if (newCar)
|
||||
@ -2086,7 +2086,7 @@ int PingInCivCar(int minPingInDist)
|
||||
|
||||
carCnt++;
|
||||
slot++;
|
||||
} while (carCnt < &car_data[MAX_TRAFFIC_CARS]);
|
||||
} while (carCnt < &car_data[MAX_CARS]);
|
||||
|
||||
if (newCar == NULL)
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -705,7 +705,7 @@ void CheckScenaryCollisions(CAR_DATA *cp)
|
||||
{
|
||||
if (count >= mdcount && cop->pad != 0)
|
||||
{
|
||||
if (CarBuildingCollision(cp, &bbox, cop, 0) != 0)
|
||||
if (CarBuildingCollision(cp, &bbox, cop, 0))
|
||||
{
|
||||
if (!bKillTanner)
|
||||
player[0].dying = 1;
|
||||
@ -754,7 +754,7 @@ void CheckScenaryCollisions(CAR_DATA *cp)
|
||||
{
|
||||
cp->st.n.linearVelocity[2] = ExBoxDamage + cp->st.n.linearVelocity[2];
|
||||
|
||||
if (CarBuildingCollision(cp, &bbox, cop, (cop->pad == 1) ? 0x2 : 0) != 0)
|
||||
if (CarBuildingCollision(cp, &bbox, cop, (cop->pad == 1) ? CollisionCheckFlag_IsVegasMovingTrain : 0))
|
||||
{
|
||||
cp->ap.needsDenting = 1;
|
||||
}
|
||||
@ -763,7 +763,7 @@ void CheckScenaryCollisions(CAR_DATA *cp)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CarBuildingCollision(cp, &bbox, cop, (model->flags2 >> 10) & 1) != 0)
|
||||
if (CarBuildingCollision(cp, &bbox, cop, (model->flags2 & MODEL_FLAG_BARRIER) ? CollisionCheckFlag_MightBeABarrier : 0))
|
||||
cp->ap.needsDenting = 1;
|
||||
}
|
||||
}
|
||||
|
@ -473,6 +473,12 @@ void DisplayMoon(DVECTOR* pos, CVECTOR* col, int flip)
|
||||
}
|
||||
|
||||
extern VECTOR dummy;
|
||||
RECT16 sun_source = {
|
||||
1008,
|
||||
456,
|
||||
16,
|
||||
10
|
||||
};
|
||||
|
||||
// [D] [T]
|
||||
void DrawLensFlare(void)
|
||||
@ -507,12 +513,7 @@ void DrawLensFlare(void)
|
||||
RECT16 source;
|
||||
CVECTOR col;
|
||||
|
||||
source = {
|
||||
1008,
|
||||
456,
|
||||
16,
|
||||
10
|
||||
};
|
||||
source = sun_source;
|
||||
|
||||
if (gWeather - 1U <= 1 || gTimeOfDay == 0 || gTimeOfDay == 2)
|
||||
return;
|
||||
@ -675,11 +676,16 @@ void DrawLensFlare(void)
|
||||
source.x = sun_pers_conv_position.vx;
|
||||
source.y = sun_pers_conv_position.vy + last->disp.disp.y;
|
||||
|
||||
#if 1//def PSX
|
||||
sample_sun = (DR_MOVE*)current->primptr;
|
||||
SetDrawMove(sample_sun, &source, 1008, 456);
|
||||
|
||||
addPrim(current->ot + 0x20, sample_sun);
|
||||
current->primptr += sizeof(DR_MOVE);
|
||||
#else
|
||||
// to avoid delays and uploads to GPU we're simply going to directly request from screen VRAM area
|
||||
sun_source = source;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -86,7 +86,12 @@ extern DB MPBuff[2][2];
|
||||
extern DB* last;
|
||||
extern DB* current;
|
||||
|
||||
#define OTSIZE 0x1080 /* ordering table size */
|
||||
// ordering table size
|
||||
#ifdef PSX
|
||||
#define OTSIZE 0x1080
|
||||
#else
|
||||
#define OTSIZE 0x2000
|
||||
#endif
|
||||
|
||||
#ifdef USE_EXTENDED_PRIM_POINTERS
|
||||
# define PRIMTAB_SIZE 0x50000
|
||||
|
@ -11,7 +11,6 @@
|
||||
#define MAX_PEDESTRIANS 28
|
||||
#define MAX_SEATED_PEDS 20
|
||||
#define MAX_PLACED_PEDS 15
|
||||
#define MAX_TRAFFIC_CARS 19
|
||||
#define MAX_EXPLOSION_OBJECTS 5
|
||||
#define MAX_THROWN_BOMBS 5
|
||||
#define MAX_MOTION_CAPTURE 24
|
||||
|
@ -363,6 +363,7 @@ enum ModelFlags2
|
||||
MODEL_FLAG_ALLEY = 0x80,
|
||||
MODEL_FLAG_HASROOF = 0x100,
|
||||
MODEL_FLAG_NOCOL_200 = 0x200,
|
||||
MODEL_FLAG_BARRIER = 0x400,
|
||||
MODEL_FLAG_SMASHABLE = 0x800,
|
||||
MODEL_FLAG_LAMP = 0x1000,
|
||||
MODEL_FLAG_TREE = 0x2000,
|
||||
|
@ -310,8 +310,8 @@ void GameDebugKeys(int nKey, bool down)
|
||||
else if (nKey == SDL_SCANCODE_2)
|
||||
{
|
||||
gShowCollisionDebug++;
|
||||
if (gShowCollisionDebug > 3)
|
||||
gShowCollisionDebug = 0;
|
||||
gShowCollisionDebug %= 5;
|
||||
|
||||
printf("Collision debug: %d\n", gShowCollisionDebug);
|
||||
}
|
||||
else if (nKey == SDL_SCANCODE_3)
|
||||
|
Loading…
Reference in New Issue
Block a user