summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Cam.cpp28
-rw-r--r--src/core/Camera.cpp12
-rw-r--r--src/core/Camera.h5
-rw-r--r--src/core/Collision.cpp37
-rw-r--r--src/core/Collision.h6
-rw-r--r--src/core/PlayerInfo.h1
-rw-r--r--src/core/SurfaceTable.cpp108
-rw-r--r--src/core/SurfaceTable.h57
-rw-r--r--src/core/TempColModels.cpp28
-rw-r--r--src/core/World.cpp62
-rw-r--r--src/core/World.h7
-rw-r--r--src/core/re3.cpp10
12 files changed, 193 insertions, 168 deletions
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index d465fb5d..d04e8683 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -504,11 +504,11 @@ CCam::ProcessSpecialHeightRoutines(void)
switch(((CPhysical*)CamTargetEntity)->m_nSurfaceTouched)
case SURFACE_GRASS:
- case SURFACE_DIRT:
- case SURFACE_DIRTTRACK:
- case SURFACE_STEEL:
- case SURFACE_TIRE:
- case SURFACE_STONE:
+ case SURFACE_GRAVEL:
+ case SURFACE_MUD_DRY:
+ case SURFACE_THICK_METAL_PLATE:
+ case SURFACE_RUBBER:
+ case SURFACE_STEEP_CLIFF:
OnRoad = true;
if(CCullZones::PlayerNoRain())
@@ -565,9 +565,9 @@ CCam::ProcessSpecialHeightRoutines(void)
if(PreviouslyFailedRoadHeightCheck && m_fCloseInPedHeightOffset < 0.0001f){
if(colPoint.surfaceB != SURFACE_TARMAC &&
colPoint.surfaceB != SURFACE_GRASS &&
- colPoint.surfaceB != SURFACE_DIRT &&
- colPoint.surfaceB != SURFACE_DIRTTRACK &&
- colPoint.surfaceB != SURFACE_STONE){
+ colPoint.surfaceB != SURFACE_GRAVEL &&
+ colPoint.surfaceB != SURFACE_MUD_DRY &&
+ colPoint.surfaceB != SURFACE_STEEP_CLIFF){
if(m_fRoadOffSet > 1.4f)
m_fRoadOffSet = 1.4f;
}else{
@@ -1408,11 +1408,11 @@ CCam::Process_FollowPed(const CVector &CameraTarget, float TargetOrientation, fl
bool foo = false;
switch(((CPhysical*)CamTargetEntity)->m_nSurfaceTouched)
case SURFACE_GRASS:
- case SURFACE_DIRT:
+ case SURFACE_GRAVEL:
case SURFACE_PAVEMENT:
- case SURFACE_STEEL:
- case SURFACE_TIRE:
- case SURFACE_STONE:
+ case SURFACE_THICK_METAL_PLATE:
+ case SURFACE_RUBBER:
+ case SURFACE_STEEP_CLIFF:
foo = true;
if(foo)
WellBufferMe(TargetHeight, &m_fCamBufferedHeight, &m_fCamBufferedHeightSpeed, 0.4f, 0.05f, false);
@@ -1750,8 +1750,8 @@ CCam::WorkOutCamHeightWeeCar(CVector &TargetCoors, float TargetOrientation)
else
WellBufferMe(TargetZOffSet, &RoadHeightFix, &RoadHeightFixSpeed, 0.27f, 0.1f, false);
- if((colpoint.surfaceB == SURFACE_DEFAULT || colpoint.surfaceB >= SURFACE_METAL6) &&
- colpoint.surfaceB != SURFACE_STEEL && colpoint.surfaceB != SURFACE_STONE &&
+ if((colpoint.surfaceB == SURFACE_DEFAULT || colpoint.surfaceB >= SURFACE_CAR) &&
+ colpoint.surfaceB != SURFACE_THICK_METAL_PLATE && colpoint.surfaceB != SURFACE_STEEP_CLIFF &&
RoadHeightFix > 1.4f)
RoadHeightFix = 1.4f;
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index 3b7bdbaf..f618c652 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -3281,6 +3281,18 @@ CCamera::Find3rdPersonQuickAimPitch(void)
return -(DEGTORAD(((0.5f - m_f3rdPersonCHairMultY) * 1.8f * 0.5f * Cams[ActiveCam].FOV)) + rot);
}
+bool
+CCamera::Using1stPersonWeaponMode(void)
+{
+ switch(PlayerWeaponMode.Mode)
+ case CCam::MODE_SNIPER:
+ case CCam::MODE_M16_1STPERSON:
+ case CCam::MODE_ROCKETLAUNCHER:
+ case CCam::MODE_HELICANNON_1STPERSON:
+ case CCam::MODE_CAMERA:
+ return true;
+ return false;
+}
void
diff --git a/src/core/Camera.h b/src/core/Camera.h
index 135f9d8f..4e90855b 100644
--- a/src/core/Camera.h
+++ b/src/core/Camera.h
@@ -91,7 +91,9 @@ public:
MODE_M16_1STPERSON_RUNABOUT,
MODE_FIGHT_CAM_RUNABOUT,
MODE_EDITOR,
- MODE_HELICANNON_1STPERSON, // vice city leftover
+ MODE_HELICANNON_1STPERSON,
+ MODE_45,
+ MODE_CAMERA,
};
bool bBelowMinDist; //used for follow ped mode
@@ -625,6 +627,7 @@ public:
void UpdateAimingCoors(CVector const &coors);
void Find3rdPersonCamTargetVector(float dist, CVector pos, CVector &source, CVector &target);
float Find3rdPersonQuickAimPitch(void);
+ bool Using1stPersonWeaponMode(void);
// Physical camera
void SetRwCamera(RwCamera *cam);
diff --git a/src/core/Collision.cpp b/src/core/Collision.cpp
index c29c1d28..b68214af 100644
--- a/src/core/Collision.cpp
+++ b/src/core/Collision.cpp
@@ -414,8 +414,9 @@ CCollision::TestSphereTriangle(const CColSphere &sphere,
return dist < sphere.radius;
}
+//--MIAMI: TODO
bool
-CCollision::TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColModel &model, bool ignoreSeeThrough)
+CCollision::TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColModel &model, bool ignoreSeeThrough, bool ignoreShootThrough)
{
static CMatrix matTransform;
int i;
@@ -429,18 +430,18 @@ CCollision::TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColMod
return false;
for(i = 0; i < model.numSpheres; i++)
- if(!ignoreSeeThrough || model.spheres[i].surface != SURFACE_GLASS && model.spheres[i].surface != SURFACE_SCAFFOLD)
+ if(!ignoreSeeThrough || model.spheres[i].surface != SURFACE_GLASS && model.spheres[i].surface != SURFACE_TRANSPARENT_CLOTH)
if(TestLineSphere(newline, model.spheres[i]))
return true;
for(i = 0; i < model.numBoxes; i++)
- if(!ignoreSeeThrough || model.boxes[i].surface != SURFACE_GLASS && model.boxes[i].surface != SURFACE_SCAFFOLD)
+ if(!ignoreSeeThrough || model.boxes[i].surface != SURFACE_GLASS && model.boxes[i].surface != SURFACE_TRANSPARENT_CLOTH)
if(TestLineBox(newline, model.boxes[i]))
return true;
CalculateTrianglePlanes(&model);
for(i = 0; i < model.numTriangles; i++)
- if(!ignoreSeeThrough || model.triangles[i].surface != SURFACE_GLASS && model.triangles[i].surface != SURFACE_SCAFFOLD)
+ if(!ignoreSeeThrough || model.triangles[i].surface != SURFACE_GLASS && model.triangles[i].surface != SURFACE_TRANSPARENT_CLOTH)
if(TestLineTriangle(newline, model.vertices, model.triangles[i], model.trianglePlanes[i]))
return true;
@@ -1042,10 +1043,11 @@ CCollision::ProcessSphereTriangle(const CColSphere &sphere,
return true;
}
+//--MIAMI: TODO
bool
CCollision::ProcessLineOfSight(const CColLine &line,
const CMatrix &matrix, CColModel &model,
- CColPoint &point, float &mindist, bool ignoreSeeThrough)
+ CColPoint &point, float &mindist, bool ignoreSeeThrough, bool ignoreShootThrough)
{
static CMatrix matTransform;
int i;
@@ -1060,16 +1062,16 @@ CCollision::ProcessLineOfSight(const CColLine &line,
float coldist = mindist;
for(i = 0; i < model.numSpheres; i++)
- if(!ignoreSeeThrough || model.spheres[i].surface != SURFACE_GLASS && model.spheres[i].surface != SURFACE_SCAFFOLD)
+ if(!ignoreSeeThrough || model.spheres[i].surface != SURFACE_GLASS && model.spheres[i].surface != SURFACE_TRANSPARENT_CLOTH)
ProcessLineSphere(newline, model.spheres[i], point, coldist);
for(i = 0; i < model.numBoxes; i++)
- if(!ignoreSeeThrough || model.boxes[i].surface != SURFACE_GLASS && model.boxes[i].surface != SURFACE_SCAFFOLD)
+ if(!ignoreSeeThrough || model.boxes[i].surface != SURFACE_GLASS && model.boxes[i].surface != SURFACE_TRANSPARENT_CLOTH)
ProcessLineBox(newline, model.boxes[i], point, coldist);
CalculateTrianglePlanes(&model);
for(i = 0; i < model.numTriangles; i++)
- if(!ignoreSeeThrough || model.triangles[i].surface != SURFACE_GLASS && model.triangles[i].surface != SURFACE_SCAFFOLD)
+ if(!ignoreSeeThrough || model.triangles[i].surface != SURFACE_GLASS && model.triangles[i].surface != SURFACE_TRANSPARENT_CLOTH)
ProcessLineTriangle(newline, model.vertices, model.triangles[i], model.trianglePlanes[i], point, coldist);
if(coldist < mindist){
@@ -1081,10 +1083,11 @@ CCollision::ProcessLineOfSight(const CColLine &line,
return false;
}
+//--MIAMI: TODO
bool
CCollision::ProcessVerticalLine(const CColLine &line,
const CMatrix &matrix, CColModel &model,
- CColPoint &point, float &mindist, bool ignoreSeeThrough, CStoredCollPoly *poly)
+ CColPoint &point, float &mindist, bool ignoreSeeThrough, bool ignoreShootThrough, CStoredCollPoly *poly)
{
static CStoredCollPoly TempStoredPoly;
int i;
@@ -1100,17 +1103,17 @@ CCollision::ProcessVerticalLine(const CColLine &line,
float coldist = mindist;
for(i = 0; i < model.numSpheres; i++)
- if(!ignoreSeeThrough || model.spheres[i].surface != SURFACE_GLASS && model.spheres[i].surface != SURFACE_SCAFFOLD)
+ if(!ignoreSeeThrough || model.spheres[i].surface != SURFACE_GLASS && model.spheres[i].surface != SURFACE_TRANSPARENT_CLOTH)
ProcessLineSphere(newline, model.spheres[i], point, coldist);
for(i = 0; i < model.numBoxes; i++)
- if(!ignoreSeeThrough || model.boxes[i].surface != SURFACE_GLASS && model.boxes[i].surface != SURFACE_SCAFFOLD)
+ if(!ignoreSeeThrough || model.boxes[i].surface != SURFACE_GLASS && model.boxes[i].surface != SURFACE_TRANSPARENT_CLOTH)
ProcessLineBox(newline, model.boxes[i], point, coldist);
CalculateTrianglePlanes(&model);
TempStoredPoly.valid = false;
for(i = 0; i < model.numTriangles; i++)
- if(!ignoreSeeThrough || model.triangles[i].surface != SURFACE_GLASS && model.triangles[i].surface != SURFACE_SCAFFOLD)
+ if(!ignoreSeeThrough || model.triangles[i].surface != SURFACE_GLASS && model.triangles[i].surface != SURFACE_TRANSPARENT_CLOTH)
ProcessVerticalLineTriangle(newline, model.vertices, model.triangles[i], model.trianglePlanes[i], point, coldist, &TempStoredPoly);
if(coldist < mindist){
@@ -1639,15 +1642,15 @@ CCollision::DrawColModel_Coloured(const CMatrix &mat, const CColModel &colModel,
b *= f;
}
- if(s == SURFACE_SCAFFOLD || s == SURFACE_METAL_FENCE ||
- s == SURFACE_BOLLARD || s == SURFACE_METAL_POLE)
+ if(s == SURFACE_TRANSPARENT_CLOTH || s == SURFACE_METAL_CHAIN_FENCE ||
+ s == SURFACE_TRANSPARENT_STONE || s == SURFACE_SCAFFOLD_POLE)
if(CTimer::GetFrameCounter() & 1){
r = 0;
g = 0;
b = 0;
}
- if(s > SURFACE_GATE){
+ if(s > SURFACE_METAL_GATE){
r = CGeneral::GetRandomNumber();
g = CGeneral::GetRandomNumber();
b = CGeneral::GetRandomNumber();
@@ -1720,8 +1723,8 @@ CCollision::DrawColModel_Coloured(const CMatrix &mat, const CColModel &colModel,
b *= f;
}
- if(s == SURFACE_SCAFFOLD || s == SURFACE_METAL_FENCE ||
- s == SURFACE_BOLLARD || s == SURFACE_METAL_POLE)
+ if(s == SURFACE_TRANSPARENT_CLOTH || s == SURFACE_METAL_CHAIN_FENCE ||
+ s == SURFACE_TRANSPARENT_STONE || s == SURFACE_SCAFFOLD_POLE)
if(CTimer::GetFrameCounter() & 1){
r = 0;
g = 0;
diff --git a/src/core/Collision.h b/src/core/Collision.h
index 4b0c2fb9..12af5225 100644
--- a/src/core/Collision.h
+++ b/src/core/Collision.h
@@ -151,7 +151,7 @@ public:
static bool TestLineTriangle(const CColLine &line, const CVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane);
static bool TestLineSphere(const CColLine &line, const CColSphere &sph);
static bool TestSphereTriangle(const CColSphere &sphere, const CVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane);
- static bool TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColModel &model, bool ignoreSeeThrough);
+ static bool TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColModel &model, bool ignoreSeeThrough, bool ignoreShootThrough);
static bool ProcessSphereSphere(const CColSphere &s1, const CColSphere &s2, CColPoint &point, float &mindistsq);
static bool ProcessSphereBox(const CColSphere &sph, const CColBox &box, CColPoint &point, float &mindistsq);
@@ -160,8 +160,8 @@ public:
static bool ProcessLineTriangle(const CColLine &line , const CVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane, CColPoint &point, float &mindist);
static bool ProcessLineSphere(const CColLine &line, const CColSphere &sphere, CColPoint &point, float &mindist);
static bool ProcessSphereTriangle(const CColSphere &sph, const CVector *verts, const CColTriangle &tri, const CColTrianglePlane &plane, CColPoint &point, float &mindistsq);
- static bool ProcessLineOfSight(const CColLine &line, const CMatrix &matrix, CColModel &model, CColPoint &point, float &mindist, bool ignoreSeeThrough);
- static bool ProcessVerticalLine(const CColLine &line, const CMatrix &matrix, CColModel &model, CColPoint &point, float &mindist, bool ignoreSeeThrough, CStoredCollPoly *poly);
+ static bool ProcessLineOfSight(const CColLine &line, const CMatrix &matrix, CColModel &model, CColPoint &point, float &mindist, bool ignoreSeeThrough, bool ignoreShootThrough);
+ static bool ProcessVerticalLine(const CColLine &line, const CMatrix &matrix, CColModel &model, CColPoint &point, float &mindist, bool ignoreSeeThrough, bool ignoreShootThrough, CStoredCollPoly *poly);
static int32 ProcessColModels(const CMatrix &matrixA, CColModel &modelA, const CMatrix &matrixB, CColModel &modelB, CColPoint *spherepoints, CColPoint *linepoints, float *linedists);
static bool IsStoredPolyStillValidVerticalLine(const CVector &pos, float z, CColPoint &point, CStoredCollPoly *poly);
diff --git a/src/core/PlayerInfo.h b/src/core/PlayerInfo.h
index 119f0b2c..e2e874e6 100644
--- a/src/core/PlayerInfo.h
+++ b/src/core/PlayerInfo.h
@@ -51,6 +51,7 @@ public:
int32 field_268;
int32 field_272;
uint32 m_nHavocLevel;
+ float m_fMediaAttention;
bool m_bInfiniteSprint;
bool m_bFastReload;
bool m_bFireproof;
diff --git a/src/core/SurfaceTable.cpp b/src/core/SurfaceTable.cpp
index f002bf49..9076a9a6 100644
--- a/src/core/SurfaceTable.cpp
+++ b/src/core/SurfaceTable.cpp
@@ -59,38 +59,38 @@ CSurfaceTable::GetAdhesionGroup(uint8 surfaceType)
case SURFACE_DEFAULT: return ADHESIVE_ROAD;
case SURFACE_TARMAC: return ADHESIVE_ROAD;
case SURFACE_GRASS: return ADHESIVE_LOOSE;
- case SURFACE_DIRT: return ADHESIVE_LOOSE;
- case SURFACE_DIRTTRACK: return ADHESIVE_HARD;
+ case SURFACE_GRAVEL: return ADHESIVE_LOOSE;
+ case SURFACE_MUD_DRY: return ADHESIVE_HARD;
case SURFACE_PAVEMENT: return ADHESIVE_ROAD;
- case SURFACE_METAL6: return ADHESIVE_HARD;
+ case SURFACE_CAR: return ADHESIVE_HARD;
case SURFACE_GLASS: return ADHESIVE_HARD;
- case SURFACE_SCAFFOLD: return ADHESIVE_HARD;
- case SURFACE_METAL_DOOR: return ADHESIVE_HARD;
- case SURFACE_BILLBOARD: return ADHESIVE_HARD;
- case SURFACE_STEEL: return ADHESIVE_HARD;
- case SURFACE_METAL_POLE: return ADHESIVE_HARD;
- case SURFACE_STREET_LIGHT: return ADHESIVE_HARD;
- case SURFACE_METAL14: return ADHESIVE_HARD;
- case SURFACE_METAL15: return ADHESIVE_HARD;
- case SURFACE_METAL_FENCE: return ADHESIVE_HARD;
- case SURFACE_FLESH: return ADHESIVE_RUBBER;
+ case SURFACE_TRANSPARENT_CLOTH: return ADHESIVE_HARD;
+ case SURFACE_GARAGE_DOOR: return ADHESIVE_HARD;
+ case SURFACE_CAR_PANEL: return ADHESIVE_HARD;
+ case SURFACE_THICK_METAL_PLATE: return ADHESIVE_HARD;
+ case SURFACE_SCAFFOLD_POLE: return ADHESIVE_HARD;
+ case SURFACE_LAMP_POST: return ADHESIVE_HARD;
+ case SURFACE_FIRE_HYDRANT: return ADHESIVE_HARD;
+ case SURFACE_GIRDER: return ADHESIVE_HARD;
+ case SURFACE_METAL_CHAIN_FENCE: return ADHESIVE_HARD;
+ case SURFACE_PED: return ADHESIVE_RUBBER;
case SURFACE_SAND: return ADHESIVE_SAND;
- case SURFACE_PUDDLE: return ADHESIVE_WET;
- case SURFACE_WOOD: return ADHESIVE_ROAD;
- case SURFACE_WOOD_BOX: return ADHESIVE_ROAD;
- case SURFACE_WOOD_PLANK: return ADHESIVE_ROAD;
- case SURFACE_TIRE: return ADHESIVE_RUBBER;
- case SURFACE_HARD24: return ADHESIVE_HARD;
+ case SURFACE_WATER: return ADHESIVE_WET;
+ case SURFACE_WOOD_CRATES: return ADHESIVE_ROAD;
+ case SURFACE_WOOD_BENCH: return ADHESIVE_ROAD;
+ case SURFACE_WOOD_SOLID: return ADHESIVE_ROAD;
+ case SURFACE_RUBBER: return ADHESIVE_RUBBER;
+ case SURFACE_PLASTIC: return ADHESIVE_HARD;
case SURFACE_HEDGE: return ADHESIVE_LOOSE;
- case SURFACE_STONE: return ADHESIVE_LOOSE;
- case SURFACE_METAL27: return ADHESIVE_HARD;
- case SURFACE_METAL28: return ADHESIVE_HARD;
- case SURFACE_RUBBER29: return ADHESIVE_RUBBER;
- case SURFACE_LOOSE30: return ADHESIVE_LOOSE;
- case SURFACE_BOLLARD: return ADHESIVE_HARD;
- case SURFACE_GATE: return ADHESIVE_HARD;
- case SURFACE_SAND33: return ADHESIVE_SAND;
- case SURFACE_ROAD34: return ADHESIVE_ROAD;
+ case SURFACE_STEEP_CLIFF: return ADHESIVE_LOOSE;
+ case SURFACE_CONTAINER: return ADHESIVE_HARD;
+ case SURFACE_NEWS_VENDOR: return ADHESIVE_HARD;
+ case SURFACE_WHEELBASE: return ADHESIVE_RUBBER;
+ case SURFACE_CARDBOARDBOX: return ADHESIVE_LOOSE;
+ case SURFACE_TRANSPARENT_STONE: return ADHESIVE_HARD;
+ case SURFACE_METAL_GATE: return ADHESIVE_HARD;
+ case SURFACE_SAND_BEACH: return ADHESIVE_SAND;
+ case SURFACE_CONCRETE_BEACH: return ADHESIVE_ROAD;
default: return ADHESIVE_ROAD;
}
}
@@ -101,41 +101,41 @@ CSurfaceTable::GetWetMultiplier(uint8 surfaceType)
switch(surfaceType){
case SURFACE_DEFAULT:
case SURFACE_TARMAC:
- case SURFACE_DIRTTRACK:
+ case SURFACE_MUD_DRY:
case SURFACE_PAVEMENT:
- case SURFACE_SCAFFOLD:
- case SURFACE_WOOD:
- case SURFACE_WOOD_BOX:
- case SURFACE_WOOD_PLANK:
+ case SURFACE_TRANSPARENT_CLOTH:
+ case SURFACE_WOOD_CRATES:
+ case SURFACE_WOOD_BENCH:
+ case SURFACE_WOOD_SOLID:
case SURFACE_HEDGE:
- case SURFACE_LOOSE30:
- case SURFACE_BOLLARD:
- case SURFACE_ROAD34:
+ case SURFACE_CARDBOARDBOX:
+ case SURFACE_TRANSPARENT_STONE:
+ case SURFACE_CONCRETE_BEACH:
return 1.0f - CWeather::WetRoads*0.25f;
case SURFACE_GRASS:
- case SURFACE_METAL6:
+ case SURFACE_CAR:
case SURFACE_GLASS:
- case SURFACE_METAL_DOOR:
- case SURFACE_BILLBOARD:
- case SURFACE_STEEL:
- case SURFACE_METAL_POLE:
- case SURFACE_STREET_LIGHT:
- case SURFACE_METAL14:
- case SURFACE_METAL15:
- case SURFACE_METAL_FENCE:
- case SURFACE_FLESH:
- case SURFACE_TIRE:
- case SURFACE_HARD24:
- case SURFACE_STONE:
- case SURFACE_METAL27:
- case SURFACE_METAL28:
- case SURFACE_RUBBER29:
- case SURFACE_GATE:
+ case SURFACE_GARAGE_DOOR:
+ case SURFACE_CAR_PANEL:
+ case SURFACE_THICK_METAL_PLATE:
+ case SURFACE_SCAFFOLD_POLE:
+ case SURFACE_LAMP_POST:
+ case SURFACE_FIRE_HYDRANT:
+ case SURFACE_GIRDER:
+ case SURFACE_METAL_CHAIN_FENCE:
+ case SURFACE_PED:
+ case SURFACE_RUBBER:
+ case SURFACE_PLASTIC:
+ case SURFACE_STEEP_CLIFF:
+ case SURFACE_CONTAINER:
+ case SURFACE_NEWS_VENDOR:
+ case SURFACE_WHEELBASE:
+ case SURFACE_METAL_GATE:
return 1.0f - CWeather::WetRoads*0.4f;
case SURFACE_SAND:
- case SURFACE_SAND33:
+ case SURFACE_SAND_BEACH:
return 1.0f - CWeather::WetRoads*0.5f;
default:
diff --git a/src/core/SurfaceTable.h b/src/core/SurfaceTable.h
index 5d8d2c4f..d8f9be3d 100644
--- a/src/core/SurfaceTable.h
+++ b/src/core/SurfaceTable.h
@@ -1,43 +1,42 @@
#pragma once
-// TODO: check this
enum eSurfaceType
{
SURFACE_DEFAULT,
SURFACE_TARMAC,
SURFACE_GRASS,
- SURFACE_DIRT,
- SURFACE_DIRTTRACK,
+ SURFACE_GRAVEL,
+ SURFACE_MUD_DRY,
SURFACE_PAVEMENT,
- SURFACE_METAL6,
+ SURFACE_CAR,
SURFACE_GLASS,
- SURFACE_SCAFFOLD,
- SURFACE_METAL_DOOR, // garage door
- SURFACE_BILLBOARD,
- SURFACE_STEEL, //?
- SURFACE_METAL_POLE, // ?
- SURFACE_STREET_LIGHT,
- SURFACE_METAL14,
- SURFACE_METAL15,
- SURFACE_METAL_FENCE,
- SURFACE_FLESH,
+ SURFACE_TRANSPARENT_CLOTH,
+ SURFACE_GARAGE_DOOR,
+ SURFACE_CAR_PANEL,
+ SURFACE_THICK_METAL_PLATE,
+ SURFACE_SCAFFOLD_POLE,
+ SURFACE_LAMP_POST,
+ SURFACE_FIRE_HYDRANT,
+ SURFACE_GIRDER,
+ SURFACE_METAL_CHAIN_FENCE,
+ SURFACE_PED,
SURFACE_SAND,
- SURFACE_PUDDLE,
- SURFACE_WOOD,
- SURFACE_WOOD_BOX,
- SURFACE_WOOD_PLANK,
- SURFACE_TIRE,
- SURFACE_HARD24,
+ SURFACE_WATER,
+ SURFACE_WOOD_CRATES,
+ SURFACE_WOOD_BENCH,
+ SURFACE_WOOD_SOLID,
+ SURFACE_RUBBER,
+ SURFACE_PLASTIC,
SURFACE_HEDGE,
- SURFACE_STONE,
- SURFACE_METAL27,
- SURFACE_METAL28,
- SURFACE_RUBBER29,
- SURFACE_LOOSE30,
- SURFACE_BOLLARD,
- SURFACE_GATE,
- SURFACE_SAND33,
- SURFACE_ROAD34,
+ SURFACE_STEEP_CLIFF,
+ SURFACE_CONTAINER,
+ SURFACE_NEWS_VENDOR,
+ SURFACE_WHEELBASE,
+ SURFACE_CARDBOARDBOX,
+ SURFACE_TRANSPARENT_STONE,
+ SURFACE_METAL_GATE,
+ SURFACE_SAND_BEACH,
+ SURFACE_CONCRETE_BEACH,
};
enum
diff --git a/src/core/TempColModels.cpp b/src/core/TempColModels.cpp
index f20923f2..a4814759 100644
--- a/src/core/TempColModels.cpp
+++ b/src/core/TempColModels.cpp
@@ -66,7 +66,7 @@ CTempColModels::Initialise(void)
#else
for (i = 0; i < ARRAY_SIZE(s_aPedGSpheres); i++) {
#endif
- s_aPedSpheres[i].surface = SURFACE_FLESH;
+ s_aPedSpheres[i].surface = SURFACE_PED;
s_aPedSpheres[i].piece = 0;
}
@@ -85,7 +85,7 @@ CTempColModels::Initialise(void)
s_aPed2Spheres[2].center = CVector(0.0f, -0.35f, -0.9f);
for (i = 0; i < ARRAY_SIZE(s_aPed2Spheres); i++) {
- s_aPed2Spheres[i].surface = SURFACE_FLESH;
+ s_aPed2Spheres[i].surface = SURFACE_PED;
s_aPed2Spheres[i].piece = 0;
}
@@ -106,10 +106,10 @@ CTempColModels::Initialise(void)
s_aPedGSpheres[2].center = CVector(0.0f, 0.25f, -0.9f);
s_aPedGSpheres[3].center = CVector(0.0f, 0.65f, -0.9f);
- s_aPedGSpheres[0].surface = SURFACE_FLESH;
- s_aPedGSpheres[1].surface = SURFACE_FLESH;
- s_aPedGSpheres[2].surface = SURFACE_FLESH;
- s_aPedGSpheres[3].surface = SURFACE_FLESH;
+ s_aPedGSpheres[0].surface = SURFACE_PED;
+ s_aPedGSpheres[1].surface = SURFACE_PED;
+ s_aPedGSpheres[2].surface = SURFACE_PED;
+ s_aPedGSpheres[3].surface = SURFACE_PED;
s_aPedGSpheres[0].piece = 4;
s_aPedGSpheres[1].piece = 1;
s_aPedGSpheres[2].piece = 0;
@@ -131,7 +131,7 @@ CTempColModels::Initialise(void)
s_aDoorSpheres[2].center = CVector(0.0f, -0.6f, 0.25f);
for (i = 0; i < ARRAY_SIZE(s_aDoorSpheres); i++) {
- s_aDoorSpheres[i].surface = SURFACE_BILLBOARD;
+ s_aDoorSpheres[i].surface = SURFACE_CAR_PANEL;
s_aDoorSpheres[i].piece = 0;
}
@@ -151,7 +151,7 @@ CTempColModels::Initialise(void)
s_aBumperSpheres[3].center = CVector(-0.85f, -0.05f, 0.0f);
for (i = 0; i < ARRAY_SIZE(s_aBumperSpheres); i++) {
- s_aBumperSpheres[i].surface = SURFACE_BILLBOARD;
+ s_aBumperSpheres[i].surface = SURFACE_CAR_PANEL;
s_aBumperSpheres[i].piece = 0;
}
@@ -171,7 +171,7 @@ CTempColModels::Initialise(void)
s_aPanelSpheres[3].center = CVector(-0.15f, 0.45f, 0.0f);
for (i = 0; i < ARRAY_SIZE(s_aPanelSpheres); i++) {
- s_aPanelSpheres[i].surface = SURFACE_BILLBOARD;
+ s_aPanelSpheres[i].surface = SURFACE_CAR_PANEL;
s_aPanelSpheres[i].piece = 0;
}
@@ -191,7 +191,7 @@ CTempColModels::Initialise(void)
s_aBonnetSpheres[3].center = CVector(0.4f, 0.9f, 0.0f);
for (i = 0; i < ARRAY_SIZE(s_aBonnetSpheres); i++) {
- s_aBonnetSpheres[i].surface = SURFACE_BILLBOARD;
+ s_aBonnetSpheres[i].surface = SURFACE_CAR_PANEL;
s_aBonnetSpheres[i].piece = 0;
}
@@ -211,7 +211,7 @@ CTempColModels::Initialise(void)
s_aBootSpheres[3].center = CVector(0.4f, -0.6f, 0.0f);
for (i = 0; i < ARRAY_SIZE(s_aBootSpheres); i++) {
- s_aBootSpheres[i].surface = SURFACE_BILLBOARD;
+ s_aBootSpheres[i].surface = SURFACE_CAR_PANEL;
s_aBootSpheres[i].piece = 0;
}
@@ -233,7 +233,7 @@ CTempColModels::Initialise(void)
#else
for (i = 0; i < ARRAY_SIZE(s_aBootSpheres); i++) {
#endif
- s_aWheelSpheres[i].surface = SURFACE_RUBBER29;
+ s_aWheelSpheres[i].surface = SURFACE_WHEELBASE;
s_aWheelSpheres[i].piece = 0;
}
@@ -255,7 +255,7 @@ CTempColModels::Initialise(void)
#else
for (i = 0; i < ARRAY_SIZE(s_aBootSpheres); i++) {
#endif
- s_aBodyPartSpheres1[i].surface = SURFACE_FLESH;
+ s_aBodyPartSpheres1[i].surface = SURFACE_PED;
s_aBodyPartSpheres1[i].piece = 0;
}
@@ -277,7 +277,7 @@ CTempColModels::Initialise(void)
#else
for (i = 0; i < ARRAY_SIZE(s_aBootSpheres); i++) {
#endif
- s_aBodyPartSpheres2[i].surface = SURFACE_FLESH;
+ s_aBodyPartSpheres2[i].surface = SURFACE_PED;
s_aBodyPartSpheres2[i].piece = 0;
}
diff --git a/src/core/World.cpp b/src/core/World.cpp
index 433f9745..06108c5c 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -33,22 +33,24 @@
CColPoint gaTempSphereColPoints[MAX_COLLISION_POINTS];
-CPtrList CWorld::ms_bigBuildingsList[4];// = (CPtrList*)0x6FAB60;
-CPtrList CWorld::ms_listMovingEntityPtrs;// = *(CPtrList*)0x8F433C;
-CSector CWorld::ms_aSectors[NUMSECTORS_Y][NUMSECTORS_X];// = (CSector (*)[NUMSECTORS_Y])0x665608;
-uint16 CWorld::ms_nCurrentScanCode;// = *(uint16*)0x95CC64;
+CPtrList CWorld::ms_bigBuildingsList[4];
+CPtrList CWorld::ms_listMovingEntityPtrs;
+CSector CWorld::ms_aSectors[NUMSECTORS_Y][NUMSECTORS_X];
+uint16 CWorld::ms_nCurrentScanCode;
-uint8 CWorld::PlayerInFocus;// = *(uint8 *)0x95CD61;
+uint8 CWorld::PlayerInFocus;
CPlayerInfo CWorld::Players[NUMPLAYERS];
-bool CWorld::bNoMoreCollisionTorque;// = *(bool*)0x95CDCC;
-CEntity *CWorld::pIgnoreEntity;// = *(CEntity**)0x8F6494;
-bool CWorld::bIncludeDeadPeds;// = *(bool*)0x95CD8F;
-bool CWorld::bSecondShift;// = *(bool*)0x95CD54;
-bool CWorld::bForceProcessControl;// = *(bool*)0x95CD6C;
-bool CWorld::bProcessCutsceneOnly;// = *(bool*)0x95CD8B;
+bool CWorld::bNoMoreCollisionTorque;
+CEntity *CWorld::pIgnoreEntity;
+bool CWorld::bIncludeDeadPeds;
+bool CWorld::bSecondShift;
+bool CWorld::bForceProcessControl;
+bool CWorld::bProcessCutsceneOnly;
-bool CWorld::bDoingCarCollisions;// = *(bool*)0x95CD8C;
-bool CWorld::bIncludeCarTyres;// = *(bool*)0x95CDAA;
+bool CWorld::bDoingCarCollisions;
+bool CWorld::bIncludeCarTyres;
+
+CColPoint CWorld::m_aTempColPts[MAX_COLLISION_POINTS];
void
CWorld::Initialise()
@@ -165,7 +167,7 @@ CWorld::CameraToIgnoreThisObject(CEntity *ent)
bool
CWorld::ProcessLineOfSight(const CVector &point1, const CVector &point2, CColPoint &point, CEntity *&entity,
bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects,
- bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects)
+ bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects, bool ignoreShootThrough)
{
int x, xstart, xend;
int y, ystart, yend;
@@ -184,7 +186,7 @@ CWorld::ProcessLineOfSight(const CVector &point1, const CVector &point2, CColPoi
#define LOSARGS \
CColLine(point1, point2), point, dist, entity, checkBuildings, checkVehicles, checkPeds, checkObjects, \
- checkDummies, ignoreSeeThrough, ignoreSomeObjects
+ checkDummies, ignoreSeeThrough, ignoreSomeObjects, ignoreShootThrough
if(xstart == xend && ystart == yend) {
// Only one sector
@@ -266,7 +268,7 @@ CWorld::ProcessLineOfSight(const CVector &point1, const CVector &point2, CColPoi
bool
CWorld::ProcessLineOfSightSector(CSector &sector, const CColLine &line, CColPoint &point, float &dist, CEntity *&entity,
bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects,
- bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects)
+ bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects, bool ignoreShootThrough)
{
float mindist = dist;
bool deadPeds = !!bIncludeDeadPeds;
@@ -274,39 +276,39 @@ CWorld::ProcessLineOfSightSector(CSector &sector, const CColLine &line, CColPoin
if(checkBuildings) {
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_BUILDINGS], line, point, mindist, entity,
- ignoreSeeThrough);
+ ignoreSeeThrough, false, ignoreShootThrough);
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_BUILDINGS_OVERLAP], line, point, mindist, entity,
- ignoreSeeThrough);
+ ignoreSeeThrough, false, ignoreShootThrough);
}
if(checkVehicles) {
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_VEHICLES], line, point, mindist, entity,
- ignoreSeeThrough);
+ ignoreSeeThrough, false, ignoreShootThrough);
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_VEHICLES_OVERLAP], line, point, mindist, entity,
- ignoreSeeThrough);
+ ignoreSeeThrough, false, ignoreShootThrough);
}
if(checkPeds) {
if(deadPeds) bIncludeDeadPeds = true;
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_PEDS], line, point, mindist, entity,
- ignoreSeeThrough);
+ ignoreSeeThrough, false, ignoreShootThrough);
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_PEDS_OVERLAP], line, point, mindist, entity,
- ignoreSeeThrough);
+ ignoreSeeThrough, false, ignoreShootThrough);
bIncludeDeadPeds = false;
}
if(checkObjects) {
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_OBJECTS], line, point, mindist, entity,
- ignoreSeeThrough, ignoreSomeObjects);
+ ignoreSeeThrough, ignoreSomeObjects, ignoreShootThrough);
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_OBJECTS_OVERLAP], line, point, mindist, entity,
- ignoreSeeThrough, ignoreSomeObjects);
+ ignoreSeeThrough, ignoreSomeObjects, ignoreShootThrough);
}
if(checkDummies) {
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_DUMMIES], line, point, mindist, entity,
- ignoreSeeThrough);
+ ignoreSeeThrough, false, ignoreShootThrough);
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_DUMMIES_OVERLAP], line, point, mindist, entity,
- ignoreSeeThrough);
+ ignoreSeeThrough, false, ignoreShootThrough);
}
bIncludeDeadPeds = deadPeds;
@@ -320,7 +322,7 @@ CWorld::ProcessLineOfSightSector(CSector &sector, const CColLine &line, CColPoin
bool
CWorld::ProcessLineOfSightSectorList(CPtrList &list, const CColLine &line, CColPoint &point, float &dist,
- CEntity *&entity, bool ignoreSeeThrough, bool ignoreSomeObjects)
+ CEntity *&entity, bool ignoreSeeThrough, bool ignoreSomeObjects, bool ignoreShootThrough)
{
bool deadPeds = false;
float mindist = dist;
@@ -347,7 +349,7 @@ CWorld::ProcessLineOfSightSectorList(CPtrList &list, const CColLine &line, CColP
colmodel = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel();
if(colmodel && CCollision::ProcessLineOfSight(line, e->GetMatrix(), *colmodel, point, dist,
- ignoreSeeThrough))
+ ignoreSeeThrough, ignoreShootThrough))
entity = e;
}
}
@@ -436,7 +438,7 @@ CWorld::ProcessVerticalLineSectorList(CPtrList &list, const CColLine &line, CCol
colmodel = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel();
if(CCollision::ProcessVerticalLine(line, e->GetMatrix(), *colmodel, point, dist,
- ignoreSeeThrough, poly))
+ ignoreSeeThrough, false, poly))
entity = e;
}
}
@@ -637,7 +639,7 @@ CWorld::GetIsLineOfSightSectorListClear(CPtrList &list, const CColLine &line, bo
colmodel = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel();
- if(CCollision::TestLineOfSight(line, e->GetMatrix(), *colmodel, ignoreSeeThrough))
+ if(CCollision::TestLineOfSight(line, e->GetMatrix(), *colmodel, ignoreSeeThrough, false))
return false;
}
}
diff --git a/src/core/World.h b/src/core/World.h
index 89f05cfd..3da774ba 100644
--- a/src/core/World.h
+++ b/src/core/World.h
@@ -71,6 +71,7 @@ public:
static bool bProcessCutsceneOnly;
static bool bDoingCarCollisions;
static bool bIncludeCarTyres;
+ static CColPoint m_aTempColPts[MAX_COLLISION_POINTS];
static void Remove(CEntity *entity);
static void Add(CEntity *entity);
@@ -90,9 +91,9 @@ public:
static bool CameraToIgnoreThisObject(CEntity *ent);
- static bool ProcessLineOfSight(const CVector &point1, const CVector &point2, CColPoint &point, CEntity *&entity, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects = false);
- static bool ProcessLineOfSightSector(CSector &sector, const CColLine &line, CColPoint &point, float &dist, CEntity *&entity, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects = false);
- static bool ProcessLineOfSightSectorList(CPtrList &list, const CColLine &line, CColPoint &point, float &dist, CEntity *&entity, bool ignoreSeeThrough, bool ignoreSomeObjects = false);
+ static bool ProcessLineOfSight(const CVector &point1, const CVector &point2, CColPoint &point, CEntity *&entity, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects = false, bool ignoreShootThrough = false);
+ static bool ProcessLineOfSightSector(CSector &sector, const CColLine &line, CColPoint &point, float &dist, CEntity *&entity, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects, bool ignoreShootThrough);
+ static bool ProcessLineOfSightSectorList(CPtrList &list, const CColLine &line, CColPoint &point, float &dist, CEntity *&entity, bool ignoreSeeThrough, bool ignoreSomeObjects, bool ignoreShootThrough);
static bool ProcessVerticalLine(const CVector &point1, float z2, CColPoint &point, CEntity *&entity, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, CStoredCollPoly *poly);
static bool ProcessVerticalLineSector(CSector &sector, const CColLine &line, CColPoint &point, CEntity *&entity, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, CStoredCollPoly *poly);
static bool ProcessVerticalLineSectorList(CPtrList &list, const CColLine &line, CColPoint &point, float &dist, CEntity *&entity, bool ignoreSeeThrough, CStoredCollPoly *poly);
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index 8f808b61..a74e5ffa 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -273,7 +273,7 @@ DebugMenuPopulate(void)
{
if(1){
static const char *weathers[] = {
- "Sunny", "Cloudy", "Rainy", "Foggy"
+ "Sunny", "Cloudy", "Rainy", "Foggy", "Extrasunny", "Stormy"
};
DebugMenuEntry *e;
e = DebugMenuAddVar("Time & Weather", "Current Hour", &CClock::GetHoursRef(), nil, 1, 0, 23, nil);
@@ -281,9 +281,9 @@ DebugMenuPopulate(void)
e = DebugMenuAddVar("Time & Weather", "Current Minute", &CClock::GetMinutesRef(),
[](){ CWeather::InterpolationValue = CClock::GetMinutes()/60.0f; }, 1, 0, 59, nil);
DebugMenuEntrySetWrap(e, true);
- e = DebugMenuAddVar("Time & Weather", "Old Weather", (int16*)&CWeather::OldWeatherType, nil, 1, 0, 3, weathers);
+ e = DebugMenuAddVar("Time & Weather", "Old Weather", (int16*)&CWeather::OldWeatherType, nil, 1, 0, 5, weathers);
DebugMenuEntrySetWrap(e, true);
- e = DebugMenuAddVar("Time & Weather", "New Weather", (int16*)&CWeather::NewWeatherType, nil, 1, 0, 3, weathers);
+ e = DebugMenuAddVar("Time & Weather", "New Weather", (int16*)&CWeather::NewWeatherType, nil, 1, 0, 5, weathers);
DebugMenuEntrySetWrap(e, true);
DebugMenuAddVar("Time & Weather", "Wind", (float*)&CWeather::Wind, nil, 0.1f, 0.0f, 1.0f);
DebugMenuAddVar("Time & Weather", "Time scale", (float*)&CTimer::GetTimeScale(), nil, 0.1f, 0.0f, 10.0f);
@@ -337,7 +337,11 @@ DebugMenuPopulate(void)
DebugMenuAddCmd("Spawn", "Spawn Banshee", [](){ SpawnCar(MI_BANSHEE); });
DebugMenuAddCmd("Spawn", "Spawn Cuban", [](){ SpawnCar(MI_CUBAN); });
DebugMenuAddCmd("Spawn", "Spawn Voodoo", [](){ SpawnCar(MI_VOODOO); });
+ DebugMenuAddCmd("Spawn", "Spawn Maverick", [](){ SpawnCar(MI_MAVERICK); });
+ DebugMenuAddCmd("Spawn", "Spawn VCN Maverick", [](){ SpawnCar(MI_VCNMAV); });
DebugMenuAddCmd("Spawn", "Spawn Sparrow", [](){ SpawnCar(MI_SPARROW); });
+ DebugMenuAddCmd("Spawn", "Spawn Sea Sparrow", [](){ SpawnCar(MI_SEASPAR); });
+ DebugMenuAddCmd("Spawn", "Spawn Hunter", [](){ SpawnCar(MI_HUNTER); });
DebugMenuAddCmd("Spawn", "Spawn Rhino", [](){ SpawnCar(MI_RHINO); });
DebugMenuAddCmd("Spawn", "Spawn Firetruck", [](){ SpawnCar(MI_FIRETRUCK); });
DebugMenuAddCmd("Spawn", "Spawn Predator", [](){ SpawnCar(MI_PREDATOR); });