summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Cam.cpp44
-rw-r--r--src/core/Camera.cpp65
-rw-r--r--src/core/Camera.h10
-rw-r--r--src/core/ColStore.cpp2
-rw-r--r--src/core/Collision.cpp37
-rw-r--r--src/core/Collision.h6
-rw-r--r--src/core/ControllerConfig.cpp34
-rw-r--r--src/core/ControllerConfig.h2
-rw-r--r--src/core/EventList.h6
-rw-r--r--src/core/FileLoader.cpp51
-rw-r--r--src/core/FileLoader.h1
-rw-r--r--src/core/Frontend.cpp1985
-rw-r--r--src/core/Frontend.h378
-rw-r--r--src/core/Game.cpp37
-rw-r--r--src/core/Game.h2
-rw-r--r--src/core/MenuScreens.h11
-rw-r--r--src/core/Pad.cpp104
-rw-r--r--src/core/Pad.h2
-rw-r--r--src/core/Placeable.cpp2
-rw-r--r--src/core/Placeable.h1
-rw-r--r--src/core/PlayerInfo.cpp11
-rw-r--r--src/core/PlayerInfo.h8
-rw-r--r--src/core/Radar.cpp283
-rw-r--r--src/core/Radar.h146
-rw-r--r--src/core/Stats.cpp19
-rw-r--r--src/core/Stats.h25
-rw-r--r--src/core/Streaming.cpp34
-rw-r--r--src/core/SurfaceTable.cpp135
-rw-r--r--src/core/SurfaceTable.h101
-rw-r--r--src/core/TempColModels.cpp28
-rw-r--r--src/core/Timer.h2
-rw-r--r--src/core/World.cpp155
-rw-r--r--src/core/World.h9
-rw-r--r--src/core/Zones.cpp13
-rw-r--r--src/core/config.h15
-rw-r--r--src/core/main.cpp187
-rw-r--r--src/core/re3.cpp29
37 files changed, 1980 insertions, 2000 deletions
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index afa153f9..d04e8683 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -29,7 +29,7 @@ bool PrintDebugCode = false;
int16 DebugCamMode;
#ifdef FREE_CAM
-bool CCamera::bFreeCam = true;
+bool CCamera::bFreeCam;
int nPreviousMode = -1;
#endif
@@ -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);
@@ -1596,7 +1596,7 @@ CCam::Process_FollowPedWithMouse(const CVector &CameraTarget, float TargetOrient
CWorld::pIgnoreEntity = nil;
float ViewPlaneHeight = Tan(DEGTORAD(FOV) / 2.0f);
- float ViewPlaneWidth = ViewPlaneHeight * CDraw::FindAspectRatio() * fTweakFOV;
+ float ViewPlaneWidth = ViewPlaneHeight * CDraw::CalculateAspectRatio() * fTweakFOV;
float Near = RwCameraGetNearClipPlane(Scene.camera);
float radius = ViewPlaneWidth*Near;
entity = CWorld::TestSphereAgainstWorld(Source + Front*Near, radius, nil, true, true, false, true, false, 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;
@@ -2429,7 +2429,7 @@ CCam::Process_Rocket(const CVector &CameraTarget, float, float, float)
ResetStatics = false;
}
- ((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(&HeadPos, PED_HEAD);
+ ((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(HeadPos, PED_HEAD);
Source = HeadPos;
Source.z += 0.1f;
Source.x -= 0.19f*Cos(m_fInitialPlayerOrientation);
@@ -2568,7 +2568,7 @@ CCam::Process_M16_1stPerson(const CVector &CameraTarget, float, float, float)
HeadPos.x = 0.0f;
HeadPos.y = 0.0f;
HeadPos.z = 0.0f;
- ((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(&HeadPos, PED_HEAD);
+ ((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(HeadPos, PED_HEAD);
Source = HeadPos;
Source.z += 0.1f;
Source.x -= 0.19f * Cos(m_fInitialPlayerOrientation);
@@ -2657,7 +2657,7 @@ CCam::Process_1stPerson(const CVector &CameraTarget, float TargetOrientation, fl
ResetStatics = false;
}
- ((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(&HeadPos, PED_HEAD);
+ ((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(HeadPos, PED_HEAD);
Source = HeadPos;
Source.z += 0.1f;
Source.x -= 0.19f*Cos(m_fInitialPlayerOrientation);
@@ -2925,7 +2925,7 @@ CCam::Process_Sniper(const CVector &CameraTarget, float TargetOrientation, float
ResetStatics = false;
}
- ((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(&HeadPos, PED_HEAD);
+ ((CPed*)CamTargetEntity)->m_pedIK.GetComponentPosition(HeadPos, PED_HEAD);
Source = HeadPos;
Source.z += 0.1f;
Source.x -= 0.19f*Cos(m_fInitialPlayerOrientation);
@@ -3630,7 +3630,7 @@ CCam::Process_Fixed(const CVector &CameraTarget, float, float, float)
if(TheCamera.m_bUseSpecialFovTrain)
FOV = TheCamera.m_fFovForTrain;
- if(CMenuManager::m_ControlMethod == 0 && Using3rdPersonMouseCam()){
+ if(FrontEndMenuManager.m_ControlMethod == 0 && Using3rdPersonMouseCam()){
CPed *player = FindPlayerPed();
if(player && player->CanStrafeOrMouseControl()){
float Heading = Front.Heading();
@@ -4574,7 +4574,7 @@ CCam::Process_FollowPed_Rotation(const CVector &CameraTarget, float TargetOrient
CWorld::pIgnoreEntity = nil;
float ViewPlaneHeight = Tan(DEGTORAD(FOV) / 2.0f);
- float ViewPlaneWidth = ViewPlaneHeight * CDraw::FindAspectRatio() * fTweakFOV;
+ float ViewPlaneWidth = ViewPlaneHeight * CDraw::CalculateAspectRatio() * fTweakFOV;
float Near = RwCameraGetNearClipPlane(Scene.camera);
float radius = ViewPlaneWidth*Near;
entity = CWorld::TestSphereAgainstWorld(Source + Front*Near, radius, nil, true, true, false, true, false, false);
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index 623b2ea9..b65b60f3 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -61,6 +61,8 @@ enum
CCamera TheCamera;
bool CCamera::m_bUseMouse3rdPerson = true;
bool bDidWeProcessAnyCinemaCam;
+float CCamera::m_f3rdPersonCHairMultX;
+float CCamera::m_f3rdPersonCHairMultY;
#ifdef IMPROVED_CAMERA
#define KEYJUSTDOWN(k) ControlsManager.GetIsKeyboardKeyJustDown((RsKeyCodes)k)
@@ -80,10 +82,6 @@ CCamera::CCamera(void)
Init();
}
-CCamera::CCamera(float)
-{
-}
-
void
CCamera::Init(void)
{
@@ -91,12 +89,7 @@ CCamera::Init(void)
float fMouseAccelHorzntl = m_fMouseAccelHorzntl;
float fMouseAccelVertical = m_fMouseAccelVertical;
#endif
-#ifdef FIX_BUGS
- static const CCamera DummyCamera = CCamera(0.f);
- *this = DummyCamera;
-#else
- memset(this, 0, sizeof(CCamera)); // getting rid of vtable, eh?
-#endif
+ memset(this, 0, sizeof(CCamera)); // this is fine, no vtable
#ifdef GTA3_1_1_PATCH
m_fMouseAccelHorzntl = fMouseAccelHorzntl;
m_fMouseAccelVertical = fMouseAccelVertical;
@@ -3044,33 +3037,25 @@ CCamera::SetNearClipScript(float clip)
void
CCamera::ProcessFade(void)
{
- float fade = (CTimer::GetTimeInMilliseconds() - m_uiFadeTimeStarted)/1000.0f;
- // Why even set CDraw::FadeValue if m_fFLOATingFade sets it anyway?
if(m_bFading){
if(m_iFadingDirection == FADE_IN){
if(m_fTimeToFadeOut != 0.0f){
- m_fFLOATingFade = 255.0f - 255.0f*fade/m_fTimeToFadeOut;
- if(m_fFLOATingFade <= 0.0f){
- m_bFading = false;
- CDraw::FadeValue = 0;
- m_fFLOATingFade = 0.0f;
- }
+ m_fFLOATingFade -= CTimer::GetTimeStepInSeconds() * 255.0f / m_fTimeToFadeOut;
}else{
+ m_fFLOATingFade = 0.0f;
+ }
+ if (m_fFLOATingFade <= 0.0f) {
m_bFading = false;
- CDraw::FadeValue = 0;
m_fFLOATingFade = 0.0f;
}
}else if(m_iFadingDirection == FADE_OUT){
if(m_fTimeToFadeOut != 0.0f){
- m_fFLOATingFade = 255.0f*fade/m_fTimeToFadeOut;
- if(m_fFLOATingFade >= 255.0f){
- m_bFading = false;
- CDraw::FadeValue = 255;
- m_fFLOATingFade = 255.0f;
- }
+ m_fFLOATingFade += CTimer::GetTimeStepInSeconds() * 255.0f / m_fTimeToFadeOut;
}else{
+ m_fFLOATingFade = 255.0f;
+ }
+ if (m_fFLOATingFade >= 255.0f) {
m_bFading = false;
- CDraw::FadeValue = 255;
m_fFLOATingFade = 255.0f;
}
}
@@ -3132,15 +3117,6 @@ CCamera::Fade(float timeout, int16 direction)
m_iMusicFadingDirection = direction;
m_fTimeToFadeMusic = timeout;
m_uiFadeTimeStartedMusic = CTimer::GetTimeInMilliseconds();
-// Not on PS2
- if(!m_bJustJumpedOutOf1stPersonBecauseOfTarget && m_iMusicFadingDirection == FADE_OUT){
- unknown++;
- if(unknown >= 2){
- m_bJustJumpedOutOf1stPersonBecauseOfTarget = true;
- unknown = 0;
- }else
- m_bMoveCamToAvoidGeom = true;
- }
}
}
@@ -3217,7 +3193,7 @@ CCamera::GetLookDirection(void)
Cams[ActiveCam].Mode == CCam::MODE_BEHINDBOAT ||
Cams[ActiveCam].Mode == CCam::MODE_FOLLOWPED)
return Cams[ActiveCam].DirectionWasLooking;
- return LOOKING_FORWARD;;
+ return LOOKING_FORWARD;
}
bool
@@ -3305,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
@@ -3329,8 +3317,9 @@ CCamera::CalculateDerivedValues(void)
// left plane
m_vecFrustumNormals[1] = CVector(-c, -s, 0.0f);
- c /= CDraw::FindAspectRatio();
- s /= CDraw::FindAspectRatio();
+ CDraw::CalculateAspectRatio();
+ c /= SCREEN_ASPECT_RATIO;
+ s /= SCREEN_ASPECT_RATIO;
// bottom plane
m_vecFrustumNormals[2] = CVector(0.0f, -s, -c);
// top plane
diff --git a/src/core/Camera.h b/src/core/Camera.h
index 80fc878e..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
@@ -472,8 +474,8 @@ public:
// not static yet
float m_fMouseAccelHorzntl;// acceleration multiplier for 1st person controls
float m_fMouseAccelVertical;// acceleration multiplier for 1st person controls
- float m_f3rdPersonCHairMultX;
- float m_f3rdPersonCHairMultY;
+ static float m_f3rdPersonCHairMultX;
+ static float m_f3rdPersonCHairMultY;
CCam Cams[3];
@@ -549,7 +551,6 @@ public:
// High level and misc
CCamera(void);
- CCamera(float);
void Init(void);
void Process(void);
void CamControl(void);
@@ -626,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/ColStore.cpp b/src/core/ColStore.cpp
index 80bbdc77..070967e5 100644
--- a/src/core/ColStore.cpp
+++ b/src/core/ColStore.cpp
@@ -178,7 +178,7 @@ CColStore::LoadCollision(const CVector2D &pos)
}else{
for (int j = 0; j < MAX_CLEANUP; j++) {
CPhysical* pEntity = CTheScripts::MissionCleanup.DoesThisEntityWaitForCollision(j);
- if (pEntity /* !pEntity->bDontLoadCollision && !pEntity->bIsFrozen */) {
+ if (pEntity && !pEntity->bDontLoadCollision && !pEntity->bIsFrozen) {
if (GetBoundingBox(i).IsPointInside(pEntity->GetPosition(), -80.0f))
wantThisOne = true;
}
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/ControllerConfig.cpp b/src/core/ControllerConfig.cpp
index 6a5080e5..e48f2c3f 100644
--- a/src/core/ControllerConfig.cpp
+++ b/src/core/ControllerConfig.cpp
@@ -205,6 +205,8 @@ void CControllerConfigManager::InitDefaultControlConfiguration()
SetControllerKeyAssociatedWithAction (PED_LOOKBEHIND, rsPADEND, KEYBOARD);
SetControllerKeyAssociatedWithAction (PED_LOOKBEHIND, rsCAPSLK, OPTIONAL_EXTRA);
+
+ SetControllerKeyAssociatedWithAction (PED_DUCK, 'C', KEYBOARD);
SetControllerKeyAssociatedWithAction (PED_FIREWEAPON, rsPADINS, KEYBOARD);
SetControllerKeyAssociatedWithAction (PED_FIREWEAPON, rsLCTRL, OPTIONAL_EXTRA);
@@ -217,6 +219,8 @@ void CControllerConfigManager::InitDefaultControlConfiguration()
SetControllerKeyAssociatedWithAction (PED_JUMPING, rsRCTRL, KEYBOARD);
SetControllerKeyAssociatedWithAction (PED_JUMPING, ' ', OPTIONAL_EXTRA);
+
+ SetControllerKeyAssociatedWithAction (PED_ANSWER_PHONE, rsTAB, KEYBOARD);
if ( _dwOperatingSystemVersion == OS_WIN98 )
SetControllerKeyAssociatedWithAction(PED_SPRINT, rsSHIFT, OPTIONAL_EXTRA); // BUG: must be KEYBOARD ?
@@ -259,7 +263,7 @@ void CControllerConfigManager::InitDefaultControlConfiguration()
SetControllerKeyAssociatedWithAction (VEHICLE_TURRETDOWN, rsPADRIGHT, KEYBOARD);
SetControllerKeyAssociatedWithAction (CAMERA_CHANGE_VIEW_ALL_SITUATIONS, rsHOME, KEYBOARD);
- SetControllerKeyAssociatedWithAction (CAMERA_CHANGE_VIEW_ALL_SITUATIONS, 'C', OPTIONAL_EXTRA);
+ SetControllerKeyAssociatedWithAction (CAMERA_CHANGE_VIEW_ALL_SITUATIONS, 'V', OPTIONAL_EXTRA);
for (int32 i = 0; i < MAX_SIMS; i++)
{
@@ -336,13 +340,14 @@ void CControllerConfigManager::InitDefaultControlConfigJoyPad(uint32 buttons)
SetControllerKeyAssociatedWithAction(TOGGLE_SUBMISSIONS, 11, JOYSTICK);
case 10:
SetControllerKeyAssociatedWithAction(VEHICLE_HORN, 10, JOYSTICK);
+ SetControllerKeyAssociatedWithAction(PED_DUCK, 10, JOYSTICK);
case 9:
SetControllerKeyAssociatedWithAction(CAMERA_CHANGE_VIEW_ALL_SITUATIONS, 9, JOYSTICK);
case 8:
SetControllerKeyAssociatedWithAction(VEHICLE_HANDBRAKE, 8, JOYSTICK);
SetControllerKeyAssociatedWithAction(PED_LOCK_TARGET, 8, JOYSTICK);
case 7:
- SetControllerKeyAssociatedWithAction(PED_CENTER_CAMERA_BEHIND_PLAYER, 7, JOYSTICK);
+ SetControllerKeyAssociatedWithAction(PED_ANSWER_PHONE, 7, JOYSTICK);
SetControllerKeyAssociatedWithAction(VEHICLE_CHANGE_RADIO_STATION, 7, JOYSTICK);
case 6:
SetControllerKeyAssociatedWithAction(PED_CYCLE_WEAPON_RIGHT, 6, JOYSTICK);
@@ -384,13 +389,14 @@ void CControllerConfigManager::InitDefaultControlConfigJoyPad(uint32 buttons)
SetControllerKeyAssociatedWithAction(TOGGLE_SUBMISSIONS, 11, JOYSTICK);
case 10:
SetControllerKeyAssociatedWithAction(VEHICLE_HORN, 10, JOYSTICK);
+ SetControllerKeyAssociatedWithAction(PED_DUCK, 10, JOYSTICK);
case 9:
SetControllerKeyAssociatedWithAction(CAMERA_CHANGE_VIEW_ALL_SITUATIONS, 9, JOYSTICK);
case 8:
SetControllerKeyAssociatedWithAction(VEHICLE_HANDBRAKE, 8, JOYSTICK);
SetControllerKeyAssociatedWithAction(PED_LOCK_TARGET, 8, JOYSTICK);
case 7:
- SetControllerKeyAssociatedWithAction(PED_CENTER_CAMERA_BEHIND_PLAYER, 7, JOYSTICK);
+ SetControllerKeyAssociatedWithAction(PED_ANSWER_PHONE, 7, JOYSTICK);
SetControllerKeyAssociatedWithAction(VEHICLE_CHANGE_RADIO_STATION, 7, JOYSTICK);
case 6:
SetControllerKeyAssociatedWithAction(PED_CYCLE_WEAPON_RIGHT, 6, JOYSTICK);
@@ -431,6 +437,8 @@ void CControllerConfigManager::InitialiseControllerActionNameArray()
SETACTIONNAME(PED_CYCLE_TARGET_LEFT);
SETACTIONNAME(PED_CYCLE_TARGET_RIGHT);
SETACTIONNAME(PED_CENTER_CAMERA_BEHIND_PLAYER);
+ SETACTIONNAME(PED_DUCK);
+ SETACTIONNAME(PED_ANSWER_PHONE);
SETACTIONNAME(VEHICLE_LOOKBEHIND);
SETACTIONNAME(VEHICLE_LOOKLEFT);
SETACTIONNAME(VEHICLE_LOOKRIGHT);
@@ -754,6 +762,8 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonDown_FirstPersonOnl
state.Square = 255;
if (button == GetControllerKeyAssociatedWithAction(PED_SNIPER_ZOOM_OUT, type))
state.Cross = 255;
+ if (button == GetControllerKeyAssociatedWithAction(PED_DUCK, type))
+ state.RightShock = 255;
}
void CControllerConfigManager::AffectControllerStateOn_ButtonDown_ThirdPersonOnly(int32 button, eControllerType type, CControllerState &state)
@@ -762,14 +772,18 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonDown_ThirdPersonOnl
state.RightShock = 255;
if (button == GetControllerKeyAssociatedWithAction(PED_JUMPING, type))
state.Square = 255;
+ if (button == GetControllerKeyAssociatedWithAction(PED_ANSWER_PHONE, type))
+ state.LeftShoulder1 = 255;
if (button == GetControllerKeyAssociatedWithAction(PED_CYCLE_WEAPON_LEFT, type))
state.LeftShoulder2 = 255;
if (button == GetControllerKeyAssociatedWithAction(PED_CYCLE_WEAPON_RIGHT, type))
state.RightShoulder2 = 255;
if (button == GetControllerKeyAssociatedWithAction(PED_SPRINT, type))
state.Cross = 255;
+ if (button == GetControllerKeyAssociatedWithAction(PED_DUCK, type))
+ state.RightShock = 255;
- if (CMenuManager::m_ControlMethod == CONTROL_CLASSIC)
+ if (FrontEndMenuManager.m_ControlMethod == CONTROL_CLASSIC)
{
if (button == GetControllerKeyAssociatedWithAction(PED_CYCLE_TARGET_LEFT, type))
state.LeftShoulder2 = 255;
@@ -835,7 +849,7 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonDown_FirstAndThirdP
state.RightStickX = 128;
}
- if (CMenuManager::m_ControlMethod == CONTROL_CLASSIC)
+ if (FrontEndMenuManager.m_ControlMethod == CONTROL_CLASSIC)
{
if (button == GetControllerKeyAssociatedWithAction(PED_1RST_PERSON_LOOK_UP, type))
{
@@ -1616,8 +1630,12 @@ void CControllerConfigManager::DeleteMatching3rdPersonControls(e_ControllerActio
ClearSettingsAssociatedWithAction(PED_JUMPING, type);
if (key == GetControllerKeyAssociatedWithAction(PED_SPRINT, type))
ClearSettingsAssociatedWithAction(PED_SPRINT, type);
+ if (key == GetControllerKeyAssociatedWithAction(PED_DUCK, type))
+ ClearSettingsAssociatedWithAction(PED_DUCK, type);
+ if (key == GetControllerKeyAssociatedWithAction(PED_ANSWER_PHONE, type))
+ ClearSettingsAssociatedWithAction(PED_ANSWER_PHONE, type);
- if (CMenuManager::m_ControlMethod == CONTROL_CLASSIC)
+ if (FrontEndMenuManager.m_ControlMethod == CONTROL_CLASSIC)
{
if (key == GetControllerKeyAssociatedWithAction(PED_CYCLE_TARGET_LEFT, type))
ClearSettingsAssociatedWithAction(PED_CYCLE_TARGET_LEFT, type);
@@ -1640,7 +1658,7 @@ void CControllerConfigManager::DeleteMatching1rst3rdPersonControls(e_ControllerA
if (key == GetControllerKeyAssociatedWithAction(GO_BACK, type))
ClearSettingsAssociatedWithAction(GO_BACK, type);
- if (CMenuManager::m_ControlMethod == CONTROL_CLASSIC)
+ if (FrontEndMenuManager.m_ControlMethod == CONTROL_CLASSIC)
{
if (key == GetControllerKeyAssociatedWithAction(PED_1RST_PERSON_LOOK_LEFT, type))
ClearSettingsAssociatedWithAction(PED_1RST_PERSON_LOOK_LEFT, type);
@@ -1803,6 +1821,8 @@ e_ControllerActionType CControllerConfigManager::GetActionType(e_ControllerActio
case PED_CYCLE_WEAPON_RIGHT:
case PED_JUMPING:
case PED_SPRINT:
+ case PED_DUCK:
+ case PED_ANSWER_PHONE:
case PED_CYCLE_TARGET_LEFT:
case PED_CYCLE_TARGET_RIGHT:
case PED_CENTER_CAMERA_BEHIND_PLAYER:
diff --git a/src/core/ControllerConfig.h b/src/core/ControllerConfig.h
index 7d0e1073..5f0b6862 100644
--- a/src/core/ControllerConfig.h
+++ b/src/core/ControllerConfig.h
@@ -32,6 +32,8 @@ enum e_ControllerAction
PED_JUMPING,
PED_SPRINT,
PED_LOOKBEHIND,
+ PED_DUCK,
+ PED_ANSWER_PHONE,
VEHICLE_ACCELERATE,
VEHICLE_BRAKE,
VEHICLE_CHANGE_RADIO_STATION,
diff --git a/src/core/EventList.h b/src/core/EventList.h
index 8840afc4..f2c3d7a8 100644
--- a/src/core/EventList.h
+++ b/src/core/EventList.h
@@ -22,10 +22,12 @@ enum eEventType
EVENT_PED_SET_ON_FIRE,
EVENT_COP_SET_ON_FIRE,
EVENT_CAR_SET_ON_FIRE,
- EVENT_ASSAULT_NASTYWEAPON, // not sure
+ EVENT_ASSAULT_NASTYWEAPON,
+ EVENT_ASSAULT_NASTYWEAPON_POLICE,
EVENT_ICECREAM,
EVENT_ATM,
- EVENT_SHOPSTALL, // used on graffitis
+ EVENT_SHOPSTALL,
+ EVENT_SHOPWINDOW,
EVENT_LAST_EVENT
};
diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp
index e073b4cb..1463b4a5 100644
--- a/src/core/FileLoader.cpp
+++ b/src/core/FileLoader.cpp
@@ -1,4 +1,5 @@
#include "common.h"
+#include <ctype.h>
#include "main.h"
#include "Quaternion.h"
@@ -26,6 +27,9 @@
#include "FileLoader.h"
#include "Streaming.h"
#include "ColStore.h"
+#include "Occlusion.h"
+
+//--MIAMI: file done
char CFileLoader::ms_line[256];
@@ -159,7 +163,6 @@ struct ColHeader
uint32 size;
};
-//--MIAMI: done
void
CFileLoader::LoadCollisionFile(const char *filename, uint8 colSlot)
{
@@ -196,7 +199,6 @@ CFileLoader::LoadCollisionFile(const char *filename, uint8 colSlot)
}
-//--MIAMI: done
bool
CFileLoader::LoadCollisionFileFirstTime(uint8 *buffer, uint32 size, uint8 colSlot)
{
@@ -298,13 +300,15 @@ CFileLoader::LoadCollisionModel(uint8 *buf, CColModel &model, char *modelname)
model.numLines = *(int16*)buf;
buf += 4;
if(model.numLines > 0){
- model.lines = (CColLine*)RwMalloc(model.numLines*sizeof(CColLine));
+ //model.lines = (CColLine*)RwMalloc(model.numLines*sizeof(CColLine));
for(i = 0; i < model.numLines; i++){
- model.lines[i].Set(*(CVector*)buf, *(CVector*)(buf+12));
+ //model.lines[i].Set(*(CVector*)buf, *(CVector*)(buf+12));
buf += 24;
}
}else
model.lines = nil;
+ model.numLines = 0;
+ model.lines = nil;
model.numBoxes = *(int16*)buf;
buf += 4;
@@ -323,10 +327,12 @@ CFileLoader::LoadCollisionModel(uint8 *buf, CColModel &model, char *modelname)
model.vertices = (CVector*)RwMalloc(numVertices*sizeof(CVector));
for(i = 0; i < numVertices; i++){
model.vertices[i] = *(CVector*)buf;
+#if 0
if(Abs(model.vertices[i].x) >= 256.0f ||
Abs(model.vertices[i].y) >= 256.0f ||
Abs(model.vertices[i].z) >= 256.0f)
printf("%s:Collision volume too big\n", modelname);
+#endif
buf += 12;
}
}else
@@ -349,7 +355,7 @@ GetNameAndLOD(char *nodename, char *name, int *n)
{
char *underscore = nil;
for(char *s = nodename; *s != '\0'; s++){
- if(s[0] == '_' && (s[1] == 'l' || s[1] == 'L'))
+ if(s[0] == '_' && (s[1] == 'l' || s[1] == 'L') && isdigit(s[2]))
underscore = s;
}
if(underscore){
@@ -956,7 +962,7 @@ CFileLoader::LoadCarPathNode(const char *line, int id, int node, bool waterPath)
void
CFileLoader::Load2dEffect(const char *line)
{
- int id, r, g, b, a, type;
+ int id, r, g, b, a, type, ptype;
float x, y, z;
char corona[32], shadow[32];
int shadowIntens, lightType, roadReflection, flare, flags, probability;
@@ -1029,6 +1035,18 @@ CFileLoader::Load2dEffect(const char *line)
effect->attractor.flags = flags;
effect->attractor.probability = probability;
break;
+ case EFFECT_PED_ATTRACTOR:
+ sscanf(line, "%d %f %f %f %d %d %d %d %d %d %f %f %f %f %f %f",
+ &id, &x, &y, &z, &r, &g, &b, &a, &type,
+ &ptype,
+ &effect->pedattr.queueDir.x,
+ &effect->pedattr.queueDir.y,
+ &effect->pedattr.queueDir.z,
+ &effect->pedattr.useDir.x,
+ &effect->pedattr.useDir.y,
+ &effect->pedattr.useDir.z);
+ effect->pedattr.type = ptype;
+ break;
}
CTxdStore::PopCurrentTxd();
@@ -1081,7 +1099,7 @@ CFileLoader::LoadScene(const char *filename)
LoadCullZone(line);
break;
case OCCL:
- // TODO(MIAMI): occlusion
+ LoadOcclusionVolume(line);
break;
case PICK:
// unused
@@ -1175,7 +1193,9 @@ CFileLoader::LoadObjectInstance(const char *line)
CColStore::GetBoundingBox(col->level).ContainRect(entity->GetBoundRect());
}else
entity->bUsesCollision = false;
- // TODO(MIAMI): set some flag here if col min is below 6
+
+ if(entity->GetPosition().z + col->boundingBox.min.z < 6.0f)
+ entity->bUnderwater = true;
}else{
entity = new CDummyObject;
entity->SetModelIndexNoCreate(id);
@@ -1229,6 +1249,21 @@ CFileLoader::LoadPickup(const char *line)
sscanf(line, "%d %f %f %f", &id, &x, &y, &z);
}
+void
+CFileLoader::LoadOcclusionVolume(const char *line)
+{
+ float x, y, z;
+ float width, length, height;
+ float angle;
+
+ sscanf(line, "%f %f %f %f %f %f %f",
+ &x, &y, &z,
+ &width, &length, &height,
+ &angle);
+ COcclusion::AddOne(x, y, z, width, length, z + height/2.0f, angle);
+}
+
+
//--MIAMI: unused
void
CFileLoader::ReloadPaths(const char *filename)
diff --git a/src/core/FileLoader.h b/src/core/FileLoader.h
index 584a2312..077e7bdd 100644
--- a/src/core/FileLoader.h
+++ b/src/core/FileLoader.h
@@ -39,6 +39,7 @@ public:
static void LoadZone(const char *line);
static void LoadCullZone(const char *line);
static void LoadPickup(const char *line);
+ static void LoadOcclusionVolume(const char *line);
static void ReloadPaths(const char *filename);
static void ReloadObjectTypes(const char *filename);
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index d27a98ec..60a17aee 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -37,6 +37,22 @@
#include "Messages.h"
#include "FileLoader.h"
+// TODO(Miami): This is -3 on VC but still -1 on AudioManager?!? What the hell?
+#define INVALID_AUDIO_PROVIDER -1
+
+// Similar story to Hud.cpp:
+// Game has colors inlined in code.
+// For easier modification we collect them here:
+CRGBA LABEL_COLOR(255, 150, 225, 255);
+CRGBA SELECTIONBORDER_COLOR(25, 130, 70, 255);
+CRGBA MENUOPTION_COLOR(255, 150, 225, 255);
+CRGBA SELECTEDMENUOPTION_COLOR(255, 150, 225, 255);
+CRGBA HEADER_COLOR(255, 150, 255, 255);
+CRGBA DARKMENUOPTION_COLOR(195, 90, 165, 255);
+CRGBA SLIDERON_COLOR(97, 194, 247, 255);
+CRGBA SLIDEROFF_COLOR(27, 89, 130, 255);
+CRGBA MAPINFOBOX_COLOR(255, 150, 225, 150);
+
#define TIDY_UP_PBP // ProcessButtonPresses
#define MAX_VISIBLE_LIST_ROW 30
#define SCROLLBAR_MAX_HEIGHT 263.0f // not in end result
@@ -66,14 +82,6 @@
#define GetBackJustDown GetSquareJustDown
#endif
-#ifdef MENU_MAP
-bool CMenuManager::bMenuMapActive = false;
-bool CMenuManager::bMapMouseShownOnce = false;
-bool CMenuManager::bMapLoaded = false;
-float CMenuManager::fMapSize;
-float CMenuManager::fMapCenterY;
-float CMenuManager::fMapCenterX;
-#endif
#ifdef PS2_LIKE_MENU
BottomBarOption bbNames[8];
@@ -86,35 +94,8 @@ int curBottomBarOption = -1;
int hoveredBottomBarOption = -1;
#endif
-int32 CMenuManager::OS_Language = LANG_ENGLISH;
-int8 CMenuManager::m_PrefsUseVibration;
-int8 CMenuManager::m_DisplayControllerOnFoot;
-int8 CMenuManager::m_PrefsVsync = 1;
-int8 CMenuManager::m_PrefsVsyncDisp = 1;
-int8 CMenuManager::m_PrefsFrameLimiter = 1;
-int8 CMenuManager::m_PrefsShowSubtitles = 1;
-int8 CMenuManager::m_PrefsSpeakers;
-int32 CMenuManager::m_ControlMethod;
-int8 CMenuManager::m_PrefsDMA = 1;
-int32 CMenuManager::m_PrefsLanguage;
uint8 CMenuManager::m_PrefsStereoMono; // unused except restore settings
-bool CMenuManager::m_PrefsAllowNastyGame = true;
-bool CMenuManager::m_bStartUpFrontEndRequested;
-bool CMenuManager::m_bShutDownFrontEndRequested;
-
-int8 CMenuManager::m_PrefsUseWideScreen;
-int8 CMenuManager::m_PrefsRadioStation;
-int32 CMenuManager::m_PrefsBrightness = 256;
-float CMenuManager::m_PrefsLOD = CRenderer::ms_lodDistScale;
-int8 CMenuManager::m_bFrontEnd_ReloadObrTxtGxt;
-int32 CMenuManager::m_PrefsMusicVolume = 102;
-int32 CMenuManager::m_PrefsSfxVolume = 102;
-
-char CMenuManager::m_PrefsSkinFile[256] = DEFAULT_SKIN_NAME;
-
-int32 CMenuManager::m_KeyPressedCode = -1;
-
// Originally that was PS2 option color, they forget it here and used in PrintBriefs once(but didn't use the output anyway)
#ifdef PS2_LIKE_MENU
const CRGBA TEXT_COLOR = CRGBA(150, 110, 30, 255);
@@ -125,99 +106,53 @@ const CRGBA TEXT_COLOR = CRGBA(235, 170, 50, 255); // PC briefs text color
float MENU_TEXT_SIZE_X = SMALLTEXT_X_SCALE;
float MENU_TEXT_SIZE_Y = SMALLTEXT_Y_SCALE;
-bool holdingScrollBar; // *(bool*)0x628D59; // not original name
-int32 CMenuManager::m_SelectedMap;
-int32 CMenuManager::m_SelectedGameType;
-
-// Used in a hidden menu
-uint8 CMenuManager::m_PrefsPlayerRed = 255;
-uint8 CMenuManager::m_PrefsPlayerGreen = 128;
-uint8 CMenuManager::m_PrefsPlayerBlue; // why??
+bool holdingScrollBar; // *(bool*)0x7039B9; // not original name
CMenuManager FrontEndMenuManager;
+MenuTrapezoid menuBg(CGeneral::GetRandomNumber() % 40 + 65, CGeneral::GetRandomNumber() % 40 + 21,
+ CGeneral::GetRandomNumber() % 40 + 568, CGeneral::GetRandomNumber() % 40 + 44,
+ CGeneral::GetRandomNumber() % 40 + 36, CGeneral::GetRandomNumber() % 40 + 352,
+ CGeneral::GetRandomNumber() % 40 + 593, CGeneral::GetRandomNumber() % 40 + 312);
-uint32 TimeToStopPadShaking;
-char *pEditString;
-int32 *pControlEdit;
-bool DisplayComboButtonErrMsg;
-int32 MouseButtonJustClicked;
-int32 JoyButtonJustClicked;
-//int32 *pControlTemp = 0;
+MenuTrapezoid menuOptionHighlight(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
+
+// TODO(Miami): TEMPORARY
+bool bMapLoaded = false;
+bool bMapMouseShownOnce = false;
#ifndef MASTER
bool CMenuManager::m_PrefsMarketing = false;
bool CMenuManager::m_PrefsDisableTutorials = false;
#endif // !MASTER
-// 0x5F311C
+// 0x68C144
const char* FrontendFilenames[][2] = {
- {"fe2_mainpanel_ul", "" },
- {"fe2_mainpanel_ur", "" },
- {"fe2_mainpanel_dl", "" },
- {"fe2_mainpanel_dr", "" },
- {"fe2_mainpanel_dr2", "" },
- {"fe2_tabactive", "" },
- {"fe_iconbrief", "" },
- {"fe_iconstats", "" },
- {"fe_iconcontrols", "" },
- {"fe_iconsave", "" },
- {"fe_iconaudio", "" },
- {"fe_icondisplay", "" },
- {"fe_iconlanguage", "" },
- {"fe_controller", "" },
- {"fe_controllersh", "" },
- {"fe_arrows1", "" },
- {"fe_arrows2", "" },
- {"fe_arrows3", "" },
- {"fe_arrows4", "" },
- {"fe_radio1", "" },
- {"fe_radio2", "" },
- {"fe_radio3", "" },
- {"fe_radio4", "" },
- {"fe_radio5", "" },
- {"fe_radio6", "" },
- {"fe_radio7", "" },
- {"fe_radio8", "" },
- {"fe_radio9", "" },
-};
-
-#ifdef MENU_MAP
-const char* MapFilenames[][2] = {
+ {"background", ""},
+ {"vc_logo", "vc_logom"},
+ {"mouse", "mousea"},
+ {"mapTop01", "mapTop01A"},
+ {"mapTop02", "mapTop02A"},
+ {"mapTop03", "mapTop03A"},
{"mapMid01", "mapMid01A"},
{"mapMid02", "mapMid02A"},
{"mapMid03", "mapMid03A"},
{"mapBot01", "mapBot01A"},
{"mapBot02", "mapBot02A"},
{"mapBot03", "mapBot03A"},
- {"mapTop01", "mapTop01A"},
- {"mapTop02", "mapTop02A"},
- {"mapTop03", "mapTop03A"},
-};
-CSprite2d CMenuManager::m_aMapSprites[NUM_MAP_SPRITES];
-#endif
-
-// 0x5F3344
-const char* MenuFilenames[][2] = {
- {"connection24", ""},
- {"findgame24", ""},
- {"hostgame24", ""},
- {"mainmenu24", ""},
- {"Playersetup24", ""},
- {"singleplayer24", ""},
- {"multiplayer24", ""},
- {"dmalogo128", "dmalogo128m"},
- {"gtaLogo128", "gtaLogo128"},
- {"rockstarLogo128", "rockstarlogo128m"},
- {"gamespy256", "gamespy256a"},
- {"mouse", "mousetimera"},
- {"mousetimer", "mousetimera"},
- {"mp3logo", "mp3logoA"},
- {"downOFF", "buttonA"},
- {"downON", "buttonA"},
+ {"wildstyle", "wildstyleA"},
+ {"flash", "flashA"},
+ {"kchat", "kchatA"},
+ {"fever", "feverA"},
+ {"vrock", "vrockA"},
+ {"vcpr", "vcprA"},
+ {"espantoso", "espantosoA"},
+ {"emotion", "emotionA"},
+ {"wave103", "wave103A"},
+ {"mp3", "mp3A"},
+ {"downOff", "buttonA"},
+ {"downOn", "buttonA"},
{"upOff", "buttonA"},
- {"upON", "buttonA"},
- {"gta3logo256", "gta3logo256m"},
- { nil, nil }
+ {"upOn", "buttonA"}
};
#ifdef ASPECT_RATIO_SCALE
@@ -246,45 +181,8 @@ ScaleAndCenterX(float x)
#define MENU_Y(y) StretchY(y)
#endif
-#ifdef PS2_LIKE_MENU
-#define ChangeScreen(screen, option, updateDelay, withReverseAlpha) \
- do { \
- if (reverseAlpha) { \
- m_nPrevScreen = m_nCurrScreen; \
- m_nCurrScreen = pendingScreen; \
- m_nCurrOption = pendingOption; \
- reverseAlpha = false; \
- if (updateDelay) \
- m_nScreenChangeDelayTimer = CTimer::GetTimeInMillisecondsPauseMode(); \
- } \
- if (withReverseAlpha) { \
- pendingOption = option; \
- pendingScreen = screen; \
- reverseAlpha = true; \
- } else { \
- m_nPrevScreen = m_nCurrScreen; \
- m_nCurrScreen = screen; \
- m_nCurrOption = option; \
- if (updateDelay) \
- m_nScreenChangeDelayTimer = CTimer::GetTimeInMillisecondsPauseMode(); \
- } \
- m_nMenuFadeAlpha = 255; \
- } while(0)
-#else
-#define ChangeScreen(screen, option, updateDelay, clearAlpha) \
- do { \
- m_nPrevScreen = m_nCurrScreen; \
- m_nCurrScreen = screen; \
- m_nCurrOption = option; \
- if(updateDelay) \
- m_nScreenChangeDelayTimer = CTimer::GetTimeInMillisecondsPauseMode(); \
- if(clearAlpha) \
- m_nMenuFadeAlpha = 0; \
- } while(0)
-#endif
-
#define PREPARE_MENU_HEADER \
- CFont::SetColor(CRGBA(0, 0, 0, FadeIn(255))); \
+ CFont::SetColor(CRGBA(HEADER_COLOR.r, HEADER_COLOR.g, HEADER_COLOR.b, FadeIn(255))); \
CFont::SetRightJustifyOn(); \
CFont::SetScale(MENU_X(MENUHEADER_WIDTH), MENU_Y(MENUHEADER_HEIGHT)); \
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
@@ -306,15 +204,86 @@ ScaleAndCenterX(float x)
m_nHoverOption = HOVEROPTION_NOT_HOVERING; \
} while(0)
+// TODO: this is COMPLETELY different in VC
#define ProcessRadioIcon(sprite, x, y, radioId, hoverOpt) \
do { \
- sprite.Draw(x, y, MENU_X(MENURADIO_ICON_SCALE), MENU_Y(MENURADIO_ICON_SCALE), radioId == m_PrefsRadioStation ? CRGBA(255, 255, 255, 255) : CRGBA(225, 0, 0, 170)); \
+ sprite.Draw(x, y, MENU_X(MENURADIO_ICON_SCALE), MENU_Y(MENURADIO_ICON_SCALE), radioId == m_PrefsRadioStation ? CRGBA(255, 255, 255, 255) : CRGBA(255, 255, 255, 100)); \
if (CheckHover(x, x + MENU_X(MENURADIO_ICON_SCALE), y, y + MENU_Y(MENURADIO_ICON_SCALE))) \
m_nHoverOption = hoverOpt; \
} while (0)
// --- Functions not in the game/inlined starts
+bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha);
+void DoRWStuffEndOfFrame(void);
+
+#ifdef PS2_LIKE_MENU
+void
+CMenuManager::SwitchToNewScreen(int8 screen)
+{
+ if (reverseAlpha) {
+ m_nPrevScreen = m_nCurrScreen;
+ m_nCurrScreen = pendingScreen;
+ m_nCurrOption = pendingOption;
+ reverseAlpha = false;
+ if (updateDelay)
+ m_LastScreenSwitch = CTimer::GetTimeInMillisecondsPauseMode();
+ }
+ if (withReverseAlpha) {
+ pendingOption = option;
+ pendingScreen = screen;
+ reverseAlpha = true;
+ } else {
+ m_nPrevScreen = m_nCurrScreen;
+ m_nCurrScreen = screen;
+ m_nCurrOption = option;
+ if (updateDelay)
+ m_LastScreenSwitch = CTimer::GetTimeInMillisecondsPauseMode();
+ }
+ m_nMenuFadeAlpha = 255;
+}
+#else
+
+// --MIAMI: Done except using VC's gMenuPages
+void
+CMenuManager::SwitchToNewScreen(int8 screen)
+{
+ bMenuChangeOngoing = true;
+ DoRWStuffStartOfFrame(0, 0, 0, 0, 0, 0, 255);
+ DrawBackground(true);
+ DoRWStuffEndOfFrame();
+ DoRWStuffStartOfFrame(0, 0, 0, 0, 0, 0, 255);
+ DrawBackground(true);
+ DoRWStuffEndOfFrame();
+ m_nPrevScreen = m_nCurrScreen;
+ m_ShowEmptyBindingError = false;
+ ResetHelperText();
+
+ ThingsToDoBeforeLeavingPage();
+
+ if (screen == -2) {
+ int oldScreen = !m_bGameNotLoaded ? aScreens[m_nCurrScreen].m_PreviousPage[1] : aScreens[m_nCurrScreen].m_PreviousPage[0];
+ int oldOption = !m_bGameNotLoaded ? aScreens[m_nCurrScreen].m_ParentEntry[1] :
+ (m_nCurrScreen == MENUPAGE_NEW_GAME ? 0 : (m_nCurrScreen == MENUPAGE_OPTIONS ? 1 : (m_nCurrScreen == MENUPAGE_EXIT ? 2 : aScreens[m_nCurrScreen].m_ParentEntry[0])));
+
+ m_nCurrOption = oldOption;
+ m_nCurrScreen = oldScreen;
+ } else if (screen == 0) {
+ m_nCurrScreen = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu;
+ m_nCurrOption = 0;
+ } else {
+ m_nCurrOption = 0;
+ m_nCurrScreen = screen;
+ }
+
+ if (m_nCurrScreen == MENUPAGE_CHOOSE_SAVE_SLOT)
+ m_nCurrOption = 8;
+ m_nMenuFadeAlpha = 0;
+ bOptionHighlightTransitionBlend = 0;
+ m_LastScreenSwitch = CTimer::GetTimeInMilliseconds();
+}
+#endif
+
inline void
CMenuManager::ScrollUpListByOne()
{
@@ -381,13 +350,14 @@ CMenuManager::PageDownList(bool playSoundOnSuccess)
}
}
+// TODO(Miami)
inline void
CMenuManager::ThingsToDoBeforeLeavingPage()
{
if ((m_nCurrScreen == MENUPAGE_SKIN_SELECT) && strcmp(m_aSkinName, m_PrefsSkinFile) != 0) {
CWorld::Players[0].SetPlayerSkin(m_PrefsSkinFile);
} else if (m_nCurrScreen == MENUPAGE_SOUND_SETTINGS) {
- if (m_nPrefsAudio3DProviderIndex != -1)
+ if (m_nPrefsAudio3DProviderIndex != INVALID_AUDIO_PROVIDER)
m_nPrefsAudio3DProviderIndex = DMAudio.GetCurrent3DProviderIndex();
#ifdef TIDY_UP_PBP
DMAudio.StopFrontEndTrack();
@@ -411,6 +381,122 @@ CMenuManager::ThingsToDoBeforeLeavingPage()
// ------ Functions not in the game/inlined ends
+CMenuManager::CMenuManager()
+{
+ m_StatsScrollSpeed = 150.0f;
+ m_StatsScrollDirection = 1;
+ m_PrefsSfxVolume = 49;
+ m_PrefsMusicVolume = 49;
+ m_PrefsRadioStation = 0;
+ field_2C = 1;
+ m_PrefsBrightness = 256;
+ m_PrefsLOD = 1.2f;
+ m_KeyPressedCode = -1;
+ m_bFrontEnd_ReloadObrTxtGxt = false;
+ m_PrefsMP3BoostVolume = 0;
+ m_PrefsShowSubtitles = 0;
+ m_PrefsShowLegends = 1;
+ m_PrefsUseWideScreen = 0;
+ m_PrefsVsync = 0;
+ m_PrefsVsyncDisp = 1;
+ m_PrefsFrameLimiter = 1;
+ m_PrefsLanguage = 0;
+ field_54 = 0;
+ m_PrefsAllowNastyGame = 1;
+ m_PrefsSpeakers = 0;
+ field_8 = 0;
+ m_PrefsUseVibration = 0;
+ m_PrefsShowHud = 1;
+ m_PrefsRadarMode = 0;
+ field_10 = 0;
+ m_bShutDownFrontEndRequested = false;
+ m_bStartUpFrontEndRequested = false;
+ pEditString = nil;
+ pControlEdit = nil;
+ DisplayComboButtonErrMsg = false;
+ m_PrefsDMA = 1;
+ OS_Language = LANG_ENGLISH;
+ m_ControlMethod = CONTROL_STANDARD;
+ CCamera::m_bUseMouse3rdPerson = true;
+ m_lastWorking3DAudioProvider = 0;
+ m_nFirstVisibleRowOnList = 0;
+ m_nScrollbarTopMargin = 0.0f;
+ m_nSelectedListRow = 0;
+ m_nSkinsTotal = 0;
+ m_nPrefsAudio3DProviderIndex = -99;
+ m_bGameNotLoaded = true;
+ m_nMousePosX = m_nMouseTempPosX;
+ m_nMousePosY = m_nMouseTempPosY;
+ m_nMouseOldPosX = m_nMousePosX;
+ m_nMouseOldPosY = m_nMousePosY;
+ m_bShowMouse = true;
+ m_nHoverOption = HOVEROPTION_NOT_HOVERING;
+
+ // TODO(Miami)
+ // DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume);
+ m_bMenuActive = false;
+ m_bActivateSaveMenu = false;
+ m_bWantToLoad = false;
+ m_nMenuFadeAlpha = 0;
+ m_OnlySaveMenu = false;
+ m_fMapSize = 162.0f;
+ m_fMapCenterX = 320.0f;
+ m_fMapCenterY = 225.0f;
+ DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume);
+ DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume);
+}
+
+void
+CMenuManager::SetFrontEndRenderStates(void)
+{
+ RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR);
+ RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, (void*)rwTEXTUREADDRESSCLAMP);
+ RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE);
+ RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
+ RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
+ RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
+ RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
+}
+
+void
+CMenuManager::Initialise(void)
+{
+ DoRWStuffStartOfFrame(0, 0, 0, 0, 0, 0, 255);
+ DoRWStuffEndOfFrame();
+ m_AllowNavigation = false;
+ m_menuTransitionProgress = -50;
+ m_nMenuFadeAlpha = 0;
+ m_nCurrOption = 0;
+ bOptionHighlightTransitionBlend = 0;
+ CentreMousePointer();
+ m_bShowMouse = true;
+ m_fMapSize = 162.0f;
+ m_fMapCenterX = 320.0f;
+ m_fMapCenterY = 225.0f;
+ CPad::StopPadsShaking();
+ if (!m_OnlySaveMenu)
+ m_nCurrScreen = MENUPAGE_NONE;
+ DMAudio.ChangeMusicMode(MUSICMODE_FRONTEND);
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_STARTING, 0);
+ DMAudio.Service();
+ DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume);
+ DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume);
+ m_PrefsRadioStation = DMAudio.GetRadioInCar();
+
+ // TODO(Miami)
+ // DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume);
+ if (DMAudio.IsMP3RadioChannelAvailable()) {
+ if (m_PrefsRadioStation < HEAD_RADIO || m_PrefsRadioStation > USERTRACK)
+ m_PrefsRadioStation = CGeneral::GetRandomNumber() % 10;
+ } else if (m_PrefsRadioStation < HEAD_RADIO || m_PrefsRadioStation > CHATTERBOX)
+ m_PrefsRadioStation = CGeneral::GetRandomNumber() % 9;
+
+ CFileMgr::SetDir("");
+ //CFileMgr::SetDir("");
+ PcSaveHelper.PopulateSlotInfo();
+ CTimer::StartUserPause();
+}
+
void
CMenuManager::BuildStatLine(Const char *text, void *stat, bool itsFloat, void *stat2)
{
@@ -651,15 +737,15 @@ CMenuManager::DisplaySlider(float x, float y, float mostLeftBarSize, float mostR
int lastActiveBarX = 0;
float curBarX = 0.0f;
- float spacing = SCREEN_SCALE_X(10.0f);
+ float spacing = SCREEN_SCALE_X(4.0f); // TODO: find actual numbers used in the game
for (int i = 0; i < 16; i++) {
- curBarX = i * rectSize/16.0f + x;
+ curBarX = i * rectSize/32.0f + x;
if (i / 16.0f + 1 / 32.0f < progress) {
- color = CRGBA(255, 217, 106, FadeIn(255));
+ color = CRGBA(SLIDERON_COLOR.r, SLIDERON_COLOR.g, SLIDERON_COLOR.b, FadeIn(255));
lastActiveBarX = curBarX;
} else
- color = CRGBA(185, 120, 0, FadeIn(255));
+ color = CRGBA(SLIDEROFF_COLOR.r, SLIDEROFF_COLOR.g, SLIDEROFF_COLOR.b, FadeIn(255));
maxBarHeight = Max(mostLeftBarSize, mostRightBarSize);
@@ -684,33 +770,22 @@ CMenuManager::DoSettingsBeforeStartingAGame()
DMAudio.Service();
m_bWantToRestart = true;
-
- ShutdownJustMenu();
- UnloadTextures();
+ m_bShutDownFrontEndRequested = true;
DMAudio.SetEffectsFadeVol(0);
DMAudio.SetMusicFadeVol(0);
+ SwitchMenuOnAndOff();
DMAudio.ResetTimers(CTimer::GetTimeInMilliseconds());
}
void
-CMenuManager::Draw()
+CMenuManager::DrawStandardMenus()
{
CFont::SetBackgroundOff();
CFont::SetPropOn();
CFont::SetCentreOff();
CFont::SetJustifyOn();
CFont::SetBackGroundOnlyTextOn();
-#ifdef GTA3_1_1_PATCH
- CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255)));
- CFont::SetRightJustifyOn();
- CFont::SetFontStyle(FONT_HEADING);
- CFont::SetScale(MENU_X(0.7f), MENU_Y(0.5f));
- CFont::SetWrapx(SCREEN_WIDTH);
- CFont::SetRightJustifyWrap(0.0f);
- strcpy(gString, "V1.1");
- AsciiToUnicode(gString, gUString);
- CFont::PrintString(SCREEN_WIDTH / 10, SCREEN_HEIGHT / 45, gUString);
-#endif
+
CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_X_MARGIN));
CFont::SetRightJustifyWrap(SCREEN_SCALE_X(MENUACTION_WIDTH));
@@ -721,24 +796,20 @@ CMenuManager::Draw()
case MENUPAGE_BRIEFS:
PrintBriefs();
break;
-#ifdef MENU_MAP
- case MENUPAGE_MAP:
- PrintMap();
- break;
-#endif
}
// Header height isn't accounted, we will add that later.
float nextYToUse = 40.0f;
// Page name
-#ifdef PS2_SAVE_DIALOG
- if(!m_bRenderGameInMenu)
-#endif
if (aScreens[m_nCurrScreen].m_ScreenName[0] != '\0') {
-
+
+ PREPARE_MENU_HEADER
+ CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255)));
+ CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X + 7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
+
PREPARE_MENU_HEADER
- CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
+ CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
// Weird place to put that.
nextYToUse += 24.0f + 10.0f;
@@ -747,7 +818,7 @@ CMenuManager::Draw()
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
CFont::SetScale(MENU_X(MENUACTION_SCALE_MULT * MENU_TEXT_SIZE_X), MENU_Y(MENUACTION_SCALE_MULT * MENU_TEXT_SIZE_Y));
CFont::SetRightJustifyOff();
- CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255)));
+ CFont::SetColor(CRGBA(LABEL_COLOR.r, LABEL_COLOR.g, LABEL_COLOR.b, FadeIn(255)));
// Label
wchar *str;
@@ -845,7 +916,7 @@ CMenuManager::Draw()
break;
case MENUPAGE_START_MENU:
columnWidth = 320;
- headerHeight = 140;
+ headerHeight = 110;
lineHeight = 24;
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = BIGTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = BIGTEXT_Y_SCALE));
@@ -859,15 +930,6 @@ CMenuManager::Draw()
CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = BIGTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = BIGTEXT_Y_SCALE));
CFont::SetCentreOn();
break;
-#ifdef PS2_SAVE_DIALOG
- case MENUPAGE_SAVE:
- columnWidth = 180;
- headerHeight = 60;
- lineHeight = 24;
- CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
- CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = BIGTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = BIGTEXT_Y_SCALE));
- break;
-#endif
default:
columnWidth = 320;
headerHeight = 40;
@@ -898,7 +960,7 @@ CMenuManager::Draw()
}
float usableLineHeight = lineHeight * 0.9f; // also height of biggest bar in slider
- float smallestSliderBar = lineHeight * 0.1f;
+ float smallestSliderBar = lineHeight * 0.25f; // TODO: find actual number
bool foundTheHoveringItem = false;
wchar unicodeTemp[64];
char asciiTemp[32];
@@ -943,73 +1005,8 @@ CMenuManager::Draw()
}
switch (aScreens[m_nCurrScreen].m_aEntries[i].m_Action) {
- case MENUACTION_CHANGEMENU: {
- switch (aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu) {
- case MENUPAGE_MULTIPLAYER_MAP:
- switch (m_SelectedMap) {
- case 0:
- rightText = TheText.Get("FEM_MA0");
- break;
- case 1:
- rightText = TheText.Get("FEM_MA1");
- break;
- case 2:
- rightText = TheText.Get("FEM_MA2");
- break;
- case 3:
- rightText = TheText.Get("FEM_MA3");
- break;
- case 4:
- rightText = TheText.Get("FEM_MA4");
- break;
- case 5:
- rightText = TheText.Get("FEM_MA5");
- break;
- case 6:
- rightText = TheText.Get("FEM_MA6");
- break;
- case 7:
- rightText = TheText.Get("FEM_MA7");
- break;
- default:
- break;
- }
- break;
- case MENUPAGE_MULTIPLAYER_MODE:
- switch (m_SelectedGameType) {
- case 0:
- rightText = TheText.Get("FEN_TY0");
- break;
- case 1:
- rightText = TheText.Get("FEN_TY1");
- break;
- case 2:
- rightText = TheText.Get("FEN_TY2");
- break;
- case 3:
- rightText = TheText.Get("FEN_TY3");
- break;
- case 4:
- rightText = TheText.Get("FEN_TY4");
- break;
- case 5:
- rightText = TheText.Get("FEN_TY5");
- break;
- case 6:
- rightText = TheText.Get("FEN_TY6");
- break;
- case 7:
- rightText = TheText.Get("FEN_TY7");
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
+ case MENUACTION_CHANGEMENU:
break;
- }
case MENUACTION_CTRLVIBRATION:
if (m_PrefsUseVibration)
rightText = TheText.Get("FEM_ON");
@@ -1032,12 +1029,6 @@ CMenuManager::Draw()
break;
}
break;
- case MENUACTION_CTRLDISPLAY:
- if (m_DisplayControllerOnFoot)
- rightText = TheText.Get("FEC_ONF");
- else
- rightText = TheText.Get("FEC_INC");
- break;
case MENUACTION_FRAMESYNC:
rightText = TheText.Get(m_PrefsVsyncDisp ? "FEM_ON" : "FEM_OFF");
break;
@@ -1117,7 +1108,7 @@ CMenuManager::Draw()
break;
#endif
case MENUACTION_AUDIOHW:
- if (m_nPrefsAudio3DProviderIndex == -1)
+ if (m_nPrefsAudio3DProviderIndex == INVALID_AUDIO_PROVIDER)
rightText = TheText.Get("FEA_NAH");
else {
char *provider = DMAudio.Get3DProviderName(m_nPrefsAudio3DProviderIndex);
@@ -1132,7 +1123,7 @@ CMenuManager::Draw()
}
break;
case MENUACTION_SPEAKERCONF: {
- if (m_nPrefsAudio3DProviderIndex == -1)
+ if (m_nPrefsAudio3DProviderIndex == INVALID_AUDIO_PROVIDER)
rightText = TheText.Get("FEA_NAH");
else {
switch (m_PrefsSpeakers) {
@@ -1219,14 +1210,11 @@ CMenuManager::Draw()
}
// Green bar behind selected option
-#ifdef PS2_SAVE_DIALOG
- if (!m_bRenderGameInMenu)
-#endif
if (i == m_nCurrOption && itemsAreSelectable) {
// We keep stretching, because we also stretch background image and we want that bar to be aligned with borders of background
CSprite2d::DrawRect(CRect(StretchX(10.0f), MENU_Y(bitAboveNextItemY),
SCREEN_STRETCH_FROM_RIGHT(11.0f), MENU_Y(usableLineHeight + nextItemY)),
- CRGBA(100, 200, 50, FadeIn(50)));
+ CRGBA(SELECTIONBORDER_COLOR.r, SELECTIONBORDER_COLOR.g, SELECTIONBORDER_COLOR.b, FadeIn(255)));
}
CFont::SetColor(CRGBA(0, 0, 0, FadeIn(90)));
@@ -1245,14 +1233,14 @@ CMenuManager::Draw()
if(!strcmp(aScreens[m_nCurrScreen].m_aEntries[i].m_EntryName, "FED_RES")
&& !m_bGameNotLoaded && textLayer == 1) {
- CFont::SetColor(CRGBA(155, 117, 6, FadeIn(255)));
+ CFont::SetColor(CRGBA(DARKMENUOPTION_COLOR.r, DARKMENUOPTION_COLOR.g, DARKMENUOPTION_COLOR.b, FadeIn(255)));
}
CFont::PrintString(MENU_X_RIGHT_ALIGNED(columnWidth - textLayer), itemY, rightText);
}
if (i == m_nCurrOption && itemsAreSelectable){
- CFont::SetColor(CRGBA(255, 217, 106, FadeIn(255)));
+ CFont::SetColor(CRGBA(MENUOPTION_COLOR.r, MENUOPTION_COLOR.g, MENUOPTION_COLOR.b, FadeIn(255)));
} else {
- CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255)));
+ CFont::SetColor(CRGBA(SELECTEDMENUOPTION_COLOR.r, SELECTEDMENUOPTION_COLOR.g, SELECTEDMENUOPTION_COLOR.b, FadeIn(255)));
}
}
@@ -1274,7 +1262,7 @@ CMenuManager::Draw()
}
if (m_nPrefsAudio3DProviderIndex != DMAudio.GetCurrent3DProviderIndex()) {
if (strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEA_3DH") != 0
- && m_nCurrScreen == MENUPAGE_SOUND_SETTINGS && m_nPrefsAudio3DProviderIndex != -1) {
+ && m_nCurrScreen == MENUPAGE_SOUND_SETTINGS && m_nPrefsAudio3DProviderIndex != INVALID_AUDIO_PROVIDER) {
m_nPrefsAudio3DProviderIndex = DMAudio.GetCurrent3DProviderIndex();
SetHelperText(3);
@@ -1321,18 +1309,18 @@ CMenuManager::Draw()
// Radio icons
if (aScreens[m_nCurrScreen].m_aEntries[i].m_Action == MENUACTION_RADIO) {
- ProcessRadioIcon(m_aFrontEndSprites[FE_RADIO1], MENU_X_LEFT_ALIGNED(30.0f), MENU_Y(nextYToUse), 0, HOVEROPTION_RADIO_0);
- ProcessRadioIcon(m_aFrontEndSprites[FE_RADIO2], MENU_X_LEFT_ALIGNED(90.0f), MENU_Y(nextYToUse), 1, HOVEROPTION_RADIO_1);
- ProcessRadioIcon(m_aFrontEndSprites[FE_RADIO5], MENU_X_LEFT_ALIGNED(150.0f), MENU_Y(nextYToUse), 2, HOVEROPTION_RADIO_2);
- ProcessRadioIcon(m_aFrontEndSprites[FE_RADIO7], MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(nextYToUse), 3, HOVEROPTION_RADIO_3);
- ProcessRadioIcon(m_aFrontEndSprites[FE_RADIO8], MENU_X_LEFT_ALIGNED(270.0f), MENU_Y(nextYToUse), 4, HOVEROPTION_RADIO_4);
- ProcessRadioIcon(m_aFrontEndSprites[FE_RADIO3], MENU_X_LEFT_ALIGNED(320.0f), MENU_Y(nextYToUse), 5, HOVEROPTION_RADIO_5);
- ProcessRadioIcon(m_aFrontEndSprites[FE_RADIO4], MENU_X_LEFT_ALIGNED(360.0f), MENU_Y(nextYToUse), 6, HOVEROPTION_RADIO_6);
- ProcessRadioIcon(m_aFrontEndSprites[FE_RADIO6], MENU_X_LEFT_ALIGNED(420.0f), MENU_Y(nextYToUse), 7, HOVEROPTION_RADIO_7);
- ProcessRadioIcon(m_aFrontEndSprites[FE_RADIO9], MENU_X_LEFT_ALIGNED(480.0f), MENU_Y(nextYToUse), 8, HOVEROPTION_RADIO_8);
+ ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_WILDSTYLE], MENU_X_LEFT_ALIGNED(30.0f), MENU_Y(nextYToUse), 0, HOVEROPTION_RADIO_0);
+ ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_FLASH], MENU_X_LEFT_ALIGNED(90.0f), MENU_Y(nextYToUse), 1, HOVEROPTION_RADIO_1);
+ ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_KCHAT], MENU_X_LEFT_ALIGNED(150.0f), MENU_Y(nextYToUse), 2, HOVEROPTION_RADIO_2);
+ ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_FEVER], MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(nextYToUse), 3, HOVEROPTION_RADIO_3);
+ ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_VROCK], MENU_X_LEFT_ALIGNED(270.0f), MENU_Y(nextYToUse), 4, HOVEROPTION_RADIO_4);
+ ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_VCPR], MENU_X_LEFT_ALIGNED(320.0f), MENU_Y(nextYToUse), 5, HOVEROPTION_RADIO_5);
+ ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_ESPANTOSO], MENU_X_LEFT_ALIGNED(360.0f), MENU_Y(nextYToUse), 6, HOVEROPTION_RADIO_6);
+ ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_EMOTION], MENU_X_LEFT_ALIGNED(420.0f), MENU_Y(nextYToUse), 7, HOVEROPTION_RADIO_7);
+ ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_WAVE], MENU_X_LEFT_ALIGNED(480.0f), MENU_Y(nextYToUse), 8, HOVEROPTION_RADIO_8);
if (DMAudio.IsMP3RadioChannelAvailable())
- ProcessRadioIcon(m_aMenuSprites[MENUSPRITE_MP3LOGO], MENU_X_LEFT_ALIGNED(540.0f), MENU_Y(nextYToUse), 9, HOVEROPTION_RADIO_9);
+ ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_MP3], MENU_X_LEFT_ALIGNED(540.0f), MENU_Y(nextYToUse), 9, HOVEROPTION_RADIO_9);
nextYToUse += 70.0f;
}
@@ -1349,14 +1337,6 @@ CMenuManager::Draw()
DisplayHelperText();
break;
}
-
- if (m_nCurrScreen == MENUPAGE_CONTROLLER_SETTINGS)
- PrintController();
- else if (m_nCurrScreen == MENUPAGE_SKIN_SELECT_OLD) {
- CSprite2d::DrawRect(CRect(MENU_X_LEFT_ALIGNED(180), MENU_Y(98), MENU_X_LEFT_ALIGNED(230), MENU_Y(123)), CRGBA(255, 255, 255, FadeIn(255)));
- CSprite2d::DrawRect(CRect(MENU_X_LEFT_ALIGNED(181), MENU_Y(99), MENU_X_LEFT_ALIGNED(229), MENU_Y(122)), CRGBA(m_PrefsPlayerRed, m_PrefsPlayerGreen, m_PrefsPlayerBlue, FadeIn(255)));
- }
-
}
int
@@ -1813,11 +1793,21 @@ CMenuManager::DrawControllerSetupScreen()
switch (m_ControlMethod) {
case CONTROL_STANDARD:
- CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y),
+ CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255)));
+ CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X + 7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f),
+ TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
+
+ PREPARE_MENU_HEADER
+ CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y),
TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
break;
case CONTROL_CLASSIC:
- CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y),
+ CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255)));
+ CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X + 7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f),
+ TheText.Get("FET_CTI"));
+
+ PREPARE_MENU_HEADER
+ CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y),
TheText.Get("FET_CTI"));
break;
default:
@@ -1994,6 +1984,10 @@ void
CMenuManager::DrawFrontEnd()
{
CFont::SetAlphaFade(255.0f);
+ CSprite2d::InitPerFrame();
+ CFont::InitPerFrame();
+ SetFrontEndRenderStates();
+ m_NoEmptyBinding = true;
#ifdef PS2_LIKE_MENU
if (m_nCurrScreen == MENUPAGE_NONE) {
@@ -2037,63 +2031,15 @@ CMenuManager::DrawFrontEnd()
if (m_nCurrOption == 0 && aScreens[m_nCurrScreen].m_aEntries[0].m_Action == MENUACTION_LABEL)
m_nCurrOption = 1;
-#ifdef PS2_SAVE_DIALOG
- if(m_bRenderGameInMenu)
- DrawFrontEndSaveZone();
- else
-#endif
- DrawFrontEndNormal();
-
- PrintErrorMessage();
-}
-
-#ifdef PS2_SAVE_DIALOG
-void
-CMenuManager::DrawFrontEndSaveZone()
-{
- CSprite2d::InitPerFrame();
- CFont::InitPerFrame();
- RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERNEAREST);
-
- // Not original dimensions, have been changed to fit PC screen & PC menu layout.
- CSprite2d::DrawRect(CRect(MENU_X_LEFT_ALIGNED(30.0f), MENU_Y(50.0f), MENU_X_RIGHT_ALIGNED(30.0f), SCREEN_SCALE_FROM_BOTTOM(50.0f)), CRGBA(0, 0, 0, 175));
-
- m_nMenuFadeAlpha = 255;
- RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, (void*)rwTEXTUREADDRESSCLAMP);
- RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
- Draw();
-
- CFont::DrawFonts();
-
- // Draw mouse
- RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR);
- RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, (void*)rwTEXTUREADDRESSCLAMP);
- if (m_bShowMouse) {
- RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
- RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
- RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
-
- CRect mouse(0.0f, 0.0f, MENU_X(75.0f), MENU_Y(75.0f));
- CRect shad(MENU_X(10.0f), MENU_Y(3.0f), MENU_X(85.0f), MENU_Y(78.0f));
+ if (m_menuTransitionProgress == 255 && m_nMenuFadeAlpha == 255)
+ bMenuChangeOngoing = false;
- mouse.Translate(m_nMousePosX, m_nMousePosY);
- shad.Translate(m_nMousePosX, m_nMousePosY);
- if(field_518 == 4){
- m_aMenuSprites[MENUSPRITE_MOUSET].Draw(shad, CRGBA(100, 100, 100, 50));
- RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
- m_aMenuSprites[MENUSPRITE_MOUSET].Draw(mouse, CRGBA(255, 255, 255, 255));
- }else{
- m_aMenuSprites[MENUSPRITE_MOUSE].Draw(shad, CRGBA(100, 100, 100, 50));
- RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
- m_aMenuSprites[MENUSPRITE_MOUSE].Draw(mouse, CRGBA(255, 255, 255, 255));
- }
- }
+ DrawBackground(false);
}
-#endif
#ifdef PS2_LIKE_MENU
void
-CMenuManager::DrawFrontEndNormal()
+CMenuManager::DrawBackground()
{
CSprite2d::InitPerFrame();
CFont::InitPerFrame();
@@ -2210,7 +2156,7 @@ CMenuManager::DrawFrontEndNormal()
DrawControllerSetupScreen();
break;
default:
- Draw();
+ DrawStandardMenus();
break;
}
@@ -2273,168 +2219,200 @@ CMenuManager::DrawFrontEndNormal()
mouse.Translate(m_nMousePosX, m_nMousePosY);
shad.Translate(m_nMousePosX, m_nMousePosY);
if(field_518 == 4){
- m_aMenuSprites[MENUSPRITE_MOUSET].Draw(shad, CRGBA(100, 100, 100, 50));
+ m_aFrontEndSprites[MENUSPRITE_MOUSET].Draw(shad, CRGBA(100, 100, 100, 50));
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
- m_aMenuSprites[MENUSPRITE_MOUSET].Draw(mouse, CRGBA(255, 255, 255, 255));
+ m_aFrontEndSprites[MENUSPRITE_MOUSET].Draw(mouse, CRGBA(255, 255, 255, 255));
}else{
- m_aMenuSprites[MENUSPRITE_MOUSE].Draw(shad, CRGBA(100, 100, 100, 50));
+ m_aFrontEndSprites[MENUSPRITE_MOUSE].Draw(shad, CRGBA(100, 100, 100, 50));
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
- m_aMenuSprites[MENUSPRITE_MOUSE].Draw(mouse, CRGBA(255, 255, 255, 255));
+ m_aFrontEndSprites[MENUSPRITE_MOUSE].Draw(mouse, CRGBA(255, 255, 255, 255));
}
}
}
#else
+
+// --MIAMI: Done except commented things
void
-CMenuManager::DrawFrontEndNormal()
+CMenuManager::DrawBackground(bool transitionCall)
{
- CSprite2d::InitPerFrame();
- CFont::InitPerFrame();
- RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR);
+ if (!m_bSpritesLoaded)
+ return;
- LoadSplash(nil);
-
- eMenuSprites previousSprite;
- if (m_nMenuFadeAlpha < 255) {
- switch (m_nPrevScreen) {
+ SetFrontEndRenderStates();
+
+ if (m_menuTransitionProgress < 255) {
+ CSprite2d::DrawRect(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(0, 0, 0, 255));
+ }
+
+ if (m_nMenuFadeAlpha != 0) {
+
+ if (m_nMenuFadeAlpha < 255) {
+
+ menuBg.Translate(m_nMenuFadeAlpha);
+ SetFrontEndRenderStates();
+ m_aFrontEndSprites[MENUSPRITE_BACKGROUND].Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(255, 255, 255, FadeIn(255)));
+ if (m_nCurrScreen == MENUPAGE_MAP)
+ PrintMap();
+
+ // Left border
+ CSprite2d::Draw2DPolygon(SCREEN_STRETCH_X(menuBg.bottomLeft_x), SCREEN_STRETCH_Y(menuBg.bottomLeft_y), 0.0f, SCREEN_HEIGHT,
+ SCREEN_STRETCH_X(menuBg.topLeft_x), SCREEN_STRETCH_Y(menuBg.topLeft_y), 0.0f, 0.0f, CRGBA(0, 0, 0, 255));
+
+ // Top border
+ CSprite2d::Draw2DPolygon(SCREEN_STRETCH_X(menuBg.topRight_x), SCREEN_STRETCH_Y(menuBg.topRight_y),
+ SCREEN_STRETCH_X(menuBg.topLeft_x), SCREEN_STRETCH_Y(menuBg.topLeft_y), SCREEN_WIDTH, 0.0f, 0.0f, 0.0f, CRGBA(0, 0, 0, 255));
+
+ // Bottom border
+ CSprite2d::Draw2DPolygon(SCREEN_WIDTH, SCREEN_HEIGHT, 0.0f, SCREEN_HEIGHT, SCREEN_STRETCH_X(menuBg.bottomRight_x), SCREEN_STRETCH_Y(menuBg.bottomRight_y),
+ SCREEN_STRETCH_X(menuBg.bottomLeft_x), SCREEN_STRETCH_Y(menuBg.bottomLeft_y), CRGBA(0, 0, 0, 255));
+
+ // Right border
+ CSprite2d::Draw2DPolygon(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_STRETCH_X(menuBg.bottomRight_x), SCREEN_STRETCH_Y(menuBg.bottomRight_y),
+ SCREEN_WIDTH, 0.0f, SCREEN_STRETCH_X(menuBg.topRight_x), SCREEN_STRETCH_Y(menuBg.topRight_y), CRGBA(0, 0, 0, 255));
+ } else {
+ m_nMenuFadeAlpha = 255;
+ m_menuTransitionProgress = 255;
+ m_aFrontEndSprites[MENUSPRITE_BACKGROUND].Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(255, 255, 255, FadeIn(255)));
+ if (m_nCurrScreen == MENUPAGE_MAP)
+ PrintMap();
+
+ // Left border
+ CSprite2d::Draw2DPolygon(SCREEN_STRETCH_X(menuBg.bottomLeft_x), SCREEN_STRETCH_Y(menuBg.bottomLeft_y), 0.0f, SCREEN_HEIGHT,
+ SCREEN_STRETCH_X(menuBg.topLeft_x), SCREEN_STRETCH_Y(menuBg.topLeft_y), 0.0f, 0.0f, CRGBA(0, 0, 0, 255));
+
+ // Top border
+ CSprite2d::Draw2DPolygon(SCREEN_STRETCH_X(menuBg.topRight_x), SCREEN_STRETCH_Y(menuBg.topRight_y),
+ SCREEN_STRETCH_X(menuBg.topLeft_x), SCREEN_STRETCH_Y(menuBg.topLeft_y), SCREEN_WIDTH, 0.0f, 0.0f, 0.0f, CRGBA(0, 0, 0, 255));
+
+ // Bottom border
+ CSprite2d::Draw2DPolygon(SCREEN_WIDTH, SCREEN_HEIGHT, 0.0f, SCREEN_HEIGHT, SCREEN_STRETCH_X(menuBg.bottomRight_x), SCREEN_STRETCH_Y(menuBg.bottomRight_y),
+ SCREEN_STRETCH_X(menuBg.bottomLeft_x), SCREEN_STRETCH_Y(menuBg.bottomLeft_y), CRGBA(0, 0, 0, 255));
+
+ // Right border
+ CSprite2d::Draw2DPolygon(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_STRETCH_X(menuBg.bottomRight_x), SCREEN_STRETCH_Y(menuBg.bottomRight_y),
+ SCREEN_WIDTH, 0.0f, SCREEN_STRETCH_X(menuBg.topRight_x), SCREEN_STRETCH_Y(menuBg.topRight_y), CRGBA(0, 0, 0, 255));
+ }
+ } else {
+ menuBg.SaveCurrentCoors();
+ switch (m_nCurrScreen) {
case MENUPAGE_STATS:
- case MENUPAGE_START_MENU:
- case MENUPAGE_PAUSE_MENU:
- previousSprite = MENUSPRITE_MAINMENU;
- break;
- case MENUPAGE_NEW_GAME:
- case MENUPAGE_CHOOSE_LOAD_SLOT:
- case MENUPAGE_CHOOSE_DELETE_SLOT:
- case MENUPAGE_NEW_GAME_RELOAD:
- case MENUPAGE_LOAD_SLOT_CONFIRM:
- case MENUPAGE_DELETE_SLOT_CONFIRM:
- case MENUPAGE_EXIT:
- previousSprite = MENUSPRITE_SINGLEPLAYER;
+ menuBg.topLeft_x = 70.0f;
+ menuBg.topLeft_y = 75.0f;
+ menuBg.topRight_x = 550.0f;
+ menuBg.topRight_y = 16.0f;
+ menuBg.bottomLeft_x = 74.0f;
+ menuBg.bottomLeft_y = 354.0f;
+ menuBg.bottomRight_x = 581.0f;
+ menuBg.bottomRight_y = 340.0f;
break;
- case MENUPAGE_MULTIPLAYER_MAIN:
- previousSprite = MENUSPRITE_MULTIPLAYER;
+ case MENUPAGE_SOUND_SETTINGS:
+ menuBg.topLeft_x = 26.0f;
+ menuBg.topLeft_y = 59.0f;
+ menuBg.topRight_x = 629.0f;
+ menuBg.topRight_y = 29.0f;
+ menuBg.bottomLeft_x = 15.0f;
+ menuBg.bottomLeft_y = 438.0f;
+ menuBg.bottomRight_x = 610.0f;
+ menuBg.bottomRight_y = 410.0f;
break;
- case MENUPAGE_MULTIPLAYER_MAP:
- case MENUPAGE_MULTIPLAYER_FIND_GAME:
case MENUPAGE_SKIN_SELECT:
case MENUPAGE_KEYBOARD_CONTROLS:
- case MENUPAGE_MOUSE_CONTROLS:
- previousSprite = MENUSPRITE_FINDGAME;
- break;
- case MENUPAGE_MULTIPLAYER_CONNECTION:
- case MENUPAGE_MULTIPLAYER_MODE:
- previousSprite = MENUSPRITE_CONNECTION;
+ menuBg.topLeft_x = 14.0f;
+ menuBg.topLeft_y = 39.0f;
+ menuBg.topRight_x = 636.0f;
+ menuBg.topRight_y = 29.0f;
+ menuBg.bottomLeft_x = 15.0f;
+ menuBg.bottomLeft_y = 426.0f;
+ menuBg.bottomRight_x = 630.0f;
+ menuBg.bottomRight_y = 398.0f;
break;
- case MENUPAGE_MULTIPLAYER_CREATE:
- previousSprite = MENUSPRITE_HOSTGAME;
- break;
- case MENUPAGE_SKIN_SELECT_OLD:
- case MENUPAGE_OPTIONS:
- previousSprite = MENUSPRITE_PLAYERSET;
+ case MENUPAGE_BRIEFS:
+ case MENUPAGE_GRAPHICS_SETTINGS:
+ case MENUPAGE_MAP:
+ case MENUPAGE_CHOOSE_LOAD_SLOT:
+ case MENUPAGE_CHOOSE_DELETE_SLOT:
+ case MENUPAGE_CHOOSE_SAVE_SLOT:
+ case MENUPAGE_MOUSE_CONTROLS:
+ menuBg.topLeft_x = 26.0f;
+ menuBg.topLeft_y = 59.0f;
+ menuBg.topRight_x = 629.0f;
+ menuBg.topRight_y = 29.0f;
+ menuBg.bottomLeft_x = 15.0f;
+ menuBg.bottomLeft_y = 426.0f;
+ menuBg.bottomRight_x = 610.0f;
+ menuBg.bottomRight_y = 398.0f;
break;
default:
- previousSprite = MENUSPRITE_MAINMENU;
+ menuBg.topLeft_x = CGeneral::GetRandomNumber() % 40 + 65;
+ menuBg.topLeft_y = CGeneral::GetRandomNumber() % 40 + 21;
+ menuBg.topRight_x = CGeneral::GetRandomNumber() % 40 + 568;
+ menuBg.topRight_y = CGeneral::GetRandomNumber() % 40 + 44;
+ menuBg.bottomLeft_x = CGeneral::GetRandomNumber() % 40 + 36;
+ menuBg.bottomLeft_y = CGeneral::GetRandomNumber() % 40 + 382;
+ menuBg.bottomRight_x = CGeneral::GetRandomNumber() % 40 + 593;
+ menuBg.bottomRight_y = CGeneral::GetRandomNumber() % 40 + 342;
break;
}
-
- if (m_nPrevScreen == m_nCurrScreen)
- CSprite2d::DrawRect(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(0, 0, 0, 255 - m_nMenuFadeAlpha));
- else
- m_aMenuSprites[previousSprite].Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(255, 255, 255, 255 - m_nMenuFadeAlpha));
- }
-
- RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE);
- RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
- eMenuSprites currentSprite = MENUSPRITE_MAINMENU; // actually uninitialized
- switch (m_nCurrScreen) {
- case MENUPAGE_STATS:
- case MENUPAGE_START_MENU:
- case MENUPAGE_PAUSE_MENU:
- currentSprite = MENUSPRITE_MAINMENU;
- break;
- case MENUPAGE_NEW_GAME:
- case MENUPAGE_CHOOSE_LOAD_SLOT:
- case MENUPAGE_CHOOSE_DELETE_SLOT:
- case MENUPAGE_NEW_GAME_RELOAD:
- case MENUPAGE_LOAD_SLOT_CONFIRM:
- case MENUPAGE_DELETE_SLOT_CONFIRM:
- case MENUPAGE_EXIT:
- currentSprite = MENUSPRITE_SINGLEPLAYER;
- break;
- case MENUPAGE_MULTIPLAYER_MAIN:
- currentSprite = MENUSPRITE_MULTIPLAYER;
- break;
- case MENUPAGE_MULTIPLAYER_MAP:
- case MENUPAGE_MULTIPLAYER_FIND_GAME:
- case MENUPAGE_SKIN_SELECT:
- case MENUPAGE_KEYBOARD_CONTROLS:
- case MENUPAGE_MOUSE_CONTROLS:
- currentSprite = MENUSPRITE_FINDGAME;
- break;
- case MENUPAGE_MULTIPLAYER_CONNECTION:
- case MENUPAGE_MULTIPLAYER_MODE:
- currentSprite = MENUSPRITE_CONNECTION;
- break;
- case MENUPAGE_MULTIPLAYER_CREATE:
- currentSprite = MENUSPRITE_HOSTGAME;
- break;
- case MENUPAGE_SKIN_SELECT_OLD:
- case MENUPAGE_OPTIONS:
- currentSprite = MENUSPRITE_PLAYERSET;
- break;
+ menuBg.UpdateMultipliers();
+ if (m_menuTransitionProgress == 255)
+ bOptionHighlightTransitionBlend = 0;
}
- if (m_nMenuFadeAlpha < 255) {
+ // Congrats R*, instead of solving the bug you just hacked your million dolar product.
+#if 0
- // Famous transparent menu bug
-#ifdef FIX_BUGS
- static float fadeAlpha = 0.0f;
- if (m_nMenuFadeAlpha == 0 && fadeAlpha > 1.0f) fadeAlpha = 0.0f;
+ // This is how I fixed it in III, but I can't apply it here because "forceFadeInCounter > 30" gives it a unique effect.
+ static float fadeAlpha = 0.0f;
+ if (m_nMenuFadeAlpha == 0 && fadeAlpha > 1.0f) fadeAlpha = 0.0f;
- // +20 per every 33 ms (1000.f/30.f - original frame limiter fps)
- fadeAlpha += (frameTime) * 20.f / 33.f;
- m_nMenuFadeAlpha = fadeAlpha;
+ // +20 per every 33 ms (1000.f/30.f - original frame limiter fps)
+ fadeAlpha += (frameTime) * 20.f / 33.f;
+ m_nMenuFadeAlpha = clamp(fadeAlpha, 0, 255);
+ m_menuTransitionProgress = clamp(fadeAlpha, 0, 255);
#else
- static uint32 LastFade = 0;
+ static uint32 LastFade = 0;
+ static uint8 forceFadeInCounter = 0;
- if(CTimer::GetTimeInMillisecondsPauseMode() - LastFade > 10){
+ if (m_nMenuFadeAlpha >= 255) {
+ if (m_nMenuFadeAlpha > 255)
+ m_nMenuFadeAlpha = 255;
+ } else {
+ if (CTimer::GetTimeInMillisecondsPauseMode() - LastFade > 30 || forceFadeInCounter > 30) {
m_nMenuFadeAlpha += 20;
+ m_menuTransitionProgress = Min(m_menuTransitionProgress + 20, 255);
LastFade = CTimer::GetTimeInMillisecondsPauseMode();
}
+ forceFadeInCounter++;
+ }
#endif
-
- if (m_nMenuFadeAlpha > 255){
- m_aMenuSprites[currentSprite].Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(255, 255, 255, 255));
- } else {
- RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
- m_aMenuSprites[currentSprite].Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(255, 255, 255, m_nMenuFadeAlpha));
- }
- } else {
- m_aMenuSprites[currentSprite].Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(255, 255, 255, 255));
- // TODO: what is this? waiting mouse?
- if(field_518 == 4){
- if(m_nHoverOption == HOVEROPTION_3 || m_nHoverOption == HOVEROPTION_4 ||
- m_nHoverOption == HOVEROPTION_5 || m_nHoverOption == HOVEROPTION_6 || m_nHoverOption == HOVEROPTION_7)
- field_518 = 2;
- else
- field_518 = 1;
+ if (!transitionCall && m_menuTransitionProgress == 255) {
+ float oldAlpha = m_nMenuFadeAlpha;
+ if (oldAlpha < 255) {
+ int oldScreen = m_nCurrScreen;
+ SetFrontEndRenderStates();
+ m_nCurrScreen = m_nPrevScreen;
+ m_nMenuFadeAlpha = 255 - m_nMenuFadeAlpha;
+ switch (m_nCurrScreen) {
+ case MENUPAGE_SKIN_SELECT:
+ CMenuManager::DrawPlayerSetupScreen();
+ break;
+ case MENUPAGE_KEYBOARD_CONTROLS:
+ CMenuManager::DrawControllerSetupScreen();
+ break;
+ /* case MENUPAGE_OUTRO:
+ CMenuManager::DrawQuitGameScreen();
+ break; */ // TODO(Miami)
+ default:
+ CMenuManager::DrawStandardMenus();
+ break;
+ }
+ m_nCurrScreen = oldScreen;
+ m_nMenuFadeAlpha = oldAlpha;
}
}
- // GTA LOGO
- RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
- RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
- if (m_nCurrScreen == MENUPAGE_START_MENU || m_nCurrScreen == MENUPAGE_PAUSE_MENU) {
- if (CGame::frenchGame || CGame::germanGame || !CGame::nastyGame)
- m_aMenuSprites[MENUSPRITE_GTA3LOGO].Draw(CRect(MENU_X_LEFT_ALIGNED(205.0f), MENU_Y(70.0f), MENU_X_LEFT_ALIGNED(435.0f), MENU_Y(180.0f)), CRGBA(255, 255, 255, FadeIn(255)));
- else
- m_aMenuSprites[MENUSPRITE_GTALOGO].Draw(CRect(MENU_X_LEFT_ALIGNED(225.0f), MENU_Y(40.0f), MENU_X_LEFT_ALIGNED(415.0f), MENU_Y(210.0f)), CRGBA(255, 255, 255, FadeIn(255)));
- }
-
- RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERNEAREST);
- RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, (void*)rwTEXTUREADDRESSCLAMP);
- RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
switch (m_nCurrScreen) {
case MENUPAGE_SKIN_SELECT:
DrawPlayerSetupScreen();
@@ -2442,35 +2420,33 @@ CMenuManager::DrawFrontEndNormal()
case MENUPAGE_KEYBOARD_CONTROLS:
DrawControllerSetupScreen();
break;
+ /* case MENUPAGE_OUTRO:
+ CMenuManager::DrawQuitGameScreen();
+ break; */ // TODO(Miami)
default:
- Draw();
+ DrawStandardMenus();
break;
}
CFont::DrawFonts();
+ SetFrontEndRenderStates();
- // Draw mouse
- RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR);
- RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, (void*)rwTEXTUREADDRESSCLAMP);
- if (m_bShowMouse) {
- RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
- RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
- RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
+// TODO(Miami)
+// if (m_nCurrScreen != MENUPAGE_OUTRO)
+ if (m_menuTransitionProgress == 255) {
+ m_aFrontEndSprites[MENUSPRITE_VCLOGO].Draw(CRect(MENU_X(27.0f), MENU_Y(8.0f), MENU_X(157.0f), MENU_Y(138.0f)), CRGBA(255, 255, 255, 255));
+ } else {
+ m_aFrontEndSprites[MENUSPRITE_VCLOGO].Draw(CRect(MENU_X(27.0f), MENU_Y(8.0f), MENU_X(157.0f), MENU_Y(138.0f)), CRGBA(255, 255, 255, FadeIn(255)));
+ }
- CRect mouse(0.0f, 0.0f, MENU_X(75.0f), MENU_Y(75.0f));
- CRect shad(MENU_X(10.0f), MENU_Y(3.0f), MENU_X(85.0f), MENU_Y(78.0f));
+ if (m_bShowMouse) {
+ CRect mouse(0.0f, 0.0f, MENU_X(40.0f), MENU_Y(40.0f));
+ CRect shad(MENU_X(10.0f), MENU_Y(3.0f), MENU_X(55.0f), MENU_Y(43.0f));
mouse.Translate(m_nMousePosX, m_nMousePosY);
shad.Translate(m_nMousePosX, m_nMousePosY);
- if(field_518 == 4){
- m_aMenuSprites[MENUSPRITE_MOUSET].Draw(shad, CRGBA(100, 100, 100, 50));
- RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
- m_aMenuSprites[MENUSPRITE_MOUSET].Draw(mouse, CRGBA(255, 255, 255, 255));
- }else{
- m_aMenuSprites[MENUSPRITE_MOUSE].Draw(shad, CRGBA(100, 100, 100, 50));
- RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
- m_aMenuSprites[MENUSPRITE_MOUSE].Draw(mouse, CRGBA(255, 255, 255, 255));
- }
+ m_aFrontEndSprites[MENUSPRITE_MOUSE].Draw(shad, CRGBA(100, 100, 100, 50));
+ m_aFrontEndSprites[MENUSPRITE_MOUSE].Draw(mouse, CRGBA(255, 255, 255, 255));
}
}
#endif
@@ -2711,21 +2687,21 @@ CMenuManager::DrawPlayerSetupScreen()
// 2 - leaves gap between button and scrollbar
if (m_nHoverOption == HOVEROPTION_CLICKED_SCROLL_UP) {
#ifdef FIX_BUGS
- m_aMenuSprites[MENUSPRITE_UPON].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2), MENU_Y(PLAYERSETUP_LIST_TOP),
+ m_aFrontEndSprites[MENUSPRITE_UPON].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2), MENU_Y(PLAYERSETUP_LIST_TOP),
MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2 - PLAYERSETUP_SCROLLBUTTON_TXD_DIMENSION), MENU_Y(PLAYERSETUP_LIST_TOP + PLAYERSETUP_SCROLLBUTTON_TXD_DIMENSION)),
CRGBA(255, 255, 255, FadeIn(255)));
#else
- m_aMenuSprites[MENUSPRITE_UPON].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2), MENU_Y(PLAYERSETUP_LIST_TOP),
+ m_aFrontEndSprites[MENUSPRITE_UPON].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2), MENU_Y(PLAYERSETUP_LIST_TOP),
MENU_X_RIGHT_ALIGNED(-20.0f), MENU_Y(PLAYERSETUP_LIST_TOP + 58)),
CRGBA(255, 255, 255, FadeIn(255)));
#endif
} else {
#ifdef FIX_BUGS
- m_aMenuSprites[MENUSPRITE_UPOFF].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 3), MENU_Y(PLAYERSETUP_LIST_TOP),
+ m_aFrontEndSprites[MENUSPRITE_UPOFF].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 3), MENU_Y(PLAYERSETUP_LIST_TOP),
MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 3 - PLAYERSETUP_SCROLLBUTTON_TXD_DIMENSION), MENU_Y(PLAYERSETUP_LIST_TOP + PLAYERSETUP_SCROLLBUTTON_TXD_DIMENSION)),
CRGBA(255, 255, 255, FadeIn(255)));
#else
- m_aMenuSprites[MENUSPRITE_UPOFF].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 3), MENU_Y(PLAYERSETUP_LIST_TOP),
+ m_aFrontEndSprites[MENUSPRITE_UPOFF].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 3), MENU_Y(PLAYERSETUP_LIST_TOP),
MENU_X_RIGHT_ALIGNED(-21.0f), MENU_Y(PLAYERSETUP_LIST_TOP + 58)),
CRGBA(255, 255, 255, FadeIn(255)));
#endif
@@ -2733,21 +2709,21 @@ CMenuManager::DrawPlayerSetupScreen()
if (m_nHoverOption == HOVEROPTION_CLICKED_SCROLL_DOWN) {
#ifdef FIX_BUGS
- m_aMenuSprites[MENUSPRITE_DOWNON].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2), SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM + PLAYERSETUP_SCROLLBUTTON_HEIGHT + 1),
+ m_aFrontEndSprites[MENUSPRITE_DOWNON].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2), SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM + PLAYERSETUP_SCROLLBUTTON_HEIGHT + 1),
MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2 - PLAYERSETUP_SCROLLBUTTON_TXD_DIMENSION), SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM + PLAYERSETUP_SCROLLBUTTON_HEIGHT + 1 - PLAYERSETUP_SCROLLBUTTON_TXD_DIMENSION)),
CRGBA(255, 255, 255, FadeIn(255)));
#else
- m_aMenuSprites[MENUSPRITE_DOWNON].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2), SCREEN_SCALE_FROM_BOTTOM(141.0f),
+ m_aFrontEndSprites[MENUSPRITE_DOWNON].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2), SCREEN_SCALE_FROM_BOTTOM(141.0f),
MENU_X_RIGHT_ALIGNED(-20.0f), SCREEN_SCALE_FROM_BOTTOM(83.0f)),
CRGBA(255, 255, 255, FadeIn(255)));
#endif
} else {
#ifdef FIX_BUGS
- m_aMenuSprites[MENUSPRITE_DOWNOFF].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 3), SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM + PLAYERSETUP_SCROLLBUTTON_HEIGHT + 1),
+ m_aFrontEndSprites[MENUSPRITE_DOWNOFF].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 3), SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM + PLAYERSETUP_SCROLLBUTTON_HEIGHT + 1),
MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 3 - PLAYERSETUP_SCROLLBUTTON_TXD_DIMENSION), SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM + PLAYERSETUP_SCROLLBUTTON_HEIGHT + 1 - PLAYERSETUP_SCROLLBUTTON_TXD_DIMENSION)),
CRGBA(255, 255, 255, FadeIn(255)));
#else
- m_aMenuSprites[MENUSPRITE_DOWNOFF].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 3), SCREEN_SCALE_FROM_BOTTOM(141.0f),
+ m_aFrontEndSprites[MENUSPRITE_DOWNOFF].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 3), SCREEN_SCALE_FROM_BOTTOM(141.0f),
MENU_X_RIGHT_ALIGNED(-21.0f), SCREEN_SCALE_FROM_BOTTOM(83.0f)),
CRGBA(255, 255, 255, FadeIn(255)));
#endif
@@ -2889,11 +2865,6 @@ CMenuManager::DrawPlayerSetupScreen()
int
CMenuManager::FadeIn(int alpha)
{
- if (m_nCurrScreen == MENUPAGE_LOADING_IN_PROGRESS ||
- m_nCurrScreen == MENUPAGE_SAVING_IN_PROGRESS ||
- m_nCurrScreen == MENUPAGE_DELETING)
- return alpha;
-
return Min(m_nMenuFadeAlpha, alpha);
}
@@ -3002,70 +2973,57 @@ CMenuManager::LoadAllTextures()
if (m_bSpritesLoaded)
return;
- CentreMousePointer();
- DMAudio.ChangeMusicMode(MUSICMODE_FRONTEND);
- DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_STARTING, 0);
- m_nCurrOption = 0;
- m_PrefsRadioStation = DMAudio.GetRadioInCar();
-
- if (DMAudio.IsMP3RadioChannelAvailable()) {
- if (m_PrefsRadioStation > USERTRACK)
- m_PrefsRadioStation = CGeneral::GetRandomNumber() % 10;
- } else if (m_PrefsRadioStation > CHATTERBOX)
- m_PrefsRadioStation = CGeneral::GetRandomNumber() % 9;
-
- CFileMgr::SetDir("");
- //CFileMgr::SetDir("");
+ field_F0 = SCREEN_STRETCH_X(178.0f); // TODO(Miami)
CTimer::Stop();
+
CStreaming::MakeSpaceFor(350 * CDSTREAM_SECTOR_SIZE); // twice of it in mobile
CStreaming::ImGonnaUseStreamingMemory();
CGame::TidyUpMemory(false, true);
CTxdStore::PushCurrentTxd();
- int frontendTxdSlot = CTxdStore::FindTxdSlot("frontend");
+ int frontendTxdSlot1 = CTxdStore::FindTxdSlot("frontend1");
- if(frontendTxdSlot == -1)
- frontendTxdSlot = CTxdStore::AddTxdSlot("frontend");
+ if(frontendTxdSlot1 == -1)
+ frontendTxdSlot1 = CTxdStore::AddTxdSlot("frontend1");
- printf("LOAD frontend\n");
- CTxdStore::LoadTxd(frontendTxdSlot, "MODELS/FRONTEND.TXD");
- CTxdStore::AddRef(frontendTxdSlot);
- CTxdStore::SetCurrentTxd(frontendTxdSlot);
-#ifndef GTA3_1_1_PATCH
- CStreaming::IHaveUsedStreamingMemory();
- CTimer::Update();
-#endif
+ printf("LOAD frontend1\n");
+ CTxdStore::LoadTxd(frontendTxdSlot1, "MODELS/FRONTEN1.TXD");
+ CTxdStore::AddRef(frontendTxdSlot1);
+ CTxdStore::SetCurrentTxd(frontendTxdSlot1);
- for (int i = 0; i < ARRAY_SIZE(FrontendFilenames); i++) {
+ for (int i = 0; i < 3; i++) {
m_aFrontEndSprites[i].SetTexture(FrontendFilenames[i][0], FrontendFilenames[i][1]);
m_aFrontEndSprites[i].SetAddressing(rwTEXTUREADDRESSBORDER);
}
- int menuTxdSlot = CTxdStore::FindTxdSlot("menu");
+ CTxdStore::PopCurrentTxd();
+ CStreaming::IHaveUsedStreamingMemory();
+
+ if (!m_OnlySaveMenu) {
+ CStreaming::MakeSpaceFor(692 * CDSTREAM_SECTOR_SIZE); // twice of it in mobile
+ CStreaming::ImGonnaUseStreamingMemory();
+ CTxdStore::PushCurrentTxd();
- if (menuTxdSlot == -1)
- menuTxdSlot = CTxdStore::AddTxdSlot("menu");
+ int frontendTxdSlot2 = CTxdStore::FindTxdSlot("frontend2");
- printf("LOAD sprite\n");
- CTxdStore::LoadTxd(menuTxdSlot, "MODELS/MENU.TXD");
- CTxdStore::AddRef(menuTxdSlot);
- CTxdStore::SetCurrentTxd(menuTxdSlot);
+ if (frontendTxdSlot2 == -1)
+ frontendTxdSlot2 = CTxdStore::AddTxdSlot("frontend2");
- for (int i = 0; i < ARRAY_SIZE(MenuFilenames); i++) {
- m_aMenuSprites[i].SetTexture(MenuFilenames[i][0], MenuFilenames[i][1]);
- m_aMenuSprites[i].SetAddressing(rwTEXTUREADDRESSBORDER);
- }
-#ifdef MENU_MAP
- for (int i = 0; i < ARRAY_SIZE(MapFilenames); i++) {
- m_aMapSprites[i].SetTexture(MapFilenames[i][0], MapFilenames[i][1]);
- m_aMapSprites[i].SetAddressing(rwTEXTUREADDRESSBORDER);
+ printf("LOAD frontend2\n");
+ CTxdStore::LoadTxd(frontendTxdSlot2, "MODELS/FRONTEN2.TXD");
+ CTxdStore::AddRef(frontendTxdSlot2);
+ CTxdStore::SetCurrentTxd(frontendTxdSlot2);
+
+ for (int i = 3; i < NUM_MENU_SPRITES; i++) {
+ m_aFrontEndSprites[i].SetTexture(FrontendFilenames[i][0], FrontendFilenames[i][1]);
+ m_aFrontEndSprites[i].SetAddressing(rwTEXTUREADDRESSBORDER);
+ }
+
+ CTxdStore::PopCurrentTxd();
+ CStreaming::IHaveUsedStreamingMemory();
}
-#endif
-#ifdef GTA3_1_1_PATCH
- CStreaming::IHaveUsedStreamingMemory();
- CTimer::Update();
-#endif
+
m_bSpritesLoaded = true;
- CTxdStore::PopCurrentTxd();
+ CTimer::Update();
}
void
@@ -3138,6 +3096,9 @@ CMenuManager::LoadSettings()
CFileMgr::Read(fileHandle, m_PrefsSkinFile, 256);
CFileMgr::Read(fileHandle, (char*)&m_ControlMethod, 1);
CFileMgr::Read(fileHandle, (char*)&m_PrefsLanguage, 1);
+#ifdef FREE_CAM
+ CFileMgr::Read(fileHandle, (char*)&TheCamera.bFreeCam, 1);
+#endif
}
}
@@ -3147,9 +3108,11 @@ CMenuManager::LoadSettings()
m_PrefsVsync = m_PrefsVsyncDisp;
CRenderer::ms_lodDistScale = m_PrefsLOD;
- if (m_nPrefsAudio3DProviderIndex == -1)
+ if (m_nPrefsAudio3DProviderIndex == INVALID_AUDIO_PROVIDER)
m_nPrefsAudio3DProviderIndex = -2;
+ m_lastWorking3DAudioProvider = m_nPrefsAudio3DProviderIndex;
+
if (m_PrefsLanguage == prevLang)
m_bLanguageLoaded = false;
else {
@@ -3228,15 +3191,16 @@ CMenuManager::SaveSettings()
CFileMgr::Write(fileHandle, m_PrefsSkinFile, 256);
CFileMgr::Write(fileHandle, (char*)&m_ControlMethod, 1);
CFileMgr::Write(fileHandle, (char*)&m_PrefsLanguage, 1);
+#ifdef FREE_CAM
+ CFileMgr::Write(fileHandle, (char*)&TheCamera.bFreeCam, 1);
+#endif
}
+ m_lastWorking3DAudioProvider = m_nPrefsAudio3DProviderIndex;
CFileMgr::CloseFile(fileHandle);
CFileMgr::SetDir("");
}
-bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha);
-void DoRWStuffEndOfFrame(void);
-
void
CMenuManager::MessageScreen(const char *text)
{
@@ -3270,22 +3234,6 @@ CMenuManager::MessageScreen(const char *text)
}
void
-CMenuManager::PickNewPlayerColour()
-{
- m_PrefsPlayerRed = 0;
- m_PrefsPlayerGreen = 0;
- m_PrefsPlayerBlue = 0;
- while (true) {
- int sum = m_PrefsPlayerRed + m_PrefsPlayerGreen + m_PrefsPlayerBlue;
- if (sum >= 100 && sum <= 650)
- break;
- m_PrefsPlayerRed = CGeneral::GetRandomNumber();
- m_PrefsPlayerGreen = CGeneral::GetRandomNumber();
- m_PrefsPlayerBlue = CGeneral::GetRandomNumber();
- }
-}
-
-void
CMenuManager::PrintBriefs()
{
CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255)));
@@ -3336,30 +3284,6 @@ CMenuManager::PrintBriefs()
#endif
}
-// Not sure about name. Not to be confused with CPad::PrintErrorMessage
-void
-CMenuManager::PrintErrorMessage()
-{
- if (!CPad::bDisplayNoControllerMessage && !CPad::bObsoleteControllerMessage)
- return;
-
- CSprite2d::DrawRect(CRect(SCREEN_SCALE_X(20.0f), SCREEN_SCALE_Y(140.0f), SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f)), CRGBA(64, 16, 16, 224));
- CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
- CFont::SetBackgroundOff();
- CFont::SetPropOn();
- CFont::SetCentreOff();
- CFont::SetJustifyOn();
- CFont::SetRightJustifyOff();
- CFont::SetBackGroundOnlyTextOn();
- CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(40.0f));
-#ifdef FIX_BUGS
- CFont::PrintString(SCREEN_SCALE_X(50.0f), SCREEN_SCALE_Y(180.0f), TheText.Get(CPad::bDisplayNoControllerMessage ? "NOCONT" : "WRCONT"));
-#else
- CFont::PrintString(SCREEN_SCALE_X(50.0f), SCREEN_SCALE_Y(40.0f), TheText.Get(CPad::bDisplayNoControllerMessage ? "NOCONT" : "WRCONT"));
-#endif
- CFont::DrawFonts();
-}
-
void
CMenuManager::PrintStats()
{
@@ -3373,7 +3297,7 @@ CMenuManager::PrintStats()
// Scroll stats with mouse
#ifdef SCROLLABLE_STATS_PAGE
static float scrollY = 0;
- static uint32 lastChange = m_nScreenChangeDelayTimer;
+ static uint32 lastChange = m_LastScreenSwitch;
if (CPad::GetPad(0)->GetLeftMouse()) {
scrollY += (m_nMouseOldPosY - m_nMousePosY);
lastChange = CTimer::GetTimeInMillisecondsPauseMode();
@@ -3383,7 +3307,7 @@ CMenuManager::PrintStats()
}
#else
// MENU_Y(30.0f) per second
- float scrollY = MENU_Y(STATS_SLIDE_Y_PER_SECOND) * (CTimer::GetTimeInMillisecondsPauseMode() - m_nScreenChangeDelayTimer) / 1000.0f;
+ float scrollY = MENU_Y(STATS_SLIDE_Y_PER_SECOND) * (CTimer::GetTimeInMillisecondsPauseMode() - m_LastScreenSwitch) / 1000.0f;
#endif
for (int row = 0; row < rowNum; ++row) {
@@ -3446,167 +3370,95 @@ CMenuManager::PrintStats()
// ::Draw already does that.
/*
PREPARE_MENU_HEADER
- CFont::PrintString(MENU_X_RIGHT_ALIGNED(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
+ CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
*/
CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X), MENU_Y(MENU_TEXT_SIZE_Y));
}
+// --MIAMI: Done
void
CMenuManager::Process(void)
{
- m_bMenuStateChanged = false;
-
- if (!m_bSaveMenuActive && TheCamera.GetScreenFadeStatus() != FADE_0)
+ if (TheCamera.GetScreenFadeStatus() != FADE_0)
return;
- m_bWantToRestart = false;
InitialiseChangedLanguageSettings();
- // Just a hack by R* to not make game continuously resume/pause. But we it seems we can live with it.
- if (CPad::GetPad(0)->GetEscapeJustDown())
- RequestFrontEndStartUp();
-
- SwitchMenuOnAndOff();
-
- // Be able to re-open menu correctly.
if (m_bMenuActive) {
+ ProcessButtonPresses();
+ ProcessFileActions();
+ DMAudio.Service();
- // Load frontend textures.
- LoadAllTextures();
+ // Game calls some texture pool cleanup functions in here
+ }
- // Set save/delete game pages.
- if (m_nCurrScreen == MENUPAGE_DELETING) {
- bool SlotPopulated = false;
+ SwitchMenuOnAndOff();
+}
- if (PcSaveHelper.DeleteSlot(m_nCurrSaveSlot)) {
- PcSaveHelper.PopulateSlotInfo();
- SlotPopulated = true;
+void
+CMenuManager::ProcessButtonPresses(void)
+{
+ // TODO(Miami)
+ // if (m_nCurrScreen == MENUPAGE_OUTRO)
+ // return;
+
+ if (m_bWaitingForNewKeyBind) {
+ if (m_bStartWaitingForKeyBind)
+ m_bStartWaitingForKeyBind = false;
+ else {
+ pControlEdit = CPad::EditCodesForControls(pControlEdit, 1);
+ JoyButtonJustClicked = false;
+ MouseButtonJustClicked = false;
+
+ if (CPad::GetPad(0)->GetLeftMouseJustDown())
+ MouseButtonJustClicked = 1;
+ else if (CPad::GetPad(0)->GetRightMouseJustUp())
+ MouseButtonJustClicked = 3;
+ else if (CPad::GetPad(0)->GetMiddleMouseJustUp())
+ MouseButtonJustClicked = 2;
+ else if (CPad::GetPad(0)->GetMouseWheelUpJustUp())
+ MouseButtonJustClicked = 4;
+ else if (CPad::GetPad(0)->GetMouseWheelDownJustUp())
+ MouseButtonJustClicked = 5;
+ // TODO two more buttons
+
+ JoyButtonJustClicked = ControlsManager.GetJoyButtonJustDown();
+
+ int32 TypeOfControl = KEYBOARD;
+ if (JoyButtonJustClicked)
+ TypeOfControl = JOYSTICK;
+ if (MouseButtonJustClicked)
+ TypeOfControl = MOUSE;
+ if (*pControlEdit != rsNULL)
+ TypeOfControl = KEYBOARD;
+
+ if (!m_bKeyIsOK) {
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_FAIL, 0);
+ pControlEdit = nil;
+ m_bWaitingForNewKeyBind = false;
+ m_KeyPressedCode = -1;
+ m_bStartWaitingForKeyBind = false;
}
+ else if (!m_bKeyChangeNotProcessed) {
+ if (*pControlEdit != rsNULL || MouseButtonJustClicked || JoyButtonJustClicked)
+ CheckCodesForControls(TypeOfControl);
- if (SlotPopulated)
- ChangeScreen(MENUPAGE_DELETE_SUCCESS, 0, true, false);
- else
- SaveLoadFileError_SetUpErrorScreen();
- }
- if (m_nCurrScreen == MENUPAGE_SAVING_IN_PROGRESS) {
- int8 SaveSlot = PcSaveHelper.SaveSlot(m_nCurrSaveSlot);
- PcSaveHelper.PopulateSlotInfo();
- if (SaveSlot)
- ChangeScreen(MENUPAGE_SAVE_SUCCESSFUL, 0, true, false);
- else
- SaveLoadFileError_SetUpErrorScreen();
- }
- if (m_nCurrScreen == MENUPAGE_LOADING_IN_PROGRESS) {
- if (CheckSlotDataValid(m_nCurrSaveSlot)) {
- TheCamera.m_bUseMouse3rdPerson = m_ControlMethod == CONTROL_STANDARD;
- if (m_PrefsVsyncDisp != m_PrefsVsync)
- m_PrefsVsync = m_PrefsVsyncDisp;
- DMAudio.Service();
- m_bWantToRestart = true;
- RequestFrontEndShutDown();
- m_bWantToLoad = true;
- b_FoundRecentSavedGameWantToLoad = true;
- DMAudio.SetEffectsFadeVol(0);
- DMAudio.SetMusicFadeVol(0);
- DMAudio.ResetTimers(CTimer::GetTimeInMilliseconds());
- } else
- SaveLoadFileError_SetUpErrorScreen();
- }
-
- ProcessButtonPresses();
-
- // Set binding keys.
- if (pEditString && CPad::EditString(pEditString, 0) == nil) {
- if (*pEditString == 0)
- strcpy(pEditString, "NoName");
- pEditString = nil;
- SaveSettings();
- }
-
- if (m_bWaitingForNewKeyBind) {
- if (m_bStartWaitingForKeyBind)
- m_bStartWaitingForKeyBind = false;
+ field_159 = true;
+ }
else {
- pControlEdit = CPad::EditCodesForControls(pControlEdit, 1);
- JoyButtonJustClicked = false;
- MouseButtonJustClicked = false;
-
- if (CPad::GetPad(0)->GetLeftMouseJustDown())
- MouseButtonJustClicked = 1;
- else if (CPad::GetPad(0)->GetRightMouseJustUp())
- MouseButtonJustClicked = 3;
- else if (CPad::GetPad(0)->GetMiddleMouseJustUp())
- MouseButtonJustClicked = 2;
- else if (CPad::GetPad(0)->GetMouseWheelUpJustUp())
- MouseButtonJustClicked = 4;
- else if (CPad::GetPad(0)->GetMouseWheelDownJustUp())
- MouseButtonJustClicked = 5;
- // TODO two more buttons
-
- JoyButtonJustClicked = ControlsManager.GetJoyButtonJustDown();
-
- int32 TypeOfControl = KEYBOARD;
- if (JoyButtonJustClicked)
- TypeOfControl = JOYSTICK;
- if (MouseButtonJustClicked)
- TypeOfControl = MOUSE;
- if (*pControlEdit != rsNULL)
- TypeOfControl = KEYBOARD;
-
- if (!m_bKeyIsOK) {
- DMAudio.PlayFrontEndSound(SOUND_FRONTEND_FAIL, 0);
- pControlEdit = nil;
- m_bWaitingForNewKeyBind = false;
- m_KeyPressedCode = -1;
- m_bStartWaitingForKeyBind = false;
- } else if (!m_bKeyChangeNotProcessed) {
- if (*pControlEdit != rsNULL || MouseButtonJustClicked || JoyButtonJustClicked)
- CheckCodesForControls(TypeOfControl);
-
- field_535 = true;
- } else {
- DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
- for (int i = 0; i < 4; i++)
- ControlsManager.ClearSettingsAssociatedWithAction((e_ControllerAction)m_CurrCntrlAction, (eControllerType)i);
- m_bKeyIsOK = false;
- m_bKeyChangeNotProcessed = false;
- pControlEdit = nil;
- m_bWaitingForNewKeyBind = false;
- m_KeyPressedCode = -1;
- m_bStartWaitingForKeyBind = false;
- }
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
+ for (int i = 0; i < 4; i++)
+ ControlsManager.ClearSettingsAssociatedWithAction((e_ControllerAction)m_CurrCntrlAction, (eControllerType)i);
+ m_bKeyIsOK = false;
+ m_bKeyChangeNotProcessed = false;
+ pControlEdit = nil;
+ m_bWaitingForNewKeyBind = false;
+ m_KeyPressedCode = -1;
+ m_bStartWaitingForKeyBind = false;
}
}
-
- if ((m_nCurrScreen == MENUPAGE_NO_MEMORY_CARD || m_nCurrScreen == MENUPAGE_PS2_LOAD_FAILED) && CTimer::GetTimeInMillisecondsPauseMode() > field_558) {
- m_nCurrScreen = m_nPrevScreen;
- m_nCurrOption = 0;
- }
-
- // Reset pad shaking.
- if (TimeToStopPadShaking && TimeToStopPadShaking < CTimer::GetTimeInMillisecondsPauseMode()) {
- CPad::StopPadsShaking();
- TimeToStopPadShaking = 0;
- }
-
- } else {
- UnloadTextures();
- m_bRenderGameInMenu = false;
- // byte_5F33E4 = 1; // unused
- ChangeScreen(MENUPAGE_NONE, 0, false, false);
- pEditString = nil;
- m_bWaitingForNewKeyBind = false;
- }
-
- if (!m_bWantToRestart) {
- if (m_bGameNotLoaded)
- DMAudio.Service();
}
-}
-void
-CMenuManager::ProcessButtonPresses(void)
-{
if (pEditString || pControlEdit)
return;
@@ -3650,7 +3502,7 @@ CMenuManager::ProcessButtonPresses(void)
optionSelected = true;
}
#endif
- if (CPad::GetPad(0)->GetBackspaceJustDown() && m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS && !field_535) {
+ if (CPad::GetPad(0)->GetBackspaceJustDown() && m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS && !field_159) {
if (m_nCurrExLayer == HOVEROPTION_LIST) {
m_nHoverOption = HOVEROPTION_NOT_HOVERING;
m_bWaitingForNewKeyBind = true;
@@ -3659,7 +3511,7 @@ CMenuManager::ProcessButtonPresses(void)
pControlEdit = &m_KeyPressedCode;
}
} else {
- field_535 = false;
+ field_159 = false;
}
static uint32 lastTimeClickedScrollButton = 0;
@@ -4322,10 +4174,7 @@ CMenuManager::ProcessButtonPresses(void)
CWorld::Players[0].SetPlayerSkin(m_PrefsSkinFile);
SaveSettings();
} else {
- if (!m_bGameNotLoaded)
- ChangeScreen(aScreens[m_nCurrScreen].m_PreviousPage[1], aScreens[m_nCurrScreen].m_ParentEntry[1], true, true);
- else
- ChangeScreen(aScreens[m_nCurrScreen].m_PreviousPage[0], aScreens[m_nCurrScreen].m_ParentEntry[0], true, true);
+ SwitchToNewScreen(-2);
}
} else if (m_nCurrScreen != MENUPAGE_MULTIPLAYER_FIND_GAME) {
option = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action;
@@ -4425,11 +4274,7 @@ CMenuManager::ProcessButtonPresses(void)
if (changeMenu) {
if (strncmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEDS_TB", 8) == 0) {
#ifndef TIDY_UP_PBP
- ResetHelperText();
- if (!m_bGameNotLoaded)
- ChangeScreen(aScreens[m_nCurrScreen].m_PreviousPage[1], aScreens[m_nCurrScreen].m_ParentEntry[1], true, true);
- else
- ChangeScreen(aScreens[m_nCurrScreen].m_PreviousPage[0], aScreens[m_nCurrScreen].m_ParentEntry[0], true, true);
+ RequestFrontEndShutDown();
#else
goBack = true;
break;
@@ -4441,7 +4286,7 @@ CMenuManager::ProcessButtonPresses(void)
}
#endif
- ChangeScreen(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, 0, true, true);
+ SwitchToNewScreen(0);
}
}
break;
@@ -4453,7 +4298,7 @@ CMenuManager::ProcessButtonPresses(void)
if (saveSlot >= 2 && saveSlot <= 9) {
m_nCurrSaveSlot = saveSlot - 2;
if (Slots[m_nCurrSaveSlot + 1] != SLOT_EMPTY && Slots[m_nCurrSaveSlot + 1] != SLOT_CORRUPTED) {
- ChangeScreen(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, 0, true, true);
+ SwitchToNewScreen(0);
}
}
break;
@@ -4475,32 +4320,8 @@ CMenuManager::ProcessButtonPresses(void)
case MENUACTION_RESUME_FROM_SAVEZONE:
RequestFrontEndShutDown();
break;
- case MENUACTION_MPMAP_LIBERTY:
- case MENUACTION_MPMAP_REDLIGHT:
- case MENUACTION_MPMAP_CHINATOWN:
- case MENUACTION_MPMAP_TOWER:
- case MENUACTION_MPMAP_SEWER:
- case MENUACTION_MPMAP_INDUSTPARK:
- case MENUACTION_MPMAP_DOCKS:
- case MENUACTION_MPMAP_STAUNTON:
- m_SelectedMap = option - MENUACTION_MPMAP_LIBERTY;
- SaveSettings();
- ChangeScreen(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, 0, true, true);
- break;
- case MENUACTION_MPMAP_DEATHMATCH1:
- case MENUACTION_MPMAP_DEATHMATCH2:
- case MENUACTION_MPMAP_TEAMDEATH1:
- case MENUACTION_MPMAP_TEAMDEATH2:
- case MENUACTION_MPMAP_STASH:
- case MENUACTION_MPMAP_CAPTURE:
- case MENUACTION_MPMAP_RATRACE:
- case MENUACTION_MPMAP_DOMINATION:
- m_SelectedGameType = option - MENUACTION_MPMAP_DEATHMATCH1;
- SaveSettings();
- ChangeScreen(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, 0, true, true);
- break;
case MENUACTION_REDEFCTRL:
- ChangeScreen(MENUPAGE_KEYBOARD_CONTROLS, 0, true, true);
+ SwitchToNewScreen(MENUPAGE_KEYBOARD_CONTROLS);
m_nSelectedListRow = 0;
m_nCurrExLayer = HOVEROPTION_LIST;
break;
@@ -4526,13 +4347,19 @@ CMenuManager::ProcessButtonPresses(void)
#endif
break;
case MENUACTION_DONTCANCEL:
- ChangeScreen(aScreens[m_nCurrScreen].m_PreviousPage[1], aScreens[m_nCurrScreen].m_ParentEntry[1], true, true);
+ SwitchToNewScreen(-2);
break;
case MENUACTION_SCREENRES:
if (m_nDisplayVideoMode != m_nPrefsVideoMode) {
m_nPrefsVideoMode = m_nDisplayVideoMode;
_psSelectScreenVM(m_nPrefsVideoMode);
- SetHelperText(0);
+ SetHelperText(0); // TODO(Miami): Remove that
+ DMAudio.ChangeMusicMode(MUSICMODE_FRONTEND);
+ DMAudio.Service();
+ CentreMousePointer();
+ m_bShowMouse = true;
+ // m_nCurrOption = 5; // Why?
+ bOptionHighlightTransitionBlend = 0;
SaveSettings();
}
break;
@@ -4549,7 +4376,7 @@ CMenuManager::ProcessButtonPresses(void)
case MENUACTION_AUDIOHW:
{
int selectedProvider = m_nPrefsAudio3DProviderIndex;
- if (selectedProvider != -1) {
+ if (selectedProvider != INVALID_AUDIO_PROVIDER) {
m_nPrefsAudio3DProviderIndex = DMAudio.SetCurrent3DProvider(m_nPrefsAudio3DProviderIndex);
if (selectedProvider == m_nPrefsAudio3DProviderIndex) {
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
@@ -4564,7 +4391,7 @@ CMenuManager::ProcessButtonPresses(void)
}
case MENUACTION_SPEAKERCONF:
#ifndef TIDY_UP_PBP
- if (m_nPrefsAudio3DProviderIndex != -1) {
+ if (m_nPrefsAudio3DProviderIndex != INVALID_AUDIO_PROVIDER) {
if (--m_PrefsSpeakers < 0)
m_PrefsSpeakers = 2;
DMAudio.SetSpeakerConfig(m_PrefsSpeakers);
@@ -4576,7 +4403,7 @@ CMenuManager::ProcessButtonPresses(void)
break;
case MENUACTION_PLAYERSETUP:
CPlayerSkin::BeginFrontendSkinEdit();
- ChangeScreen(MENUPAGE_SKIN_SELECT, 0, true, true);
+ SwitchToNewScreen(MENUPAGE_SKIN_SELECT);
m_nCurrExLayer = HOVEROPTION_LIST;
m_bSkinsEnumerated = false;
break;
@@ -4657,7 +4484,7 @@ CMenuManager::ProcessButtonPresses(void)
#endif
break;
case MENUACTION_LOADRADIO:
- ChangeScreen(MENUPAGE_SOUND_SETTINGS, 0, true, true);
+ SwitchToNewScreen(MENUPAGE_SOUND_SETTINGS);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
OutputDebugString("STARTED PLAYING FRONTEND AUDIO TRACK");
break;
@@ -4674,7 +4501,7 @@ CMenuManager::ProcessButtonPresses(void)
#else
if (m_nCurrScreen == MENUPAGE_PAUSE_MENU) {
#endif
- if (!m_bGameNotLoaded && !m_bMenuStateChanged) {
+ if (!m_bGameNotLoaded) {
if (m_PrefsVsyncDisp != m_PrefsVsync) {
m_PrefsVsync = m_PrefsVsyncDisp;
}
@@ -4702,7 +4529,6 @@ CMenuManager::ProcessButtonPresses(void)
#endif
int oldScreen = !m_bGameNotLoaded ? aScreens[m_nCurrScreen].m_PreviousPage[1] : aScreens[m_nCurrScreen].m_PreviousPage[0];
- int oldOption = !m_bGameNotLoaded ? aScreens[m_nCurrScreen].m_ParentEntry[1] : aScreens[m_nCurrScreen].m_ParentEntry[0];
if (oldScreen != -1) {
ThingsToDoBeforeLeavingPage();
@@ -4714,7 +4540,7 @@ CMenuManager::ProcessButtonPresses(void)
} else
#endif
{
- ChangeScreen(oldScreen, oldOption, true, true);
+ SwitchToNewScreen(-2);
}
// We will go back for sure at this point, why process other things?!
@@ -4841,14 +4667,14 @@ CMenuManager::ProcessButtonPresses(void)
break;
#endif
case MENUACTION_AUDIOHW:
- if (m_nPrefsAudio3DProviderIndex != -1) {
+ if (m_nPrefsAudio3DProviderIndex != INVALID_AUDIO_PROVIDER) {
m_nPrefsAudio3DProviderIndex += changeValueBy;
m_nPrefsAudio3DProviderIndex = clamp(m_nPrefsAudio3DProviderIndex, 0, DMAudio.GetNum3DProvidersAvailable() - 1);
}
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
break;
case MENUACTION_SPEAKERCONF:
- if (m_nPrefsAudio3DProviderIndex != -1) {
+ if (m_nPrefsAudio3DProviderIndex != INVALID_AUDIO_PROVIDER) {
m_PrefsSpeakers -= changeValueBy;
m_PrefsSpeakers = clamp(m_PrefsSpeakers, 0, 2);
DMAudio.SetSpeakerConfig(m_PrefsSpeakers);
@@ -4881,11 +4707,6 @@ CMenuManager::ProcessOnOffMenuOptions()
switch (aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action) {
case MENUACTION_CTRLVIBRATION:
m_PrefsUseVibration = !m_PrefsUseVibration;
-
- if (m_PrefsUseVibration) {
- CPad::GetPad(0)->StartShake(350, 150);
- TimeToStopPadShaking = CTimer::GetTimeInMillisecondsPauseMode() + 500;
- }
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
break;
case MENUACTION_CTRLCONFIG:
@@ -4894,10 +4715,6 @@ CMenuManager::ProcessOnOffMenuOptions()
CPad::GetPad(0)->Mode = 0;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
break;
- case MENUACTION_CTRLDISPLAY:
- m_DisplayControllerOnFoot = !m_DisplayControllerOnFoot;
- DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
- break;
case MENUACTION_FRAMESYNC:
m_PrefsVsyncDisp = !m_PrefsVsyncDisp;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
@@ -4949,11 +4766,6 @@ CMenuManager::ProcessOnOffMenuOptions()
gbShowCollisionPolys = !gbShowCollisionPolys;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
break;
- case MENUACTION_MP_PLAYERCOLOR:
- PickNewPlayerColour();
- DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
- SaveSettings();
- break;
case MENUACTION_SHOWHEADBOB:
TheCamera.m_bHeadBob = !TheCamera.m_bHeadBob;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
@@ -4975,6 +4787,13 @@ CMenuManager::ProcessOnOffMenuOptions()
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
SaveSettings();
break;
+#ifdef FREE_CAM
+ case MENUACTION_FREECAM:
+ TheCamera.bFreeCam = !TheCamera.bFreeCam;
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
+ SaveSettings();
+ break;
+#endif
}
}
@@ -4982,7 +4801,6 @@ void
CMenuManager::RequestFrontEndShutDown()
{
m_bShutDownFrontEndRequested = true;
- DMAudio.ChangeMusicMode(MUSICMODE_GAME);
}
void
@@ -5005,20 +4823,20 @@ CMenuManager::SaveLoadFileError_SetUpErrorScreen()
case SAVESTATUS_ERR_SAVE_CREATE:
case SAVESTATUS_ERR_SAVE_WRITE:
case SAVESTATUS_ERR_SAVE_CLOSE:
- ChangeScreen(MENUPAGE_SAVE_FAILED, 0, true, false);
+ SwitchToNewScreen(MENUPAGE_SAVE_FAILED);
break;
case SAVESTATUS_ERR_LOAD_OPEN:
case SAVESTATUS_ERR_LOAD_READ:
case SAVESTATUS_ERR_LOAD_CLOSE:
- ChangeScreen(MENUPAGE_LOAD_FAILED, 0, true, false);
+ SwitchToNewScreen(MENUPAGE_LOAD_FAILED);
break;
case SAVESTATUS_ERR_DATA_INVALID:
- ChangeScreen(MENUPAGE_LOAD_FAILED_2, 0, true, false);
+ SwitchToNewScreen(MENUPAGE_LOAD_FAILED_2);
break;
case SAVESTATUS_DELETEFAILED8:
case SAVESTATUS_DELETEFAILED9:
case SAVESTATUS_DELETEFAILED10:
- ChangeScreen(MENUPAGE_DELETE_FAILED, 0, true, false);
+ SwitchToNewScreen(MENUPAGE_DELETE_FAILED);
break;
default: break;
}
@@ -5031,13 +4849,6 @@ CMenuManager::SetHelperText(int text)
m_nHelperTextAlpha = 300;
}
-void
-CMenuManager::ShutdownJustMenu()
-{
- m_bMenuActive = false;
- CTimer::EndUserPause();
-}
-
float
CMenuManager::StretchX(float x)
{
@@ -5058,80 +4869,131 @@ float CMenuManager::StretchY(float y)
}
void
+CMenuManager::ProcessFileActions()
+{
+ if (m_nCurrScreen == MENUPAGE_DELETING) {
+ bool SlotPopulated = false;
+
+ if (PcSaveHelper.DeleteSlot(m_nCurrSaveSlot)) {
+ PcSaveHelper.PopulateSlotInfo();
+ SlotPopulated = true;
+ }
+
+ if (SlotPopulated)
+ SwitchToNewScreen(MENUPAGE_DELETE_SUCCESS);
+ else
+ SaveLoadFileError_SetUpErrorScreen();
+ }
+ if (m_nCurrScreen == MENUPAGE_SAVING_IN_PROGRESS) {
+ int8 SaveSlot = PcSaveHelper.SaveSlot(m_nCurrSaveSlot);
+ PcSaveHelper.PopulateSlotInfo();
+ if (SaveSlot)
+ SwitchToNewScreen(MENUPAGE_SAVE_SUCCESSFUL);
+ else
+ SaveLoadFileError_SetUpErrorScreen();
+ }
+ if (m_nCurrScreen == MENUPAGE_LOADING_IN_PROGRESS) {
+ if (CheckSlotDataValid(m_nCurrSaveSlot)) {
+ DoSettingsBeforeStartingAGame();
+ m_bWantToLoad = true;
+ }
+ else
+ SaveLoadFileError_SetUpErrorScreen();
+ }
+}
+
+// --MIAMI: Done except DxInput things, are they even needed?
+void
CMenuManager::SwitchMenuOnAndOff()
{
- bool menuWasActive = GetIsMenuActive();
+ if (!TheCamera.m_WideScreenOn) {
+
+ // Reminder: You need REGISTER_START_BUTTON defined to make it work.
+ if ((CPad::GetPad(0)->GetStartJustDown() || CPad::GetPad(0)->GetEscapeJustDown())
+ && (!m_bMenuActive || m_nCurrScreen == MENUPAGE_PAUSE_MENU || m_nCurrScreen == MENUPAGE_CHOOSE_SAVE_SLOT/* || m_nCurrScreen == 20 */) // TODO(Miami): What is screen 20?
+ || m_bShutDownFrontEndRequested || m_bStartUpFrontEndRequested) {
+
+ if (m_nCurrScreen != MENUPAGE_LOADING_IN_PROGRESS) {
+ DoRWStuffStartOfFrame(0, 0, 0, 0, 0, 0, 255);
+ DoRWStuffEndOfFrame();
+ DoRWStuffStartOfFrame(0, 0, 0, 0, 0, 0, 255);
+ DoRWStuffEndOfFrame();
+ }
- // Reminder: You need REGISTER_START_BUTTON defined to make it work.
- if (CPad::GetPad(0)->GetStartJustDown()
-#ifdef FIX_BUGS
- && !m_bGameNotLoaded
-#endif
- || m_bShutDownFrontEndRequested || m_bStartUpFrontEndRequested) {
+ if (m_bShutDownFrontEndRequested)
+ m_bMenuActive = false;
+ else if (m_bStartUpFrontEndRequested)
+ m_bMenuActive = true;
+ else
+ m_bMenuActive = !m_bMenuActive;
- m_bMenuActive = !m_bMenuActive;
+ if (m_bMenuActive) {
+ Initialise();
+ LoadAllTextures();
+
+ // TODO(Miami): DxInput??
+ } else {
+ if (CMBlur::BlurOn)
+ CMBlur::MotionBlurOpen(Scene.camera);
+ else
+ CMBlur::MotionBlurClose();
+ DoRWStuffStartOfFrame(0, 0, 0, 0, 0, 0, 255);
+ DoRWStuffEndOfFrame();
+ DoRWStuffStartOfFrame(0, 0, 0, 0, 0, 0, 255);
+ DoRWStuffEndOfFrame();
- if (m_bShutDownFrontEndRequested)
- m_bMenuActive = false;
- if (m_bStartUpFrontEndRequested)
- m_bMenuActive = true;
+ // TODO(Miami): DxInput??
- if (m_bMenuActive) {
- CTimer::StartUserPause();
- } else {
#ifdef PS2_LIKE_MENU
- bottomBarActive = false;
-#endif
-#ifdef FIX_BUGS
- ThingsToDoBeforeLeavingPage();
+ bottomBarActive = false;
#endif
- ShutdownJustMenu();
- SaveSettings();
- m_bStartUpFrontEndRequested = false;
- pControlEdit = nil;
- m_bShutDownFrontEndRequested = false;
- DisplayComboButtonErrMsg = false;
+
+ m_StatsScrollSpeed = 150.0f;
+ SaveSettings();
+ pControlEdit = nil;
+ pEditString = nil;
+ DisplayComboButtonErrMsg = false;
+ m_bShutDownFrontEndRequested = false;
+ m_bStartUpFrontEndRequested = false;
+ m_bWaitingForNewKeyBind = false;
#ifdef REGISTER_START_BUTTON
- int16 start1 = CPad::GetPad(0)->PCTempJoyState.Start, start2 = CPad::GetPad(0)->PCTempKeyState.Start,
- start3 = CPad::GetPad(0)->OldState.Start, start4 = CPad::GetPad(0)->NewState.Start;
+ int16 start1 = CPad::GetPad(0)->PCTempJoyState.Start, start2 = CPad::GetPad(0)->PCTempKeyState.Start,
+ start3 = CPad::GetPad(0)->OldState.Start, start4 = CPad::GetPad(0)->NewState.Start;
#endif
- CPad::GetPad(0)->Clear(false);
- CPad::GetPad(1)->Clear(false);
+ CPad::GetPad(0)->Clear(false);
+ CPad::GetPad(1)->Clear(false);
#ifdef REGISTER_START_BUTTON
- CPad::GetPad(0)->PCTempJoyState.Start = start1;
- CPad::GetPad(0)->PCTempKeyState.Start = start2;
- CPad::GetPad(0)->OldState.Start = start3;
- CPad::GetPad(0)->NewState.Start = start4;
+ CPad::GetPad(0)->PCTempJoyState.Start = start1;
+ CPad::GetPad(0)->PCTempKeyState.Start = start2;
+ CPad::GetPad(0)->OldState.Start = start3;
+ CPad::GetPad(0)->NewState.Start = start4;
#endif
- m_nCurrScreen = MENUPAGE_NONE;
+ UnloadTextures();
+ CTimer::EndUserPause();
+ CTimer::Update();
+ m_OnlySaveMenu = false;
+ }
}
}
// Just entered the save/safe zone
- if (m_bSaveMenuActive && !m_bQuitGameNoCD) {
- m_bSaveMenuActive = false;
+ if (m_bActivateSaveMenu) {
+ DoRWStuffStartOfFrame(0, 0, 0, 0, 0, 0, 255);
+ DoRWStuffEndOfFrame();
+ DoRWStuffStartOfFrame(0, 0, 0, 0, 0, 0, 255);
+ DoRWStuffEndOfFrame();
+ m_bActivateSaveMenu = false;
m_bMenuActive = true;
- CTimer::StartUserPause();
-#ifdef PS2_SAVE_DIALOG
- m_nCurrScreen = MENUPAGE_SAVE;
- m_bRenderGameInMenu = true;
-#else
+ m_OnlySaveMenu = true;
+
+ // TODO(Miami): DxInput??
+
+ Initialise();
+ LoadAllTextures();
m_nCurrScreen = MENUPAGE_CHOOSE_SAVE_SLOT;
-#endif
- PcSaveHelper.PopulateSlotInfo();
m_nCurrOption = 0;
}
-/* // PS2 leftover
- if (m_nCurrScreen != MENUPAGE_SOUND_SETTINGS && gMusicPlaying)
- {
- DMAudio.StopFrontEndTrack();
- OutputDebugString("FRONTEND AUDIO TRACK STOPPED");
- gMusicPlaying = 0;
- }
-*/
- if (m_bMenuActive != menuWasActive)
- m_bMenuStateChanged = true;
m_bStartUpFrontEndRequested = false;
m_bShutDownFrontEndRequested = false;
@@ -5140,27 +5002,31 @@ CMenuManager::SwitchMenuOnAndOff()
void
CMenuManager::UnloadTextures()
{
- if (!m_bSpritesLoaded)
- return;
+ if (m_nCurrScreen == MENUPAGE_SOUND_SETTINGS)
+ DMAudio.StopFrontEndTrack();
+
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_STARTING, 0);
+ DMAudio.ChangeMusicMode(MUSICMODE_GAME);
+ if (m_bSpritesLoaded) {
+ printf("REMOVE frontend\n");
+ int frontend = CTxdStore::FindTxdSlot("frontend1");
+ for (int i = 0; i < 3; ++i)
+ m_aFrontEndSprites[i].Delete();
- printf("REMOVE frontend\n");
- for (int i = 0; i < ARRAY_SIZE(FrontendFilenames); ++i)
- m_aFrontEndSprites[i].Delete();
+ CTxdStore::RemoveTxd(frontend);
- int frontend = CTxdStore::FindTxdSlot("frontend");
- CTxdStore::RemoveTxd(frontend);
+ if (!m_OnlySaveMenu) {
+ int frontend2 = CTxdStore::FindTxdSlot("frontend2");
+ for (int i = 3; i < NUM_MENU_SPRITES; ++i)
+ m_aFrontEndSprites[i].Delete();
- printf("REMOVE menu textures\n");
- for (int i = 0; i < ARRAY_SIZE(MenuFilenames); ++i)
- m_aMenuSprites[i].Delete();
-#ifdef MENU_MAP
- for (int i = 0; i < ARRAY_SIZE(MapFilenames); ++i)
- m_aMapSprites[i].Delete();
-#endif
- int menu = CTxdStore::FindTxdSlot("menu");
- CTxdStore::RemoveTxd(menu);
+ CTxdStore::RemoveTxd(frontend2);
+ }
- m_bSpritesLoaded = false;
+ m_bSpritesLoaded = false;
+ }
+ m_OnlySaveMenu = false;
+ // TODO(Miami): Place name thing
}
void
@@ -5191,274 +5057,53 @@ CMenuManager::WaitForUserCD()
}
}
-void
-CMenuManager::PrintController(void)
-{
- // FIX: Originally this function doesn't have StretchX/Y, everything had constant pixel size (due to screen was abandoned early?)
- // Also texts and their alignment were very bad, so I tried to make them readable (commented out the original code, and marked the ones I added with X)
-
- m_aFrontEndSprites[FE_CONTROLLERSH].Draw(MENU_X_LEFT_ALIGNED(160.0f), MENU_Y(160.0f), MENU_X(240.0f), MENU_Y(180.0f), CRGBA(0, 0, 0, 255));
- m_aFrontEndSprites[FE_CONTROLLER].Draw(MENU_X_LEFT_ALIGNED(160.0f), MENU_Y(160.0f), MENU_X(235.2f), MENU_Y(175.2f), CRGBA(255, 255, 255, 255));
- if (m_DisplayControllerOnFoot) {
- if (CTimer::GetTimeInMillisecondsPauseMode() & 0x400)
- m_aFrontEndSprites[FE_ARROWS1].Draw(MENU_X_LEFT_ALIGNED(160.0f), MENU_Y(160.0f), MENU_X(235.2f), MENU_Y(175.2f), CRGBA(255, 255, 255, 255));
- else
- m_aFrontEndSprites[FE_ARROWS3].Draw(MENU_X_LEFT_ALIGNED(160.0f), MENU_Y(160.0f), MENU_X(235.2f), MENU_Y(175.2f), CRGBA(255, 255, 255, 255));
- } else {
- if (CTimer::GetTimeInMillisecondsPauseMode() & 0x400)
- m_aFrontEndSprites[FE_ARROWS2].Draw(MENU_X_LEFT_ALIGNED(160.0f), MENU_Y(160.0f), MENU_X(235.2f), MENU_Y(175.2f), CRGBA(255, 255, 255, 255));
- else
- m_aFrontEndSprites[FE_ARROWS4].Draw(MENU_X_LEFT_ALIGNED(160.0f), MENU_Y(160.0f), MENU_X(235.2f), MENU_Y(175.2f), CRGBA(255, 255, 255, 255));
- }
-
- CFont::SetFontStyle(FONT_LOCALE(FONT_BANK)); // X
-
- // CFont::SetScale(0.4f, 0.4f);
- CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE), MENU_Y(SMALLESTTEXT_Y_SCALE)); // X
-
- // CFont::SetColor(CRGBA(128, 128, 128, FadeIn(255)));
- CFont::SetDropColor(CRGBA(0, 0, 0, FadeIn(255))); // X
- CFont::SetDropShadowPosition(1); // X
- CFont::SetColor(CRGBA(255, 255, 255, FadeIn(255))); // X
-
- if (m_DisplayControllerOnFoot) {
- switch (CPad::GetPad(0)->Mode) {
- case 0:
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_CWL"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_LOF"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_MOV"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_MOV"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_CAM"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_PAU"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_CWR"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_JUM"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_ENV"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_ATT"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_RUN"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
- break;
- case 1:
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_CWL"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_LOF"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_CAM"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_MOV"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_NA"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_PAU"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_CWR"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_JUM"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_ENV"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_ATT"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_RUN"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
- break;
- case 2:
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_CWL"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_ENV"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_MOV"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_MOV"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_CAM"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_PAU"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_CWR"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_JUM"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_LOF"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_RUN"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_ATT"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
- break;
- case 3:
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_CWL"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_NA"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_MOV"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_CAM"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_PAU"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_CWR"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_JUM"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_LOF"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_RUN"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_ATT"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
- break;
- default:
- return;
- }
- } else {
- switch (CPad::GetPad(0)->Mode) {
- case 0:
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_LL"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_RSC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_VES"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_VES"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_HO3"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_CAM"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_PAU"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_LB"));
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_LR"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_HAB"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_BRA"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_EXV"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_CAW"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_ACC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_TUC"));
- // FIX: Coordinates of this line is undefined in PC...
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(304.0f), TheText.Get("FEC_SM3"));
- break;
- case 1:
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_LL"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_HOR"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_CAM"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_VES"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_NA"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_RSC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_PAU"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_LB"));
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_LR"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_HAB"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_BRA"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_EXV"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_CAW"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_ACC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_TUC"));
- // FIX: Coordinates of this line is undefined in PC...
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(304.0f), TheText.Get("FEC_SM3"));
- break;
- case 2:
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_LL"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_EXV"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_VES"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_VES"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_RS3"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_CAM"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_PAU"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_LB"));
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_LR"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_HOR"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_BRA"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_HAB"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_CAW"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_ACC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_TUC"));
- // FIX: Coordinates of this line is undefined in PC...
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(304.0f), TheText.Get("FEC_SM3"));
- break;
- case 3:
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_LL"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_HAB"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_TUC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_VES"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_HO3"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_CAM"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_PAU"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_LB"));
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_LR"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_CAW"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_SMT"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_EXV"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_RSC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_NA"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_ACC"));
- // FIX: Coordinates of this line is undefined in PC...
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(304.0f), TheText.Get("FEC_BRA"));
- break;
- default:
- return;
- }
- }
-
- CFont::SetDropShadowPosition(0); // X
-}
-
#ifdef MENU_MAP
#define ZOOM(x, y, in) \
do { \
- if(fMapSize > SCREEN_HEIGHT * 3.0f && in) \
+ if(m_fMapSize > SCREEN_HEIGHT * 3.0f && in) \
break; \
float z2 = in? 1.1f : 1.f/1.1f; \
- fMapCenterX += (x - fMapCenterX) * (1.0f - z2); \
- fMapCenterY += (y - fMapCenterY) * (1.0f - z2); \
+ m_fMapCenterX += (x - m_fMapCenterX) * (1.0f - z2); \
+ m_fMapCenterY += (y - m_fMapCenterY) * (1.0f - z2); \
\
- if (fMapSize < SCREEN_HEIGHT / 2 && !in) \
+ if (m_fMapSize < SCREEN_HEIGHT / 2 && !in) \
break; \
\
- fMapSize *= z2; \
+ m_fMapSize *= z2; \
} while(0) \
void
CMenuManager::PrintMap(void)
{
CFont::SetJustifyOn();
- bMenuMapActive = true;
+ m_bMenuMapActive = true;
CRadar::InitFrontEndMap();
// Just entered to map
if (!bMapLoaded) {
- fMapSize = SCREEN_HEIGHT * 2.0f;
- fMapCenterX = 0.0f;
- fMapCenterY = 0.0f;
+ m_fMapSize = SCREEN_HEIGHT * 2.0f;
+ m_fMapCenterX = 0.0f;
+ m_fMapCenterY = 0.0f;
CVector2D radarSpacePlayer;
CVector2D screenSpacePlayer;
CRadar::TransformRealWorldPointToRadarSpace(radarSpacePlayer, CVector2D(FindPlayerCoors()));
CRadar::TransformRadarPointToScreenSpace(screenSpacePlayer, radarSpacePlayer);
- fMapCenterX = (-screenSpacePlayer.x) + SCREEN_WIDTH / 2;
- fMapCenterY = (-screenSpacePlayer.y) + SCREEN_HEIGHT / 2;
+ m_fMapCenterX = (-screenSpacePlayer.x) + SCREEN_WIDTH / 2;
+ m_fMapCenterY = (-screenSpacePlayer.y) + SCREEN_HEIGHT / 2;
bMapMouseShownOnce = false;
bMapLoaded = true;
// Let's wait for a frame to not toggle the waypoint
if (CPad::GetPad(0)->NewState.Cross) {
- bMenuMapActive = false;
+ m_bMenuMapActive = false;
return;
}
}
- // Because fMapSize is half of the map length, and map consists of 3x3 tiles.
- float halfTile = fMapSize / 3.0f;
+ // Because m_fMapSize is half of the map length, and map consists of 3x3 tiles.
+ float halfTile = m_fMapSize / 3.0f;
// Darken background a bit
CSprite2d::DrawRect(CRect(0, 0,
@@ -5467,49 +5112,49 @@ CMenuManager::PrintMap(void)
RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR);
- if (SCREEN_WIDTH >= fMapCenterX - fMapSize || SCREEN_HEIGHT >= fMapCenterY - fMapSize) {
- m_aMapSprites[MAPTOP1].Draw(CRect(fMapCenterX - fMapSize, fMapCenterY - fMapSize,
- fMapCenterX - halfTile, fMapCenterY - halfTile), CRGBA(255, 255, 255, FadeIn(255)));
+ if (SCREEN_WIDTH >= m_fMapCenterX - m_fMapSize || SCREEN_HEIGHT >= m_fMapCenterY - m_fMapSize) {
+ m_aFrontEndSprites[MENUSPRITE_MAPTOP01].Draw(CRect(m_fMapCenterX - m_fMapSize, m_fMapCenterY - m_fMapSize,
+ m_fMapCenterX - halfTile, m_fMapCenterY - halfTile), CRGBA(255, 255, 255, FadeIn(255)));
}
- if (SCREEN_WIDTH >= fMapCenterX - halfTile || SCREEN_HEIGHT >= fMapCenterY - fMapSize) {
- m_aMapSprites[MAPTOP2].Draw(CRect(fMapCenterX - halfTile, fMapCenterY - fMapSize,
- fMapCenterX + halfTile, fMapCenterY - halfTile), CRGBA(255, 255, 255, FadeIn(255)));
+ if (SCREEN_WIDTH >= m_fMapCenterX - halfTile || SCREEN_HEIGHT >= m_fMapCenterY - m_fMapSize) {
+ m_aFrontEndSprites[MENUSPRITE_MAPTOP02].Draw(CRect(m_fMapCenterX - halfTile, m_fMapCenterY - m_fMapSize,
+ m_fMapCenterX + halfTile, m_fMapCenterY - halfTile), CRGBA(255, 255, 255, FadeIn(255)));
}
- if (SCREEN_WIDTH >= fMapCenterX + halfTile || SCREEN_HEIGHT >= fMapCenterY - fMapSize) {
- m_aMapSprites[MAPTOP3].Draw(CRect(fMapCenterX + halfTile, fMapCenterY - fMapSize,
- fMapCenterX + fMapSize, fMapCenterY - halfTile), CRGBA(255, 255, 255, FadeIn(255)));
+ if (SCREEN_WIDTH >= m_fMapCenterX + halfTile || SCREEN_HEIGHT >= m_fMapCenterY - m_fMapSize) {
+ m_aFrontEndSprites[MENUSPRITE_MAPTOP03].Draw(CRect(m_fMapCenterX + halfTile, m_fMapCenterY - m_fMapSize,
+ m_fMapCenterX + m_fMapSize, m_fMapCenterY - halfTile), CRGBA(255, 255, 255, FadeIn(255)));
}
- if (SCREEN_WIDTH >= fMapCenterX - fMapSize || SCREEN_HEIGHT >= fMapCenterY - halfTile) {
- m_aMapSprites[MAPMID1].Draw(CRect(fMapCenterX - fMapSize, fMapCenterY - halfTile,
- fMapCenterX - halfTile, fMapCenterY + halfTile), CRGBA(255, 255, 255, FadeIn(255)));
+ if (SCREEN_WIDTH >= m_fMapCenterX - m_fMapSize || SCREEN_HEIGHT >= m_fMapCenterY - halfTile) {
+ m_aFrontEndSprites[MENUSPRITE_MAPMID01].Draw(CRect(m_fMapCenterX - m_fMapSize, m_fMapCenterY - halfTile,
+ m_fMapCenterX - halfTile, m_fMapCenterY + halfTile), CRGBA(255, 255, 255, FadeIn(255)));
}
- if (SCREEN_WIDTH >= fMapCenterX - halfTile || SCREEN_HEIGHT >= fMapCenterY - halfTile) {
- m_aMapSprites[MAPMID2].Draw(CRect(fMapCenterX - halfTile, fMapCenterY - halfTile,
- fMapCenterX + halfTile, fMapCenterY + halfTile), CRGBA(255, 255, 255, FadeIn(255)));
+ if (SCREEN_WIDTH >= m_fMapCenterX - halfTile || SCREEN_HEIGHT >= m_fMapCenterY - halfTile) {
+ m_aFrontEndSprites[MENUSPRITE_MAPMID02].Draw(CRect(m_fMapCenterX - halfTile, m_fMapCenterY - halfTile,
+ m_fMapCenterX + halfTile, m_fMapCenterY + halfTile), CRGBA(255, 255, 255, FadeIn(255)));
}
- if (SCREEN_WIDTH >= fMapCenterX + halfTile || SCREEN_HEIGHT >= fMapCenterY - halfTile) {
- m_aMapSprites[MAPMID3].Draw(CRect(fMapCenterX + halfTile, fMapCenterY - halfTile,
- fMapCenterX + fMapSize, fMapCenterY + halfTile), CRGBA(255, 255, 255, FadeIn(255)));
+ if (SCREEN_WIDTH >= m_fMapCenterX + halfTile || SCREEN_HEIGHT >= m_fMapCenterY - halfTile) {
+ m_aFrontEndSprites[MENUSPRITE_MAPMID03].Draw(CRect(m_fMapCenterX + halfTile, m_fMapCenterY - halfTile,
+ m_fMapCenterX + m_fMapSize, m_fMapCenterY + halfTile), CRGBA(255, 255, 255, FadeIn(255)));
}
- if (SCREEN_WIDTH >= fMapCenterX - fMapSize || SCREEN_HEIGHT >= fMapCenterY + halfTile) {
- m_aMapSprites[MAPBOT1].Draw(CRect(fMapCenterX - fMapSize, fMapCenterY + halfTile,
- fMapCenterX - halfTile, fMapCenterY + fMapSize), CRGBA(255, 255, 255, FadeIn(255)));
+ if (SCREEN_WIDTH >= m_fMapCenterX - m_fMapSize || SCREEN_HEIGHT >= m_fMapCenterY + halfTile) {
+ m_aFrontEndSprites[MENUSPRITE_MAPBOT01].Draw(CRect(m_fMapCenterX - m_fMapSize, m_fMapCenterY + halfTile,
+ m_fMapCenterX - halfTile, m_fMapCenterY + m_fMapSize), CRGBA(255, 255, 255, FadeIn(255)));
}
- if (SCREEN_WIDTH >= fMapCenterX - halfTile || SCREEN_HEIGHT >= fMapCenterY + halfTile) {
- m_aMapSprites[MAPBOT2].Draw(CRect(fMapCenterX - halfTile, fMapCenterY + halfTile,
- fMapCenterX + halfTile, fMapCenterY + fMapSize), CRGBA(255, 255, 255, FadeIn(255)));
+ if (SCREEN_WIDTH >= m_fMapCenterX - halfTile || SCREEN_HEIGHT >= m_fMapCenterY + halfTile) {
+ m_aFrontEndSprites[MENUSPRITE_MAPBOT02].Draw(CRect(m_fMapCenterX - halfTile, m_fMapCenterY + halfTile,
+ m_fMapCenterX + halfTile, m_fMapCenterY + m_fMapSize), CRGBA(255, 255, 255, FadeIn(255)));
}
- if (SCREEN_WIDTH >= fMapCenterX + halfTile || SCREEN_HEIGHT >= fMapCenterY + halfTile) {
- m_aMapSprites[MAPBOT3].Draw(CRect(fMapCenterX + halfTile, fMapCenterY + halfTile,
- fMapCenterX + fMapSize, fMapCenterY + fMapSize), CRGBA(255, 255, 255, FadeIn(255)));
+ if (SCREEN_WIDTH >= m_fMapCenterX + halfTile || SCREEN_HEIGHT >= m_fMapCenterY + halfTile) {
+ m_aFrontEndSprites[MENUSPRITE_MAPBOT03].Draw(CRect(m_fMapCenterX + halfTile, m_fMapCenterY + halfTile,
+ m_fMapCenterX + m_fMapSize, m_fMapCenterY + m_fMapSize), CRGBA(255, 255, 255, FadeIn(255)));
}
CRadar::DrawBlips();
@@ -5533,34 +5178,35 @@ CMenuManager::PrintMap(void)
CRGBA(0, 0, 0, 150));
if (CPad::GetPad(0)->GetRightMouseJustDown() || CPad::GetPad(0)->GetCrossJustDown()) {
- if (mapPoint.y > fMapCenterY - fMapSize && mapPoint.y < fMapCenterY + fMapSize &&
- mapPoint.x > fMapCenterX - fMapSize && mapPoint.x < fMapCenterX + fMapSize) {
+ if (mapPoint.y > m_fMapCenterY - m_fMapSize && mapPoint.y < m_fMapCenterY + m_fMapSize &&
+ mapPoint.x > m_fMapCenterX - m_fMapSize && mapPoint.x < m_fMapCenterX + m_fMapSize) {
- float diffX = fMapCenterX - fMapSize, diffY = fMapCenterY - fMapSize;
- float x = ((mapPoint.x - diffX) / (fMapSize * 2)) * 4000.0f - 2000.0f;
- float y = 2000.0f - ((mapPoint.y - diffY) / (fMapSize * 2)) * 4000.0f;
+ // Don't ask me the meanings, I don't know. Found them by trying
+ float diffX = m_fMapCenterX - m_fMapSize, diffY = m_fMapCenterY - m_fMapSize;
+ float x = ((mapPoint.x - diffX) / (m_fMapSize * 2)) * (WORLD_SIZE_X / MENU_MAP_WIDTH_SCALE) - (WORLD_SIZE_X / 2 + MENU_MAP_LEFT_OFFSET * MENU_MAP_LENGTH_UNIT);
+ float y = (WORLD_SIZE_Y / 2 - MENU_MAP_TOP_OFFSET * MENU_MAP_LENGTH_UNIT) - ((mapPoint.y - diffY) / (m_fMapSize * 2)) * (WORLD_SIZE_Y / MENU_MAP_HEIGHT_SCALE);
CRadar::ToggleTargetMarker(x, y);
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
}
}
if (CPad::GetPad(0)->GetLeftMouse()) {
- fMapCenterX += m_nMousePosX - m_nMouseOldPosX;
- fMapCenterY += m_nMousePosY - m_nMouseOldPosY;
+ m_fMapCenterX += m_nMousePosX - m_nMouseOldPosX;
+ m_fMapCenterY += m_nMousePosY - m_nMouseOldPosY;
} else if (CPad::GetPad(0)->GetLeft() || CPad::GetPad(0)->GetDPadLeft()) {
- fMapCenterX += 15.0f;
+ m_fMapCenterX += 15.0f;
} else if (CPad::GetPad(0)->GetRight() || CPad::GetPad(0)->GetDPadRight()) {
- fMapCenterX -= 15.0f;
+ m_fMapCenterX -= 15.0f;
} else if (CPad::GetPad(0)->GetLeftStickX()) {
- fMapCenterX -= CPad::GetPad(0)->GetLeftStickX() / 128.0f * 20.0f;
+ m_fMapCenterX -= CPad::GetPad(0)->GetLeftStickX() / 128.0f * 20.0f;
}
if (CPad::GetPad(0)->GetUp() || CPad::GetPad(0)->GetDPadUp()) {
- fMapCenterY += 15.0f;
+ m_fMapCenterY += 15.0f;
} else if (CPad::GetPad(0)->GetDown() || CPad::GetPad(0)->GetDPadDown()) {
- fMapCenterY -= 15.0f;
+ m_fMapCenterY -= 15.0f;
} else if (CPad::GetPad(0)->GetLeftStickY()) {
- fMapCenterY -= CPad::GetPad(0)->GetLeftStickY() / 128.0f * 20.0f;
+ m_fMapCenterY -= CPad::GetPad(0)->GetLeftStickY() / 128.0f * 20.0f;
}
if (CPad::GetPad(0)->GetMouseWheelDown() || CPad::GetPad(0)->GetPageDown() || CPad::GetPad(0)->GetRightShoulder2()) {
@@ -5575,25 +5221,26 @@ CMenuManager::PrintMap(void)
ZOOM(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, true);
}
- if (fMapCenterX - fMapSize > SCREEN_WIDTH / 2)
- fMapCenterX = fMapSize + SCREEN_WIDTH / 2;
+ if (m_fMapCenterX - m_fMapSize > SCREEN_WIDTH / 2)
+ m_fMapCenterX = m_fMapSize + SCREEN_WIDTH / 2;
- if (fMapCenterX + fMapSize < SCREEN_WIDTH / 2)
- fMapCenterX = SCREEN_WIDTH / 2 - fMapSize;
+ if (m_fMapCenterX + m_fMapSize < SCREEN_WIDTH / 2)
+ m_fMapCenterX = SCREEN_WIDTH / 2 - m_fMapSize;
- if (fMapCenterY + fMapSize < SCREEN_HEIGHT - MENU_Y(60.0f))
- fMapCenterY = SCREEN_HEIGHT - MENU_Y(60.0f) - fMapSize;
+ if (m_fMapCenterY + m_fMapSize < SCREEN_HEIGHT - MENU_Y(60.0f))
+ m_fMapCenterY = SCREEN_HEIGHT - MENU_Y(60.0f) - m_fMapSize;
- fMapCenterY = Min(fMapCenterY, fMapSize); // To not show beyond north border
+ if (m_fMapCenterY - m_fMapSize > SCREEN_HEIGHT / 2)
+ m_fMapCenterY = SCREEN_HEIGHT / 2 + m_fMapSize;
- bMenuMapActive = false;
+ m_bMenuMapActive = false;
// CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(5.0f)); // From VC
// CFont::SetRightJustifyWrap(10.0f);
CSprite2d::DrawRect(CRect(MENU_X(14.0f), SCREEN_STRETCH_FROM_BOTTOM(95.0f),
SCREEN_STRETCH_FROM_RIGHT(11.0f), SCREEN_STRETCH_FROM_BOTTOM(59.0f)),
- CRGBA(235, 170, 50, 255));
+ CRGBA(MAPINFOBOX_COLOR.r, MAPINFOBOX_COLOR.g, MAPINFOBOX_COLOR.b, MAPINFOBOX_COLOR.a));
CFont::SetScale(MENU_X(0.4f), MENU_Y(0.7f));
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
@@ -5654,9 +5301,7 @@ CMenuManager::ConstructStatLine(int rowIdx)
STAT_LINE("PL_STAT", nil, false, nil);
- int percentCompleted = (CStats::TotalProgressInGame == 0 ? 0 :
- CStats::ProgressMade * 100.0f / (CGame::nastyGame ? CStats::TotalProgressInGame : CStats::TotalProgressInGame - 1));
- percentCompleted = Min(percentCompleted, 100);
+ int percentCompleted = CStats::GetPercentageProgress();
STAT_LINE("PER_COM", &percentCompleted, false, nil);
STAT_LINE("NMISON", &CStats::MissionsGiven, false, nil);
diff --git a/src/core/Frontend.h b/src/core/Frontend.h
index 16da5cb1..e40efeea 100644
--- a/src/core/Frontend.h
+++ b/src/core/Frontend.h
@@ -7,8 +7,8 @@
#define MENUHEADER_POS_Y 75.0f
#define MENUHEADER_HEIGHT 1.3f
#else
-#define MENUHEADER_POS_X 35.0f
-#define MENUHEADER_POS_Y 93.0f
+#define MENUHEADER_POS_X 10.0f
+#define MENUHEADER_POS_Y 10.0f
#define MENUHEADER_HEIGHT 1.6f
#endif
#define MENUHEADER_WIDTH 0.84f
@@ -20,7 +20,7 @@
#define MENURADIO_ICON_SCALE 60.0f
-#define MENUSLIDER_X 256.0f
+#define MENUSLIDER_X 128.0f
#define MENUSLIDER_UNK 256.0f
#define BIGTEXT_X_SCALE 0.75f
@@ -95,62 +95,34 @@ enum eLanguages
#endif
};
-enum eFrontendSprites
-{
- FE2_MAINPANEL_UL,
- FE2_MAINPANEL_UR,
- FE2_MAINPANEL_DL,
- FE2_MAINPANEL_DR,
- FE2_MAINPANEL_DR2,
- FE2_TABACTIVE,
- FE_ICONBRIEF,
- FE_ICONSTATS,
- FE_ICONCONTROLS,
- FE_ICONSAVE,
- FE_ICONAUDIO,
- FE_ICONDISPLAY,
- FE_ICONLANGUAGE,
- FE_CONTROLLER,
- FE_CONTROLLERSH,
- FE_ARROWS1,
- FE_ARROWS2,
- FE_ARROWS3,
- FE_ARROWS4,
- FE_RADIO1,
- FE_RADIO2,
- FE_RADIO3,
- FE_RADIO4,
- FE_RADIO5,
- FE_RADIO6,
- FE_RADIO7,
- FE_RADIO8,
- FE_RADIO9,
-
- NUM_FE_SPRITES
-};
-
enum eMenuSprites
{
- MENUSPRITE_CONNECTION,
- MENUSPRITE_FINDGAME,
- MENUSPRITE_HOSTGAME,
- MENUSPRITE_MAINMENU,
- MENUSPRITE_PLAYERSET,
- MENUSPRITE_SINGLEPLAYER,
- MENUSPRITE_MULTIPLAYER,
- MENUSPRITE_DMALOGO,
- MENUSPRITE_GTALOGO,
- MENUSPRITE_RSTARLOGO,
- MENUSPRITE_GAMESPY,
+ MENUSPRITE_BACKGROUND,
+ MENUSPRITE_VCLOGO,
MENUSPRITE_MOUSE,
- MENUSPRITE_MOUSET,
- MENUSPRITE_MP3LOGO,
+ MENUSPRITE_MAPTOP01,
+ MENUSPRITE_MAPTOP02,
+ MENUSPRITE_MAPTOP03,
+ MENUSPRITE_MAPMID01,
+ MENUSPRITE_MAPMID02,
+ MENUSPRITE_MAPMID03,
+ MENUSPRITE_MAPBOT01,
+ MENUSPRITE_MAPBOT02,
+ MENUSPRITE_MAPBOT03,
+ MENUSPRITE_WILDSTYLE,
+ MENUSPRITE_FLASH,
+ MENUSPRITE_KCHAT,
+ MENUSPRITE_FEVER,
+ MENUSPRITE_VROCK,
+ MENUSPRITE_VCPR,
+ MENUSPRITE_ESPANTOSO,
+ MENUSPRITE_EMOTION,
+ MENUSPRITE_WAVE,
+ MENUSPRITE_MP3,
MENUSPRITE_DOWNOFF,
MENUSPRITE_DOWNON,
MENUSPRITE_UPOFF,
MENUSPRITE_UPON,
- MENUSPRITE_GTA3LOGO,
- MENUSPRITE_UNUSED,
NUM_MENU_SPRITES
};
@@ -169,22 +141,6 @@ enum eSaveSlot
SAVESLOT_LABEL = 36
};
-#ifdef MENU_MAP
-enum MapSprites
-{
- MAPMID1,
- MAPMID2,
- MAPMID3,
- MAPBOT1,
- MAPBOT2,
- MAPBOT3,
- MAPTOP1,
- MAPTOP2,
- MAPTOP3,
- NUM_MAP_SPRITES
-};
-#endif
-
enum eMenuScreen
{
MENUPAGE_DISABLED = -1,
@@ -372,7 +328,10 @@ enum eMenuAction
MENUACTION_LANG_JAP,
#endif
#ifdef IMPROVED_VIDEOMODE
- MENUACTION_SCREENMODE
+ MENUACTION_SCREENMODE,
+#endif
+#ifdef FREE_CAM
+ MENUACTION_FREECAM
#endif
};
@@ -472,69 +431,195 @@ struct CMenuScreen
} m_aEntries[NUM_MENUROWS];
};
+struct MenuTrapezoid
+{
+ float topLeft_x;
+ float topLeft_y;
+ float topRight_x;
+ float topRight_y;
+ float bottomLeft_x;
+ float bottomLeft_y;
+ float bottomRight_x;
+ float bottomRight_y;
+ float old_topRight_x;
+ float old_topRight_y;
+ float old_topLeft_x;
+ float old_topLeft_y;
+ float old_bottomLeft_x;
+ float old_bottomLeft_y;
+ float old_bottomRight_x;
+ float old_bottomRight_y;
+ float mult_topRight_x;
+ float mult_topRight_y;
+ float mult_topLeft_x;
+ float mult_topLeft_y;
+ float mult_bottomLeft_x;
+ float mult_bottomLeft_y;
+ float mult_bottomRight_x;
+ float mult_bottomRight_y;
+
+ MenuTrapezoid(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) {
+ topLeft_x = x1;
+ topLeft_y = y1;
+ topRight_x = x2;
+ topRight_y = y2;
+ bottomLeft_x = x3;
+ bottomLeft_y = y3;
+ bottomRight_x = x4;
+ bottomRight_y = y4;
+ };
+
+ void SaveCurrentCoors() {
+ old_topLeft_x = topLeft_x;
+ old_topLeft_y = topLeft_y;
+ old_topRight_x = topRight_x;
+ old_topRight_y = topRight_y;
+ old_bottomLeft_x = bottomLeft_x;
+ old_bottomLeft_y = bottomLeft_y;
+ old_bottomRight_x = bottomRight_x;
+ old_bottomRight_y = bottomRight_y;
+ }
+
+ void Translate(int delta) {
+ bottomRight_x = delta * mult_bottomRight_x + old_bottomRight_x;
+ bottomRight_y = delta * mult_bottomRight_y + old_bottomRight_y;
+ bottomLeft_x = delta * mult_bottomLeft_x + old_bottomLeft_x;
+ bottomLeft_y = delta * mult_bottomLeft_y + old_bottomLeft_y;
+ topRight_x = delta * mult_topRight_x + old_topRight_x;
+ topRight_y = delta * mult_topRight_y + old_topRight_y;
+ topLeft_x = delta * mult_topLeft_x + old_topLeft_x;
+ topLeft_y = delta * mult_topLeft_y + old_topLeft_y;
+ }
+
+ void UpdateMultipliers() {
+ mult_bottomRight_x = (bottomRight_x - old_bottomRight_x) / 255.0f;
+ mult_bottomRight_y = (bottomRight_y - old_bottomRight_y) / 255.0f;
+ mult_bottomLeft_x = (bottomLeft_x - old_bottomLeft_x) / 255.0f;
+ mult_bottomLeft_y = (bottomLeft_y - old_bottomLeft_y) / 255.0f;
+ mult_topRight_x = (topRight_x - old_topRight_x) / 255.0f;
+ mult_topRight_y = (topRight_y - old_topRight_y) / 255.0f;
+ mult_topLeft_x = (topLeft_x - old_topLeft_x) / 255.0f;
+ mult_topLeft_y = (topLeft_y - old_topLeft_y) / 255.0f;
+ }
+};
+
class CMenuManager
{
public:
- int32 m_nPrefsVideoMode;
- int32 m_nDisplayVideoMode;
+ int8 m_StatsScrollDirection;
+ float m_StatsScrollSpeed;
+ uint8 field_8;
+ bool m_PrefsUseVibration;
+ bool m_PrefsShowHud;
+ int32 m_PrefsRadarMode;
+ uint8 field_10;
+ bool m_bShutDownFrontEndRequested;
+ bool m_bStartUpFrontEndRequested;
+ int32 m_KeyPressedCode;
+ int32 m_PrefsBrightness;
+ float m_PrefsLOD;
+ int8 m_PrefsShowSubtitles;
+ int8 m_PrefsShowLegends;
+ int8 m_PrefsUseWideScreen;
+ int8 m_PrefsVsync; // TODO(Miami): Are we sure?
+ int8 m_PrefsVsyncDisp;
+ int8 m_PrefsFrameLimiter;
int8 m_nPrefsAudio3DProviderIndex;
- bool m_bKeyChangeNotProcessed;
- char m_aSkinName[256];
- int32 m_nHelperTextMsgId;
- bool m_bLanguageLoaded;
+ int8 m_PrefsSpeakers;
+ int8 m_PrefsDMA;
+ uint8 m_PrefsSfxVolume;
+ uint8 m_PrefsMusicVolume;
+ uint8 m_PrefsRadioStation;
+ uint8 field_2C;
+ int32 m_nCurrOption;
+ bool m_bQuitGameNoCD;
+ bool m_bMenuMapActive;
+ bool m_AllowNavigation;
+ uint8 field_37;
bool m_bMenuActive;
- bool m_bMenuStateChanged;
- bool m_bWaitingForNewKeyBind;
bool m_bWantToRestart;
bool m_bFirstTime;
- bool m_bGameNotLoaded;
- int32 m_nMousePosX;
- int32 m_nMousePosY;
+ bool m_bActivateSaveMenu;
+ bool m_bWantToLoad;
+ float m_fMapSize;
+ float m_fMapCenterX;
+ float m_fMapCenterY;
+ uint32 OS_Language;
+ int32 m_PrefsLanguage;
+ int32 field_54;
+ int8 m_bLanguageLoaded;
+ uint8 m_PrefsAllowNastyGame;
+ uint8 m_PrefsMP3BoostVolume;
+ uint8 m_ControlMethod;
+ int32 m_nPrefsVideoMode;
+ int32 m_nDisplayVideoMode;
int32 m_nMouseTempPosX;
int32 m_nMouseTempPosY;
- bool m_bShowMouse;
- tSkinInfo m_pSkinListHead;
- tSkinInfo *m_pSelectedSkin;
- int32 m_nFirstVisibleRowOnList;
- float m_nScrollbarTopMargin;
- int32 m_nTotalListRow;
- int32 m_nSkinsTotal;
- char _unk0[4];
- int32 m_nSelectedListRow;
- bool m_bSkinsEnumerated;
- bool m_bQuitGameNoCD;
- bool m_bRenderGameInMenu;
- bool m_bSaveMenuActive;
- bool m_bWantToLoad;
- char field_455;
- bool m_bStartWaitingForKeyBind;
+ bool m_bGameNotLoaded;
+ int8 m_lastWorking3DAudioProvider;
+ bool m_bFrontEnd_ReloadObrTxtGxt;
+ int32 *pEditString;
+ uint8 field_74[4];
+ int32 *pControlEdit;
+ bool m_OnlySaveMenu;
+ int32 m_menuTransitionProgress;
+ CSprite2d m_aFrontEndSprites[NUM_MENU_SPRITES];
bool m_bSpritesLoaded;
- CSprite2d m_aFrontEndSprites[NUM_FE_SPRITES];
- CSprite2d m_aMenuSprites[NUM_MENU_SPRITES];
- int32 field_518;
+ int32 field_F0;
+ int32 m_LastRadioScrollDir;
+ int32 m_nCurrScreen;
+ int32 m_nPrevScreen;
+ int32 m_nCurrSaveSlot;
+ int32 m_LastScreenSwitch;
int32 m_nMenuFadeAlpha;
+ int32 bOptionHighlightTransitionBlend;
+ bool bMenuChangeOngoing;
+ int32 MouseButtonJustClicked;
+ int32 JoyButtonJustClicked;
+ bool DisplayComboButtonErrMsg;
+ bool m_NoEmptyBinding;
+ bool m_ShowEmptyBindingError;
+ int32 m_nHelperTextAlpha;
bool m_bPressedPgUpOnList;
bool m_bPressedPgDnOnList;
bool m_bPressedUpOnList;
bool m_bPressedDownOnList;
bool m_bPressedScrollButton;
- int32 m_CurrCntrlAction;
- char _unk1[4];
- int32 m_nSelectedContSetupColumn;
- bool m_bKeyIsOK;
- bool field_535;
- int8 m_nCurrExLayer;
- int32 m_nHelperTextAlpha;
+ uint8 field_129;
+ uint8 field_12A;
+ uint8 field_12B;
+ int32 m_nMousePosX;
+ int32 m_nMousePosY;
int32 m_nMouseOldPosX;
int32 m_nMouseOldPosY;
int32 m_nHoverOption;
- int32 m_nCurrScreen;
- int32 m_nCurrOption;
+ bool m_bShowMouse;
int32 m_nPrevOption;
- int32 m_nPrevScreen;
- uint32 field_558;
- int32 m_nCurrSaveSlot;
- int32 m_nScreenChangeDelayTimer;
+ bool m_bStartWaitingForKeyBind;
+ bool m_bWaitingForNewKeyBind;
+ bool m_bKeyChangeNotProcessed;
+ int32 m_CurrCntrlAction;
+ uint8 field_150;
+ uint8 field_151;
+ uint8 field_152;
+ uint8 field_153;
+ int32 m_nSelectedContSetupColumn;
+ bool m_bKeyIsOK;
+ bool field_159;
+ uint8 m_nCurrExLayer;
+ char m_PrefsSkinFile[256];
+ char m_aSkinName[256];
+ uint8 field_35B;
+ int32 m_nHelperTextMsgId;
+ tSkinInfo m_pSkinListHead;
+ tSkinInfo *m_pSelectedSkin;
+ int32 m_nFirstVisibleRowOnList;
+ float m_nScrollbarTopMargin;
+ int32 m_nTotalListRow;
+ int32 m_nSkinsTotal;
+ uint8 field_67C[4];
+ int32 m_nSelectedListRow;
+ bool m_bSkinsEnumerated;
#ifdef IMPROVED_VIDEOMODE
int32 m_nPrefsWidth;
@@ -545,109 +630,66 @@ public:
int32 m_nSelectedScreenMode;
#endif
-public:
bool GetIsMenuActive() {return !!m_bMenuActive;}
-public:
- static int32 OS_Language;
- static int8 m_PrefsUseVibration;
- static int8 m_DisplayControllerOnFoot;
- static int8 m_PrefsUseWideScreen;
- static int8 m_PrefsRadioStation;
- static int8 m_PrefsVsync;
- static int8 m_PrefsVsyncDisp;
- static int8 m_PrefsFrameLimiter;
- static int8 m_PrefsShowSubtitles;
- static int8 m_PrefsSpeakers;
- static int32 m_ControlMethod;
- static int8 m_PrefsDMA;
- static int32 m_PrefsLanguage;
- static int32 m_PrefsBrightness;
- static float m_PrefsLOD;
- static int8 m_bFrontEnd_ReloadObrTxtGxt;
- static int32 m_PrefsMusicVolume;
- static int32 m_PrefsSfxVolume;
- static char m_PrefsSkinFile[256];
- static int32 m_KeyPressedCode;
-
- static bool m_bStartUpFrontEndRequested;
- static bool m_bShutDownFrontEndRequested;
- static bool m_PrefsAllowNastyGame;
-
static uint8 m_PrefsStereoMono;
- static int32 m_SelectedMap;
- static int32 m_SelectedGameType;
- static uint8 m_PrefsPlayerRed;
- static uint8 m_PrefsPlayerGreen;
- static uint8 m_PrefsPlayerBlue;
#ifndef MASTER
static bool m_PrefsMarketing;
static bool m_PrefsDisableTutorials;
#endif // !MASTER
-#ifdef MENU_MAP
- static bool bMenuMapActive;
- static bool bMapMouseShownOnce;
- static bool bMapLoaded;
- static float fMapSize;
- static float fMapCenterY;
- static float fMapCenterX;
- static CSprite2d m_aMapSprites[NUM_MAP_SPRITES];
+ CMenuManager(void);
+ ~CMenuManager(void) { UnloadTextures(); }
+
+ void Initialise();
void PrintMap();
-#endif
-
-public:
+ void SetFrontEndRenderStates();
static void BuildStatLine(Const char *text, void *stat, bool itsFloat, void *stat2);
static void CentreMousePointer();
void CheckCodesForControls(int);
bool CheckHover(int x1, int x2, int y1, int y2);
void CheckSliderMovement(int);
- int CostructStatLine(int);
void DisplayHelperText();
int DisplaySlider(float, float, float, float, float, float);
void DoSettingsBeforeStartingAGame();
- void Draw();
+ void DrawStandardMenus();
void DrawControllerBound(int32, int32, int32, int8);
void DrawControllerScreenExtraText(int, int, int);
void DrawControllerSetupScreen();
void DrawFrontEnd();
- void DrawFrontEndNormal();
-#ifdef PS2_SAVE_DIALOG
- void DrawFrontEndSaveZone();
-#endif
+ void DrawBackground(bool transitionCall);
void DrawPlayerSetupScreen();
int FadeIn(int alpha);
void FilterOutColorMarkersFromString(wchar*, CRGBA &);
int GetStartOptionsCntrlConfigScreens();
- static void InitialiseChangedLanguageSettings();
+ void InitialiseChangedLanguageSettings();
void LoadAllTextures();
void LoadSettings();
void MessageScreen(const char *);
// TODO(MIAMI): implement the second argument
void MessageScreen(const char *str, bool) { MessageScreen(str); }
- void PickNewPlayerColour();
void PrintBriefs();
static void PrintErrorMessage();
void PrintStats();
void Process();
void ProcessButtonPresses();
+ void ProcessFileActions();
void ProcessOnOffMenuOptions();
- static void RequestFrontEndShutDown();
- static void RequestFrontEndStartUp();
+ void RequestFrontEndShutDown();
+ void RequestFrontEndStartUp();
void ResetHelperText();
void SaveLoadFileError_SetUpErrorScreen();
void SaveSettings();
void SetHelperText(int text);
- void ShutdownJustMenu();
float StretchX(float);
float StretchY(float);
void SwitchMenuOnAndOff();
void UnloadTextures();
void WaitForUserCD();
- void PrintController();
int GetNumOptionsCntrlConfigScreens();
int ConstructStatLine(int);
+ void SwitchToNewScreen(int8);
// New (not in function or inlined in the game)
void ThingsToDoBeforeLeavingPage();
@@ -660,7 +702,7 @@ public:
};
#ifndef IMPROVED_VIDEOMODE
-VALIDATE_SIZE(CMenuManager, 0x564);
+VALIDATE_SIZE(CMenuManager, 0x688);
#endif
extern CMenuManager FrontEndMenuManager;
diff --git a/src/core/Game.cpp b/src/core/Game.cpp
index b96c8988..72b09feb 100644
--- a/src/core/Game.cpp
+++ b/src/core/Game.cpp
@@ -64,6 +64,7 @@
#include "Script.h"
#include "Shadows.h"
#include "Skidmarks.h"
+#include "SetPieces.h"
#include "SpecialFX.h"
#include "Sprite2d.h"
#include "Stats.h"
@@ -84,6 +85,7 @@
#include "World.h"
#include "ZoneCull.h"
#include "Zones.h"
+#include "Occlusion.h"
#include "debugmenu.h"
@@ -220,20 +222,20 @@ bool CGame::InitialiseOnceAfterRW(void)
if ( FrontEndMenuManager.m_nPrefsAudio3DProviderIndex == -99 || FrontEndMenuManager.m_nPrefsAudio3DProviderIndex == -2 )
{
- CMenuManager::m_PrefsSpeakers = 0;
+ FrontEndMenuManager.m_PrefsSpeakers = 0;
int8 provider = DMAudio.AutoDetect3DProviders();
if ( provider != -1 )
FrontEndMenuManager.m_nPrefsAudio3DProviderIndex = provider;
}
DMAudio.SetCurrent3DProvider(FrontEndMenuManager.m_nPrefsAudio3DProviderIndex);
- DMAudio.SetSpeakerConfig(CMenuManager::m_PrefsSpeakers);
- DMAudio.SetDynamicAcousticModelingStatus(CMenuManager::m_PrefsDMA);
- DMAudio.SetMusicMasterVolume(CMenuManager::m_PrefsMusicVolume);
- DMAudio.SetEffectsMasterVolume(CMenuManager::m_PrefsSfxVolume);
+ DMAudio.SetSpeakerConfig(FrontEndMenuManager.m_PrefsSpeakers);
+ DMAudio.SetDynamicAcousticModelingStatus(FrontEndMenuManager.m_PrefsDMA);
+ DMAudio.SetMusicMasterVolume(FrontEndMenuManager.m_PrefsMusicVolume);
+ DMAudio.SetEffectsMasterVolume(FrontEndMenuManager.m_PrefsSfxVolume);
DMAudio.SetEffectsFadeVol(127);
DMAudio.SetMusicFadeVol(127);
- CWorld::Players[0].SetPlayerSkin(CMenuManager::m_PrefsSkinFile);
+ CWorld::Players[0].SetPlayerSkin(FrontEndMenuManager.m_PrefsSkinFile);
return true;
}
@@ -272,7 +274,9 @@ bool CGame::Initialise(const char* datFile)
ThePaths.AllocatePathFindInfoMem(4500);
CWeather::Init();
CCullZones::Init();
+ COcclusion::Init();
CCollision::Init();
+ CSetPieces::Init();
CTheZones::Init();
CUserDisplay::Init();
CMessages::Init();
@@ -527,6 +531,7 @@ void CGame::ShutDownForRestart(void)
CRadar::RemoveRadarSections();
FrontEndMenuManager.UnloadTextures();
CParticleObject::RemoveAllParticleObjects();
+ CSetPieces::Init();
CPedType::Shutdown();
CSpecialFX::Shutdown();
TidyUpMemory(true, false);
@@ -539,7 +544,14 @@ void CGame::InitialiseWhenRestarting(void)
CTimer::Initialise();
CSprite2d::SetRecipNearClip();
-
+
+ if (b_FoundRecentSavedGameWantToLoad || FrontEndMenuManager.m_bWantToLoad)
+ {
+ LoadSplash("splash1");
+ if (FrontEndMenuManager.m_bWantToLoad)
+ FrontEndMenuManager.MessageScreen("FELD_WR", true);
+ }
+
b_FoundRecentSavedGameWantToLoad = false;
TheCamera.Init();
@@ -620,6 +632,7 @@ void CGame::Process(void)
CAntennas::Update();
CGlass::Update();
CSceneEdit::Update();
+ CSetPieces::Update();
CEventList::Update();
CParticle::Update();
gFireManager.Update();
@@ -662,6 +675,16 @@ void CGame::Process(void)
}
}
+void
+CGame::InitAfterFocusLoss()
+{
+ FrontEndMenuManager.m_nPrefsAudio3DProviderIndex = FrontEndMenuManager.m_lastWorking3DAudioProvider;
+ DMAudio.SetCurrent3DProvider(FrontEndMenuManager.m_lastWorking3DAudioProvider);
+
+ if (!FrontEndMenuManager.m_bGameNotLoaded && !FrontEndMenuManager.m_bMenuActive)
+ FrontEndMenuManager.m_bStartUpFrontEndRequested = true;
+}
+
bool
CGame::CanSeeOutSideFromCurrArea(void)
{
diff --git a/src/core/Game.h b/src/core/Game.h
index 6efacf8d..7ad8d55e 100644
--- a/src/core/Game.h
+++ b/src/core/Game.h
@@ -59,6 +59,8 @@ public:
static void InitialiseWhenRestarting(void);
static void Process(void);
+ static void InitAfterFocusLoss(void);
+
static bool IsInInterior(void) { return currArea != AREA_MAIN_MAP; }
static bool CanSeeOutSideFromCurrArea(void);
diff --git a/src/core/MenuScreens.h b/src/core/MenuScreens.h
index 6c2ebdb8..805a5aff 100644
--- a/src/core/MenuScreens.h
+++ b/src/core/MenuScreens.h
@@ -206,20 +206,12 @@ const CMenuScreen aScreens[] = {
MENUACTION_MEMCARDSAVECONFIRM, "JAILB_U", SAVESLOT_NONE, MENUPAGE_NONE,
},
- // Unused in PC but anyway
// MENUPAGE_SAVE = 24
-#ifdef PS2_SAVE_DIALOG
- { "FET_SG", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
- MENUACTION_CHANGEMENU, "FESZ_SA", SAVESLOT_NONE, MENUPAGE_CHOOSE_SAVE_SLOT,
- MENUACTION_RESUME_FROM_SAVEZONE, "FESZ_CA", SAVESLOT_NONE, MENUPAGE_NONE,
- },
-#else
{ "FET_SG", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
MENUACTION_LABEL, "FES_SCG", SAVESLOT_NONE, MENUPAGE_NONE,
MENUACTION_POPULATESLOTS_CHANGEMENU, "GMSAVE", SAVESLOT_NONE, MENUPAGE_CHOOSE_SAVE_SLOT,
MENUACTION_RESUME_FROM_SAVEZONE, "FESZ_CA", SAVESLOT_NONE, MENUPAGE_NONE,
},
-#endif
// MENUPAGE_NO_MEMORY_CARD_2 = 25
{ "FES_NOC", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0,
@@ -284,6 +276,9 @@ const CMenuScreen aScreens[] = {
// MENUPAGE_CONTROLLER_PC = 35
{ "FET_CTL", 1, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 0, 0,
MENUACTION_CTRLMETHOD, "FET_CME", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC,
+#ifdef FREE_CAM
+ MENUACTION_FREECAM, "FREECAM", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC,
+#endif
MENUACTION_CHANGEMENU, "FET_RDK", SAVESLOT_NONE, MENUPAGE_KEYBOARD_CONTROLS,
MENUACTION_CHANGEMENU, "FET_AMS", SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS,
MENUACTION_RESTOREDEF, "FET_DEF", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC,
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index a40366ad..69f340dd 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -49,7 +49,7 @@ CKeyboardState CPad::OldKeyState;
CKeyboardState CPad::NewKeyState;
CKeyboardState CPad::TempKeyState;
-char CPad::KeyBoardCheatString[20];
+char CPad::KeyBoardCheatString[30];
CMouseControllerState CPad::OldMouseControllerState;
CMouseControllerState CPad::NewMouseControllerState;
@@ -68,39 +68,39 @@ void WeaponCheat()
CStreaming::RequestModel(MI_GRENADE, STREAMFLAGS_DONT_REMOVE);
CStreaming::RequestModel(MI_BOMB, STREAMFLAGS_DONT_REMOVE);
- CStreaming::RequestModel(MI_AK47, STREAMFLAGS_DONT_REMOVE);
+ CStreaming::RequestModel(MI_RUGER, STREAMFLAGS_DONT_REMOVE);
CStreaming::RequestModel(MI_BASEBALL_BAT, STREAMFLAGS_DONT_REMOVE);
- CStreaming::RequestModel(MI_COLT, STREAMFLAGS_DONT_REMOVE);
+ CStreaming::RequestModel(MI_COLT45, STREAMFLAGS_DONT_REMOVE);
CStreaming::RequestModel(MI_ROCKETLAUNCHER, STREAMFLAGS_DONT_REMOVE);
- CStreaming::RequestModel(MI_SHOTGUN, STREAMFLAGS_DONT_REMOVE);
- CStreaming::RequestModel(MI_SNIPER, STREAMFLAGS_DONT_REMOVE);
+ CStreaming::RequestModel(MI_SPAS12_SHOTGUN, STREAMFLAGS_DONT_REMOVE);
+ CStreaming::RequestModel(MI_SNIPERRIFLE, STREAMFLAGS_DONT_REMOVE);
CStreaming::RequestModel(MI_MP5, STREAMFLAGS_DONT_REMOVE);
CStreaming::LoadAllRequestedModels(false);
FindPlayerPed()->GiveWeapon(WEAPONTYPE_BASEBALLBAT, 0);
FindPlayerPed()->GiveWeapon(WEAPONTYPE_COLT45, 100);
FindPlayerPed()->GiveWeapon(WEAPONTYPE_MP5, 100);
- FindPlayerPed()->GiveWeapon(WEAPONTYPE_SHOTGUN, 20);
- FindPlayerPed()->GiveWeapon(WEAPONTYPE_AK47, 200);
+ FindPlayerPed()->GiveWeapon(WEAPONTYPE_SPAS12_SHOTGUN, 20);
+ FindPlayerPed()->GiveWeapon(WEAPONTYPE_RUGER, 200);
FindPlayerPed()->GiveWeapon(WEAPONTYPE_SNIPERRIFLE, 5);
FindPlayerPed()->GiveWeapon(WEAPONTYPE_ROCKETLAUNCHER, 5);
FindPlayerPed()->GiveWeapon(WEAPONTYPE_DETONATOR_GRENADE, 5);
CStreaming::SetModelIsDeletable(MI_GRENADE);
CStreaming::SetModelIsDeletable(MI_BOMB);
- CStreaming::SetModelIsDeletable(MI_AK47);
+ CStreaming::SetModelIsDeletable(MI_RUGER);
CStreaming::SetModelIsDeletable(MI_BASEBALL_BAT);
- CStreaming::SetModelIsDeletable(MI_COLT);
+ CStreaming::SetModelIsDeletable(MI_COLT45);
CStreaming::SetModelIsDeletable(MI_ROCKETLAUNCHER);
- CStreaming::SetModelIsDeletable(MI_SHOTGUN);
- CStreaming::SetModelIsDeletable(MI_SNIPER);
+ CStreaming::SetModelIsDeletable(MI_SPAS12_SHOTGUN);
+ CStreaming::SetModelIsDeletable(MI_SNIPERRIFLE);
CStreaming::SetModelIsDeletable(MI_MP5);
}
void HealthCheat()
{
CHud::SetHelpMessage(TheText.Get("CHEAT3"), true);
- FindPlayerPed()->m_fHealth = 100.0f;
+ FindPlayerPed()->m_fHealth = CWorld::Players[0].m_nMaxHealth;
if (FindPlayerVehicle()) {
FindPlayerVehicle()->m_fHealth = 1000.0f;
if (FindPlayerVehicle()->m_vehType == VEHICLE_TYPE_CAR)
@@ -108,31 +108,31 @@ void HealthCheat()
}
}
-void TankCheat()
+void VehicleCheat(bool something, int model)
{
CHud::SetHelpMessage(TheText.Get("CHEAT1"), true);
- CStreaming::RequestModel(MI_RHINO, 0);
- CStreaming::LoadAllRequestedModels(false);
- if (CStreaming::ms_aInfoForModel[MI_RHINO].m_loadState == STREAMSTATE_LOADED) {
+ CStreaming::RequestModel(model, 0);
+ CStreaming::LoadAllRequestedModels(something);
+ if (CStreaming::ms_aInfoForModel[model].m_loadState == STREAMSTATE_LOADED) {
CHud::SetHelpMessage(TheText.Get("CHEAT1"), true);
int32 node = ThePaths.FindNodeClosestToCoors(FindPlayerCoors(), PATH_CAR, 100.0f);
if (node < 0) return;
-
+
#ifdef FIX_BUGS
- CAutomobile* tank = new CAutomobile(MI_RHINO, RANDOM_VEHICLE);
+ CAutomobile* vehicle = new CAutomobile(model, RANDOM_VEHICLE);
#else
- CAutomobile *tank = new CAutomobile(MI_RHINO, MISSION_VEHICLE);
+ CAutomobile* vehicle = new CAutomobile(MI_RHINO, MISSION_VEHICLE);
#endif
- if (tank != nil) {
+ if (vehicle != nil) {
CVector pos = ThePaths.m_pathNodes[node].GetPosition();
pos.z += 4.0f;
- tank->SetPosition(pos);
- tank->SetOrientation(0.0f, 0.0f, DEGTORAD(200.0f));
+ vehicle->SetPosition(pos);
+ vehicle->SetOrientation(0.0f, 0.0f, DEGTORAD(200.0f));
- tank->SetStatus(STATUS_ABANDONED);
- tank->m_nDoorLock = CARLOCK_UNLOCKED;
- CWorld::Add(tank);
+ vehicle->SetStatus(STATUS_ABANDONED);
+ vehicle->m_nDoorLock = CARLOCK_UNLOCKED;
+ CWorld::Add(vehicle);
}
}
}
@@ -224,7 +224,7 @@ void MoneyCheat()
void ArmourCheat()
{
CHud::SetHelpMessage(TheText.Get("CHEAT4"), true);
- FindPlayerPed()->m_fArmour = 100.0f;
+ FindPlayerPed()->m_fArmour = CWorld::Players[0].m_nMaxArmour;
}
void WantedLevelUpCheat()
@@ -701,7 +701,7 @@ CControllerState CPad::ReconcileTwoControllersInput(CControllerState const &Stat
void CPad::StartShake(int16 nDur, uint8 nFreq)
{
- if ( !CMenuManager::m_PrefsUseVibration )
+ if ( !FrontEndMenuManager.m_PrefsUseVibration )
return;
if ( CCutsceneMgr::IsRunning() || CGame::playingIntro )
@@ -723,7 +723,7 @@ void CPad::StartShake(int16 nDur, uint8 nFreq)
void CPad::StartShake_Distance(int16 nDur, uint8 nFreq, float fX, float fY, float fZ)
{
- if ( !CMenuManager::m_PrefsUseVibration )
+ if ( !FrontEndMenuManager.m_PrefsUseVibration )
return;
if ( CCutsceneMgr::IsRunning() || CGame::playingIntro )
@@ -750,7 +750,7 @@ void CPad::StartShake_Distance(int16 nDur, uint8 nFreq, float fX, float fY, floa
void CPad::StartShake_Train(float fX, float fY)
{
- if ( !CMenuManager::m_PrefsUseVibration )
+ if ( !FrontEndMenuManager.m_PrefsUseVibration )
return;
if ( CCutsceneMgr::IsRunning() || CGame::playingIntro )
@@ -824,7 +824,7 @@ void CPad::AddToCheatString(char c)
// "CCCCCC321TCT" - CIRCLE CIRCLE CIRCLE CIRCLE CIRCLE CIRCLE R1 L2 L1 TRIANGLE CIRCLE TRIANGLE
else if ( !_CHEATCMP("TCT123CCCCCC") )
- TankCheat();
+ VehicleCheat(true, MI_RHINO);
// "CCCSSSSS1TCT" - CIRCLE CIRCLE CIRCLE SQUARE SQUARE SQUARE SQUARE SQUARE L1 TRIANGLE CIRCLE TRIANGLE
else if ( !_CHEATCMP("TCT1SSSSSCCC") )
@@ -905,10 +905,46 @@ void CPad::AddToPCCheatString(char c)
// "NOPOLICEPLEASE"
if ( !_CHEATCMP("ESAELPECILOPON") )
WantedLevelDownCheat();
-
- // "GIVEUSATANK"
- if ( !_CHEATCMP("KNATASUEVIG") )
- TankCheat();
+
+ // "PANZER"
+ if ( !_CHEATCMP("REZNAP") )
+ VehicleCheat(true, MI_RHINO);
+
+ // "TRAVELINSTYLE"
+ if ( !_CHEATCMP("ELYTSNILEVART") )
+ VehicleCheat(true, MI_BLOODRA);
+
+ // "GETTHEREQUICKLY"
+ if ( !_CHEATCMP("YLKCIUQEREHTTEG") )
+ VehicleCheat(true, MI_BLOODRB);
+
+ // "GETTHEREFAST"
+ if ( !_CHEATCMP("TSAFEREHTTEG") )
+ VehicleCheat(true, MI_SABRETUR);
+
+ // "GETTHEREVERYFASTINDEED"
+ if ( !_CHEATCMP("DEEDNITSAFYREVEREHTTEG") )
+ VehicleCheat(true, MI_HOTRINA);
+
+ // "GETTHEREAMAZINGLYFAST"
+ if ( !_CHEATCMP("TSAFYLGNIZAMAEREHTTEG") )
+ VehicleCheat(true, MI_HOTRINB);
+
+ // "THELASTRIDE"
+ if ( !_CHEATCMP("EDIRTSALEHT") )
+ VehicleCheat(true, MI_ROMERO);
+
+ // "ROCKANDROLLCAR"
+ if ( !_CHEATCMP("RACLLORDNAKCOR") )
+ VehicleCheat(true, MI_LOVEFIST);
+
+ // "RUBBISHCAR"
+ if ( !_CHEATCMP("RACHSIBBUR") )
+ VehicleCheat(true, MI_TRASH);
+
+ // "BETTERTHANWALKING"
+ if ( !_CHEATCMP("GNIKLAWNAHTRETTEB") )
+ VehicleCheat(true, MI_CADDY);
// "BANGBANGBANG"
if ( !_CHEATCMP("GNABGNABGNAB") )
diff --git a/src/core/Pad.h b/src/core/Pad.h
index ea771f81..ad93fb49 100644
--- a/src/core/Pad.h
+++ b/src/core/Pad.h
@@ -176,7 +176,7 @@ public:
static CKeyboardState OldKeyState;
static CKeyboardState NewKeyState;
static CKeyboardState TempKeyState;
- static char KeyBoardCheatString[20];
+ static char KeyBoardCheatString[30];
static CMouseControllerState OldMouseControllerState;
static CMouseControllerState NewMouseControllerState;
static CMouseControllerState PCTempMouseControllerState;
diff --git a/src/core/Placeable.cpp b/src/core/Placeable.cpp
index 69b3d3ea..6efc1540 100644
--- a/src/core/Placeable.cpp
+++ b/src/core/Placeable.cpp
@@ -7,8 +7,6 @@ CPlaceable::CPlaceable(void)
m_matrix.SetScale(1.0f);
}
-CPlaceable::~CPlaceable(void) = default;
-
void
CPlaceable::SetHeading(float angle)
{
diff --git a/src/core/Placeable.h b/src/core/Placeable.h
index 970c0d48..22f7583c 100644
--- a/src/core/Placeable.h
+++ b/src/core/Placeable.h
@@ -9,7 +9,6 @@ public:
CMatrix m_matrix;
CPlaceable(void);
- virtual ~CPlaceable(void);
const CVector &GetPosition(void) { return m_matrix.GetPosition(); }
void SetPosition(float x, float y, float z) {
m_matrix.GetPosition().x = x;
diff --git a/src/core/PlayerInfo.cpp b/src/core/PlayerInfo.cpp
index d7b3f0e5..675fafb3 100644
--- a/src/core/PlayerInfo.cpp
+++ b/src/core/PlayerInfo.cpp
@@ -140,20 +140,23 @@ CPlayerInfo::Clear(void)
m_nUpsideDownCounter = 0;
m_bInfiniteSprint = false;
m_bFastReload = false;
+ m_nMaxHealth = m_nMaxArmour = 100;
m_bGetOutOfJailFree = false;
m_bGetOutOfHospitalFree = false;
+ m_bDriveByAllowed = true;
m_nPreviousTimeRewardedForExplosion = 0;
m_nExplosionsSinceLastReward = 0;
}
void
-CPlayerInfo::BlowUpRCBuggy(void)
+CPlayerInfo::BlowUpRCBuggy(bool actually)
{
if (!m_pRemoteVehicle || m_pRemoteVehicle->bRemoveFromWorld)
return;
CRemote::TakeRemoteControlledCarFromPlayer();
- m_pRemoteVehicle->BlowUpCar(FindPlayerPed());
+ if (actually)
+ m_pRemoteVehicle->BlowUpCar(FindPlayerPed());
}
void
@@ -171,7 +174,6 @@ void
CPlayerInfo::MakePlayerSafe(bool toggle)
{
if (toggle) {
- CTheScripts::ResetCountdownToMakePlayerUnsafe();
m_pPed->m_pWanted->m_bIgnoredByEveryone = true;
CWorld::StopAllLawEnforcersInTheirTracks();
CPad::GetPad(0)->DisablePlayerControls |= PLAYERCONTROL_DISABLED_20;
@@ -192,7 +194,8 @@ CPlayerInfo::MakePlayerSafe(bool toggle)
CWorld::ExtinguishAllCarFiresInArea(GetPos(), 4000.0f);
CReplay::DisableReplays();
- } else if (!CGame::playingIntro && !CTheScripts::IsCountdownToMakePlayerUnsafeOn()) {
+ }
+ else {
m_pPed->m_pWanted->m_bIgnoredByEveryone = false;
CPad::GetPad(0)->DisablePlayerControls &= ~PLAYERCONTROL_DISABLED_20;
m_pPed->bBulletProof = false;
diff --git a/src/core/PlayerInfo.h b/src/core/PlayerInfo.h
index c649d49d..e2e874e6 100644
--- a/src/core/PlayerInfo.h
+++ b/src/core/PlayerInfo.h
@@ -50,10 +50,16 @@ public:
int32 m_nExplosionsSinceLastReward;
int32 field_268;
int32 field_272;
+ uint32 m_nHavocLevel;
+ float m_fMediaAttention;
bool m_bInfiniteSprint;
bool m_bFastReload;
+ bool m_bFireproof;
+ uint8 m_nMaxHealth;
+ uint8 m_nMaxArmour;
bool m_bGetOutOfJailFree;
bool m_bGetOutOfHospitalFree;
+ bool m_bDriveByAllowed;
char m_aSkinName[32];
RwTexture *m_pSkinTexture;
@@ -69,7 +75,7 @@ public:
bool IsPlayerInRemoteMode(void);
void PlayerFailedCriticalMission(void);
void Clear(void);
- void BlowUpRCBuggy(void);
+ void BlowUpRCBuggy(bool);
void CancelPlayerEnteringCars(CVehicle*);
bool IsRestartingAfterDeath(void);
bool IsRestartingAfterArrest(void);
diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp
index 5b0d38e8..475ca4d3 100644
--- a/src/core/Radar.cpp
+++ b/src/core/Radar.cpp
@@ -21,49 +21,87 @@ sRadarTrace CRadar::ms_RadarTrace[NUMRADARBLIPS];
CVector2D vec2DRadarOrigin;
int32 gRadarTxdIds[64];
-CSprite2d CRadar::AsukaSprite;
-CSprite2d CRadar::BombSprite;
-CSprite2d CRadar::CatSprite;
CSprite2d CRadar::CentreSprite;
-CSprite2d CRadar::CopcarSprite;
-CSprite2d CRadar::DonSprite;
-CSprite2d CRadar::EightSprite;
-CSprite2d CRadar::ElSprite;
-CSprite2d CRadar::IceSprite;
-CSprite2d CRadar::JoeySprite;
-CSprite2d CRadar::KenjiSprite;
-CSprite2d CRadar::LizSprite;
-CSprite2d CRadar::LuigiSprite;
+CSprite2d CRadar::MapHereSprite;
CSprite2d CRadar::NorthSprite;
-CSprite2d CRadar::RaySprite;
-CSprite2d CRadar::SalSprite;
-CSprite2d CRadar::SaveSprite;
+CSprite2d CRadar::AverySprite;
+CSprite2d CRadar::BikerSprite;
+CSprite2d CRadar::CortezSprite;
+CSprite2d CRadar::DiazSprite;
+CSprite2d CRadar::KentSprite;
+CSprite2d CRadar::LawyerSprite;
+CSprite2d CRadar::PhilSprite;
+CSprite2d CRadar::BikersSprite;
+CSprite2d CRadar::BoatyardSprite;
+CSprite2d CRadar::MalibuClubSprite;
+CSprite2d CRadar::CubansSprite;
+CSprite2d CRadar::FilmSprite;
+CSprite2d CRadar::GunSprite;
+CSprite2d CRadar::HaitiansSprite;
+CSprite2d CRadar::HardwareSprite;
+CSprite2d CRadar::SaveHouseSprite;
+CSprite2d CRadar::StripSprite;
+CSprite2d CRadar::IceSprite;
+CSprite2d CRadar::KCabsSprite;
+CSprite2d CRadar::LovefistSprite;
+CSprite2d CRadar::PrintworksSprite;
+CSprite2d CRadar::PropertySprite;
+CSprite2d CRadar::SunYardSprite;
CSprite2d CRadar::SpraySprite;
-CSprite2d CRadar::TonySprite;
-CSprite2d CRadar::WeaponSprite;
+CSprite2d CRadar::TShirtSprite;
+CSprite2d CRadar::TommySprite;
+CSprite2d CRadar::PhoneSprite;
+CSprite2d CRadar::RadioWildstyleSprite;
+CSprite2d CRadar::RadioFlashSprite;
+CSprite2d CRadar::RadioKChatSprite;
+CSprite2d CRadar::RadioFeverSprite;
+CSprite2d CRadar::RadioVRockSprite;
+CSprite2d CRadar::RadioVCPRSprite;
+CSprite2d CRadar::RadioEspantosoSprite;
+CSprite2d CRadar::RadioEmotionSprite;
+CSprite2d CRadar::RadioWaveSprite;
CSprite2d *CRadar::RadarSprites[RADAR_SPRITE_COUNT] = {
nil,
- &AsukaSprite,
- &BombSprite,
- &CatSprite,
&CentreSprite,
- &CopcarSprite,
- &DonSprite,
- &EightSprite,
- &ElSprite,
- &IceSprite,
- &JoeySprite,
- &KenjiSprite,
- &LizSprite,
- &LuigiSprite,
+ &MapHereSprite,
&NorthSprite,
- &RaySprite,
- &SalSprite,
- &SaveSprite,
+ &AverySprite,
+ &BikerSprite,
+ &CortezSprite,
+ &DiazSprite,
+ &KentSprite,
+ &LawyerSprite,
+ &PhilSprite,
+ &BikersSprite,
+ &BoatyardSprite,
+ &MalibuClubSprite,
+ &CubansSprite,
+ &FilmSprite,
+ &GunSprite,
+ &HaitiansSprite,
+ &HardwareSprite,
+ &SaveHouseSprite,
+ &StripSprite,
+ &IceSprite,
+ &KCabsSprite,
+ &LovefistSprite,
+ &PrintworksSprite,
+ &PropertySprite,
+ &SunYardSprite,
&SpraySprite,
- &TonySprite,
- &WeaponSprite
+ &TShirtSprite,
+ &TommySprite,
+ &PhoneSprite,
+ &RadioWildstyleSprite,
+ &RadioFlashSprite,
+ &RadioKChatSprite,
+ &RadioFeverSprite,
+ &RadioVRockSprite,
+ &RadioVCPRSprite,
+ &RadioEspantosoSprite,
+ &RadioEmotionSprite,
+ &RadioWaveSprite
};
// Why this doesn't coincide with world coordinates i don't know
@@ -87,12 +125,11 @@ static_assert(RADAR_TILE_SIZE == (RADAR_SIZE_Y / RADAR_NUM_TILES), "CRadar: not
CRGBA CRadar::ArrowBlipColour1;
CRGBA CRadar::ArrowBlipColour2;
uint16 CRadar::MapLegendCounter;
-uint16 CRadar::MapLegendList[NUM_MAP_LEGENDS];
+int16 CRadar::MapLegendList[NUM_MAP_LEGENDS];
int CRadar::TargetMarkerId = -1;
CVector CRadar::TargetMarkerPos;
#endif
-// taken from VC
float CRadar::cachedCos;
float CRadar::cachedSin;
@@ -227,7 +264,7 @@ int LineRadarBoxCollision(CVector2D &out, const CVector2D &p1, const CVector2D &
uint8 CRadar::CalculateBlipAlpha(float dist)
{
#ifdef MENU_MAP
- if (CMenuManager::bMenuMapActive)
+ if (FrontEndMenuManager.m_bMenuMapActive)
return 255;
#endif
if (dist <= 1.0f)
@@ -273,12 +310,9 @@ void CRadar::ClearBlip(int32 i)
if (index != -1) {
SetRadarMarkerState(index, false);
ms_RadarTrace[index].m_bInUse = false;
-#ifndef MENU_MAP
- // Ssshhh
ms_RadarTrace[index].m_eBlipType = BLIP_NONE;
ms_RadarTrace[index].m_eBlipDisplay = BLIP_DISPLAY_NEITHER;
ms_RadarTrace[index].m_eRadarSprite = RADAR_SPRITE_NONE;
-#endif
}
}
@@ -378,9 +412,8 @@ int CRadar::ClipRadarPoly(CVector2D *poly, const CVector2D *rect)
bool CRadar::DisplayThisBlip(int32 counter)
{
switch (ms_RadarTrace[counter].m_eRadarSprite) {
- case RADAR_SPRITE_BOMB:
case RADAR_SPRITE_SPRAY:
- case RADAR_SPRITE_WEAPON:
+ case RADAR_SPRITE_GUN:
return true;
default:
return false;
@@ -398,7 +431,7 @@ void CRadar::Draw3dMarkers()
if (ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY) {
CVector pos = entity->GetPosition();
pos.z += 1.2f * CModelInfo::GetModelInfo(entity->GetModelIndex())->GetColModel()->boundingBox.max.z + 2.5f;
- C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), 1, pos, 2.5f, 0, 128, 255, 255, 1024, 0.2f, 5);
+ C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), 1, pos, 2.5f, CARBLIP_MARKER_COLOR_R, CARBLIP_MARKER_COLOR_G, CARBLIP_MARKER_COLOR_B, CARBLIP_MARKER_COLOR_A, 1024, 0.2f, 5);
}
break;
}
@@ -412,7 +445,7 @@ void CRadar::Draw3dMarkers()
if (ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY) {
CVector pos = entity->GetPosition();
pos.z += 3.0f;
- C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), 1, pos, 1.5f, 0, 128, 255, 255, 1024, 0.2f, 5);
+ C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), 1, pos, 1.5f, CHARBLIP_MARKER_COLOR_R, CHARBLIP_MARKER_COLOR_G, CHARBLIP_MARKER_COLOR_B, CHARBLIP_MARKER_COLOR_A, 1024, 0.2f, 5);
}
break;
}
@@ -422,7 +455,7 @@ void CRadar::Draw3dMarkers()
if (ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY) {
CVector pos = entity->GetPosition();
pos.z += CModelInfo::GetModelInfo(entity->GetModelIndex())->GetColModel()->boundingBox.max.z + 1.0f + 1.0f;
- C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), 1, pos, 1.0f, 0, 128, 255, 255, 1024, 0.2f, 5);
+ C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), 1, pos, 1.0f, OBJECTBLIP_MARKER_COLOR_R, OBJECTBLIP_MARKER_COLOR_G, OBJECTBLIP_MARKER_COLOR_B, OBJECTBLIP_MARKER_COLOR_A, 1024, 0.2f, 5);
}
break;
}
@@ -431,7 +464,7 @@ void CRadar::Draw3dMarkers()
case BLIP_CONTACT_POINT:
if (!CTheScripts::IsPlayerOnAMission()) {
if (ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY)
- C3dMarkers::PlaceMarkerSet(i | (ms_RadarTrace[i].m_BlipIndex << 16), 4, ms_RadarTrace[i].m_vecPos, 2.0f, 0, 128, 255, 128, 2048, 0.2f, 0);
+ C3dMarkers::PlaceMarkerSet(i | (ms_RadarTrace[i].m_BlipIndex << 16), 4, ms_RadarTrace[i].m_vecPos, 2.0f, COORDBLIP_MARKER_COLOR_R, COORDBLIP_MARKER_COLOR_G, COORDBLIP_MARKER_COLOR_B, COORDBLIP_MARKER_COLOR_A, 2048, 0.2f, 0);
}
break;
}
@@ -454,7 +487,7 @@ void CRadar::DrawBlips()
TransformRadarPointToScreenSpace(out, in);
#ifdef MENU_MAP
- if (!CMenuManager::bMenuMapActive) {
+ if (!FrontEndMenuManager.m_bMenuMapActive) {
#endif
float angle;
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN)
@@ -481,11 +514,6 @@ void CRadar::DrawBlips()
CEntity *blipEntity = nil;
for(int blipId = 0; blipId < NUMRADARBLIPS; blipId++) {
-#ifdef MENU_MAP
- // A little hack to reuse cleared blips in menu map. hehe
- if (!CMenuManager::bMenuMapActive || ms_RadarTrace[blipId].m_eBlipType == BLIP_CAR ||
- ms_RadarTrace[blipId].m_eBlipType == BLIP_CHAR || ms_RadarTrace[blipId].m_eBlipType == BLIP_OBJECT)
-#endif
if (!ms_RadarTrace[blipId].m_bInUse)
continue;
@@ -493,8 +521,8 @@ void CRadar::DrawBlips()
case BLIP_CAR:
case BLIP_CHAR:
case BLIP_OBJECT:
- if (ms_RadarTrace[blipId].m_eRadarSprite == RADAR_SPRITE_BOMB || ms_RadarTrace[blipId].m_eRadarSprite == RADAR_SPRITE_SAVE
- || ms_RadarTrace[blipId].m_eRadarSprite == RADAR_SPRITE_SPRAY || ms_RadarTrace[blipId].m_eRadarSprite == RADAR_SPRITE_WEAPON) {
+ if (ms_RadarTrace[blipId].m_eRadarSprite == RADAR_SPRITE_SAVE
+ || ms_RadarTrace[blipId].m_eRadarSprite == RADAR_SPRITE_SPRAY || ms_RadarTrace[blipId].m_eRadarSprite == RADAR_SPRITE_GUN) {
switch (ms_RadarTrace[blipId].m_eBlipType) {
case BLIP_CAR:
@@ -527,7 +555,7 @@ void CRadar::DrawBlips()
TransformRealWorldPointToRadarSpace(in, blipEntity->GetPosition());
float dist = LimitRadarPoint(in);
TransformRadarPointToScreenSpace(out, in);
- if (!ms_RadarTrace[blipId].m_bShortRange || dist <= 1.0f || CMenuManager::bMenuMapActive) {
+ if (!ms_RadarTrace[blipId].m_bShortRange || dist <= 1.0f || FrontEndMenuManager.m_bMenuMapActive) {
if (ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_NONE) {
DrawRadarSprite(ms_RadarTrace[blipId].m_eRadarSprite, out.x, out.y, CalculateBlipAlpha(dist));
}
@@ -552,8 +580,8 @@ void CRadar::DrawBlips()
break;
case BLIP_COORD:
case BLIP_CONTACT_POINT:
- if ((ms_RadarTrace[blipId].m_eRadarSprite == RADAR_SPRITE_BOMB || ms_RadarTrace[blipId].m_eRadarSprite == RADAR_SPRITE_SAVE
- || ms_RadarTrace[blipId].m_eRadarSprite == RADAR_SPRITE_SPRAY || ms_RadarTrace[blipId].m_eRadarSprite == RADAR_SPRITE_WEAPON)
+ if ((ms_RadarTrace[blipId].m_eRadarSprite == RADAR_SPRITE_SAVE
+ || ms_RadarTrace[blipId].m_eRadarSprite == RADAR_SPRITE_SPRAY || ms_RadarTrace[blipId].m_eRadarSprite == RADAR_SPRITE_GUN)
&& (ms_RadarTrace[blipId].m_eBlipType != BLIP_CONTACT_POINT || !CTheScripts::IsPlayerOnAMission())) {
uint32 color = GetRadarTraceColour(ms_RadarTrace[blipId].m_nColor, ms_RadarTrace[blipId].m_bDim);
@@ -569,7 +597,7 @@ void CRadar::DrawBlips()
TransformRealWorldPointToRadarSpace(in, ms_RadarTrace[blipId].m_vec2DPos);
float dist = LimitRadarPoint(in);
TransformRadarPointToScreenSpace(out, in);
- if (!ms_RadarTrace[blipId].m_bShortRange || dist <= 1.0f || CMenuManager::bMenuMapActive) {
+ if (!ms_RadarTrace[blipId].m_bShortRange || dist <= 1.0f || FrontEndMenuManager.m_bMenuMapActive) {
if (ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_NONE) {
DrawRadarSprite(ms_RadarTrace[blipId].m_eRadarSprite, out.x, out.y, CalculateBlipAlpha(dist));
}
@@ -603,8 +631,8 @@ void CRadar::DrawBlips()
case BLIP_CAR:
case BLIP_CHAR:
case BLIP_OBJECT:
- if (ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_BOMB && ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_SAVE
- && ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_SPRAY && ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_WEAPON) {
+ if (ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_SAVE
+ && ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_SPRAY && ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_GUN) {
switch (ms_RadarTrace[blipId].m_eBlipType) {
case BLIP_CAR:
@@ -638,7 +666,7 @@ void CRadar::DrawBlips()
TransformRealWorldPointToRadarSpace(in, blipEntity->GetPosition());
float dist = LimitRadarPoint(in);
TransformRadarPointToScreenSpace(out, in);
- if (!ms_RadarTrace[blipId].m_bShortRange || dist <= 1.0f || CMenuManager::bMenuMapActive) {
+ if (!ms_RadarTrace[blipId].m_bShortRange || dist <= 1.0f || FrontEndMenuManager.m_bMenuMapActive) {
if (ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_NONE)
DrawRadarSprite(ms_RadarTrace[blipId].m_eRadarSprite, out.x, out.y, CalculateBlipAlpha(dist));
else
@@ -672,8 +700,8 @@ void CRadar::DrawBlips()
switch (ms_RadarTrace[blipId].m_eBlipType) {
case BLIP_COORD:
case BLIP_CONTACT_POINT:
- if (ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_BOMB && ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_SAVE
- && ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_SPRAY && ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_WEAPON
+ if (ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_SAVE
+ && ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_SPRAY && ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_GUN
&& (ms_RadarTrace[blipId].m_eBlipType != BLIP_CONTACT_POINT || !CTheScripts::IsPlayerOnAMission())) {
uint32 color = GetRadarTraceColour(ms_RadarTrace[blipId].m_nColor, ms_RadarTrace[blipId].m_bDim);
@@ -689,7 +717,7 @@ void CRadar::DrawBlips()
TransformRealWorldPointToRadarSpace(in, ms_RadarTrace[blipId].m_vec2DPos);
float dist = LimitRadarPoint(in);
TransformRadarPointToScreenSpace(out, in);
- if (!ms_RadarTrace[blipId].m_bShortRange || dist <= 1.0f || CMenuManager::bMenuMapActive) {
+ if (!ms_RadarTrace[blipId].m_bShortRange || dist <= 1.0f || FrontEndMenuManager.m_bMenuMapActive) {
if (ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_NONE)
DrawRadarSprite(ms_RadarTrace[blipId].m_eRadarSprite, out.x, out.y, CalculateBlipAlpha(dist));
else
@@ -716,7 +744,7 @@ void CRadar::DrawBlips()
}
}
#ifdef MENU_MAP
- if (CMenuManager::bMenuMapActive) {
+ if (FrontEndMenuManager.m_bMenuMapActive) {
CVector2D in, out;
TransformRealWorldPointToRadarSpace(in, FindPlayerCentreOfWorld_NoSniperShift());
TransformRadarPointToScreenSpace(out, in);
@@ -871,7 +899,7 @@ void CRadar::DrawRadarSprite(uint16 sprite, float x, float y, uint8 alpha)
{
RadarSprites[sprite]->Draw(CRect(x - SCREEN_SCALE_X(8.0f), y - SCREEN_SCALE_Y(8.0f), x + SCREEN_SCALE_X(8.0f), y + SCREEN_SCALE_Y(8.0f)), CRGBA(255, 255, 255, alpha));
#ifdef MENU_MAP
- if (CMenuManager::bMenuMapActive) {
+ if (FrontEndMenuManager.m_bMenuMapActive) {
bool alreadyThere = false;
for (int i = 0; i < NUM_MAP_LEGENDS; i++) {
if (MapLegendList[i] == sprite)
@@ -1019,7 +1047,7 @@ float CRadar::LimitRadarPoint(CVector2D &point)
dist = point.Magnitude();
#ifdef MENU_MAP
- if (CMenuManager::bMenuMapActive)
+ if (FrontEndMenuManager.m_bMenuMapActive)
return dist;
#endif
if (dist > 1.0f) {
@@ -1047,26 +1075,45 @@ CRadar::LoadTextures()
{
CTxdStore::PushCurrentTxd();
CTxdStore::SetCurrentTxd(CTxdStore::FindTxdSlot("hud"));
- AsukaSprite.SetTexture("radar_asuka");
- BombSprite.SetTexture("radar_bomb");
- CatSprite.SetTexture("radar_cat");
CentreSprite.SetTexture("radar_centre");
- CopcarSprite.SetTexture("radar_copcar");
- DonSprite.SetTexture("radar_don");
- EightSprite.SetTexture("radar_eight");
- ElSprite.SetTexture("radar_el");
- IceSprite.SetTexture("radar_ice");
- JoeySprite.SetTexture("radar_joey");
- KenjiSprite.SetTexture("radar_kenji");
- LizSprite.SetTexture("radar_liz");
- LuigiSprite.SetTexture("radar_luigi");
+ MapHereSprite.SetTexture("arrow");
NorthSprite.SetTexture("radar_north");
- RaySprite.SetTexture("radar_ray");
- SalSprite.SetTexture("radar_sal");
- SaveSprite.SetTexture("radar_save");
- SpraySprite.SetTexture("radar_spray");
- TonySprite.SetTexture("radar_tony");
- WeaponSprite.SetTexture("radar_weapon");
+ AverySprite.SetTexture("radar_avery");
+ BikerSprite.SetTexture("radar_biker");
+ CortezSprite.SetTexture("radar_cortez");
+ DiazSprite.SetTexture("radar_diaz");
+ KentSprite.SetTexture("radar_kent");
+ LawyerSprite.SetTexture("radar_lawyer");
+ PhilSprite.SetTexture("radar_phil");
+ BikersSprite.SetTexture("bikers");
+ BoatyardSprite.SetTexture("boatyard");
+ MalibuClubSprite.SetTexture("club");
+ CubansSprite.SetTexture("cubans");
+ FilmSprite.SetTexture("filmstudio");
+ GunSprite.SetTexture("gun");
+ HaitiansSprite.SetTexture("haitians");
+ HardwareSprite.SetTexture("hardware");
+ SaveHouseSprite.SetTexture("radar_save");
+ StripSprite.SetTexture("radar_strip");
+ IceSprite.SetTexture("icecream");
+ KCabsSprite.SetTexture("kcabs");
+ LovefistSprite.SetTexture("lovefist");
+ PrintworksSprite.SetTexture("printworks");
+ PropertySprite.SetTexture("property");
+ SunYardSprite.SetTexture("SunYard");
+ SpraySprite.SetTexture("spray");
+ TShirtSprite.SetTexture("tshirt");
+ TommySprite.SetTexture("tommy");
+ PhoneSprite.SetTexture("phone");
+ RadioWildstyleSprite.SetTexture("RWildstyle");
+ RadioFlashSprite.SetTexture("RFlash");
+ RadioKChatSprite.SetTexture("RKchat");
+ RadioFeverSprite.SetTexture("RFever");
+ RadioVRockSprite.SetTexture("RVRock");
+ RadioVCPRSprite.SetTexture("RVCPR");
+ RadioEspantosoSprite.SetTexture("REspantoso");
+ RadioEmotionSprite.SetTexture("REmotion");
+ RadioWaveSprite.SetTexture("RWave");
CTxdStore::PopCurrentTxd();
}
@@ -1231,7 +1278,7 @@ void CRadar::ShowRadarTraceWithHeight(float x, float y, uint32 size, uint8 red,
}
#ifdef MENU_MAP
// VC uses -1 for coords and -2 for entities but meh, I don't want to edit DrawBlips
- if (CMenuManager::bMenuMapActive) {
+ if (FrontEndMenuManager.m_bMenuMapActive) {
bool alreadyThere = false;
for (int i = 0; i < NUM_MAP_LEGENDS; i++) {
if (MapLegendList[i] == -1)
@@ -1248,26 +1295,45 @@ void CRadar::ShowRadarTraceWithHeight(float x, float y, uint32 size, uint8 red,
void CRadar::Shutdown()
{
- AsukaSprite.Delete();
- BombSprite.Delete();
- CatSprite.Delete();
CentreSprite.Delete();
- CopcarSprite.Delete();
- DonSprite.Delete();
- EightSprite.Delete();
- ElSprite.Delete();
- IceSprite.Delete();
- JoeySprite.Delete();
- KenjiSprite.Delete();
- LizSprite.Delete();
- LuigiSprite.Delete();
+ MapHereSprite.Delete();
NorthSprite.Delete();
- RaySprite.Delete();
- SalSprite.Delete();
- SaveSprite.Delete();
+ AverySprite.Delete();
+ BikerSprite.Delete();
+ CortezSprite.Delete();
+ DiazSprite.Delete();
+ KentSprite.Delete();
+ LawyerSprite.Delete();
+ PhilSprite.Delete();
+ BikersSprite.Delete();
+ BoatyardSprite.Delete();
+ MalibuClubSprite.Delete();
+ CubansSprite.Delete();
+ FilmSprite.Delete();
+ GunSprite.Delete();
+ HaitiansSprite.Delete();
+ HardwareSprite.Delete();
+ SaveHouseSprite.Delete();
+ StripSprite.Delete();
+ IceSprite.Delete();
+ KCabsSprite.Delete();
+ LovefistSprite.Delete();
+ PrintworksSprite.Delete();
+ PropertySprite.Delete();
+ SunYardSprite.Delete();
SpraySprite.Delete();
- TonySprite.Delete();
- WeaponSprite.Delete();
+ TShirtSprite.Delete();
+ TommySprite.Delete();
+ PhoneSprite.Delete();
+ RadioWildstyleSprite.Delete();
+ RadioFlashSprite.Delete();
+ RadioKChatSprite.Delete();
+ RadioFeverSprite.Delete();
+ RadioVRockSprite.Delete();
+ RadioVCPRSprite.Delete();
+ RadioEspantosoSprite.Delete();
+ RadioEmotionSprite.Delete();
+ RadioWaveSprite.Delete();
RemoveRadarSections();
}
@@ -1337,10 +1403,9 @@ void CRadar::TransformRadarPointToRealWorldSpace(CVector2D &out, const CVector2D
void CRadar::TransformRadarPointToScreenSpace(CVector2D &out, const CVector2D &in)
{
#ifdef MENU_MAP
- if (CMenuManager::bMenuMapActive) {
- // fMapSize is actually half map size. Radar range is 1000, so if x is -2000, in.x + 2.0f is 0.
- out.x = (CMenuManager::fMapCenterX - CMenuManager::fMapSize) + (in.x + 2.0f) * CMenuManager::fMapSize * 2.0f / 4.0f;
- out.y = (CMenuManager::fMapCenterY - CMenuManager::fMapSize) + (2.0f - in.y) * CMenuManager::fMapSize * 2.0f / 4.0f;
+ if (FrontEndMenuManager.m_bMenuMapActive) {
+ out.x = (FrontEndMenuManager.m_fMapCenterX - FrontEndMenuManager.m_fMapSize) + (MENU_MAP_LENGTH / 2 + MENU_MAP_LEFT_OFFSET + in.x) * FrontEndMenuManager.m_fMapSize * MENU_MAP_WIDTH_SCALE * 2.0f / MENU_MAP_LENGTH;
+ out.y = (FrontEndMenuManager.m_fMapCenterY - FrontEndMenuManager.m_fMapSize) + (MENU_MAP_LENGTH / 2 - MENU_MAP_TOP_OFFSET - in.y) * FrontEndMenuManager.m_fMapSize * MENU_MAP_HEIGHT_SCALE * 2.0f / MENU_MAP_LENGTH;
} else
#endif
{
@@ -1398,7 +1463,7 @@ CRadar::CalculateCachedSinCos()
{
if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN || TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOP_DOWN_PED
#ifdef MENU_MAP
- || CMenuManager::bMenuMapActive
+ || FrontEndMenuManager.m_bMenuMapActive
#endif
) {
cachedSin = 0.0f;
@@ -1428,7 +1493,7 @@ CRadar::InitFrontEndMap()
CalculateCachedSinCos();
vec2DRadarOrigin.x = 0.0f;
vec2DRadarOrigin.y = 0.0f;
- m_radarRange = 1000.0f; // doesn't mean anything, just affects the calculation in TransformRadarPointToScreenSpace
+ m_radarRange = MENU_MAP_LENGTH_UNIT; // just affects the multiplier in TransformRadarPointToScreenSpace
for (int i = 0; i < NUM_MAP_LEGENDS; i++) {
MapLegendList[i] = RADAR_SPRITE_NONE;
}
diff --git a/src/core/Radar.h b/src/core/Radar.h
index 43c9766a..61d94d05 100644
--- a/src/core/Radar.h
+++ b/src/core/Radar.h
@@ -1,6 +1,33 @@
#pragma once
#include "Sprite2d.h"
+#define CARBLIP_MARKER_COLOR_R 252
+#define CARBLIP_MARKER_COLOR_G 138
+#define CARBLIP_MARKER_COLOR_B 242
+#define CARBLIP_MARKER_COLOR_A 255
+
+#define CHARBLIP_MARKER_COLOR_R 252
+#define CHARBLIP_MARKER_COLOR_G 138
+#define CHARBLIP_MARKER_COLOR_B 242
+#define CHARBLIP_MARKER_COLOR_A 255
+
+#define OBJECTBLIP_MARKER_COLOR_R 252
+#define OBJECTBLIP_MARKER_COLOR_G 138
+#define OBJECTBLIP_MARKER_COLOR_B 242
+#define OBJECTBLIP_MARKER_COLOR_A 255
+
+#define COORDBLIP_MARKER_COLOR_R 252
+#define COORDBLIP_MARKER_COLOR_G 138
+#define COORDBLIP_MARKER_COLOR_B 242
+#define COORDBLIP_MARKER_COLOR_A 255
+
+#define MENU_MAP_LENGTH_UNIT 1190.0f // in game unit
+#define MENU_MAP_WIDTH_SCALE 1.112f // in game unit (originally 1.112494151260504f)
+#define MENU_MAP_HEIGHT_SCALE 1.119f // in game unit (originally 1.118714268907563f)
+#define MENU_MAP_TOP_OFFSET 0.28f // in length unit defined above - ~333 game unit
+#define MENU_MAP_LEFT_OFFSET 0.185f // in length unit defined above - ~220 game unit
+#define MENU_MAP_LENGTH (4000.f / MENU_MAP_LENGTH_UNIT)
+
enum eBlipType
{
BLIP_NONE,
@@ -26,27 +53,47 @@ enum eRadarSprite
RADAR_SPRITE_COORD_BLIP = -1,
#endif
RADAR_SPRITE_NONE = 0,
- RADAR_SPRITE_ASUKA = 1,
- RADAR_SPRITE_BOMB = 2,
- RADAR_SPRITE_CAT = 3,
- RADAR_SPRITE_CENTRE = 4,
- RADAR_SPRITE_COPCAR = 5,
- RADAR_SPRITE_DON = 6,
- RADAR_SPRITE_EIGHT = 7,
- RADAR_SPRITE_EL = 8,
- RADAR_SPRITE_ICE = 9,
- RADAR_SPRITE_JOEY = 10,
- RADAR_SPRITE_KENJI = 11,
- RADAR_SPRITE_LIZ = 12,
- RADAR_SPRITE_LUIGI = 13,
- RADAR_SPRITE_NORTH = 14,
- RADAR_SPRITE_RAY = 15,
- RADAR_SPRITE_SAL = 16,
- RADAR_SPRITE_SAVE = 17,
- RADAR_SPRITE_SPRAY = 18,
- RADAR_SPRITE_TONY = 19,
- RADAR_SPRITE_WEAPON = 20,
- RADAR_SPRITE_COUNT = 21,
+ RADAR_SPRITE_CENTRE,
+ RADAR_SPRITE_MAP_HERE,
+ RADAR_SPRITE_NORTH,
+ RADAR_SPRITE_AVERY,
+ RADAR_SPRITE_BIKER,
+ RADAR_SPRITE_CORTEZ,
+ RADAR_SPRITE_DIAZ,
+ RADAR_SPRITE_KENT,
+ RADAR_SPRITE_LAWYER,
+ RADAR_SPRITE_PHIL,
+ RADAR_SPRITE_BIKERS,
+ RADAR_SPRITE_BOATYARD,
+ RADAR_SPRITE_MALIBU_CLUB,
+ RADAR_SPRITE_CUBANS,
+ RADAR_SPRITE_FILM,
+ RADAR_SPRITE_GUN,
+ RADAR_SPRITE_HAITIANS,
+ RADAR_SPRITE_HARDWARE,
+ RADAR_SPRITE_SAVE,
+ RADAR_SPRITE_STRIP,
+ RADAR_SPRITE_ICE,
+ RADAR_SPRITE_KCABS,
+ RADAR_SPRITE_LOVEFIST,
+ RADAR_SPRITE_PRINTWORKS,
+ RADAR_SPRITE_PROPERTY,
+ RADAR_SPRITE_SUNYARD,
+ RADAR_SPRITE_SPRAY,
+ RADAR_SPRITE_TSHIRT,
+ RADAR_SPRITE_TOMMY,
+ RADAR_SPRITE_PHONE,
+ RADAR_SPRITE_RADIO_WILDSTYLE,
+ RADAR_SPRITE_RADIO_FLASH,
+ RADAR_SPRITE_RADIO_KCHAT,
+ RADAR_SPRITE_RADIO_FEVER,
+ RADAR_SPRITE_RADIO_VROCK,
+ RADAR_SPRITE_RADIO_VCPR,
+ RADAR_SPRITE_RADIO_ESPANTOSO,
+ RADAR_SPRITE_RADIO_EMOTION,
+ RADAR_SPRITE_RADIO_WAVE,
+
+ RADAR_SPRITE_COUNT
};
enum
@@ -84,34 +131,53 @@ class CRadar
public:
static float m_radarRange;
static sRadarTrace ms_RadarTrace[NUMRADARBLIPS];
- static CSprite2d AsukaSprite;
- static CSprite2d BombSprite;
- static CSprite2d CatSprite;
static CSprite2d CentreSprite;
- static CSprite2d CopcarSprite;
- static CSprite2d DonSprite;
- static CSprite2d EightSprite;
- static CSprite2d ElSprite;
- static CSprite2d IceSprite;
- static CSprite2d JoeySprite;
- static CSprite2d KenjiSprite;
- static CSprite2d LizSprite;
- static CSprite2d LuigiSprite;
+ static CSprite2d MapHereSprite;
static CSprite2d NorthSprite;
- static CSprite2d RaySprite;
- static CSprite2d SalSprite;
- static CSprite2d SaveSprite;
+ static CSprite2d AverySprite;
+ static CSprite2d BikerSprite;
+ static CSprite2d CortezSprite;
+ static CSprite2d DiazSprite;
+ static CSprite2d KentSprite;
+ static CSprite2d LawyerSprite;
+ static CSprite2d PhilSprite;
+ static CSprite2d BikersSprite;
+ static CSprite2d BoatyardSprite;
+ static CSprite2d MalibuClubSprite;
+ static CSprite2d CubansSprite;
+ static CSprite2d FilmSprite;
+ static CSprite2d GunSprite;
+ static CSprite2d HaitiansSprite;
+ static CSprite2d HardwareSprite;
+ static CSprite2d SaveHouseSprite;
+ static CSprite2d StripSprite;
+ static CSprite2d IceSprite;
+ static CSprite2d KCabsSprite;
+ static CSprite2d LovefistSprite;
+ static CSprite2d PrintworksSprite;
+ static CSprite2d PropertySprite;
+ static CSprite2d SunYardSprite;
static CSprite2d SpraySprite;
- static CSprite2d TonySprite;
- static CSprite2d WeaponSprite;
- static CSprite2d *RadarSprites[21];
+ static CSprite2d TShirtSprite;
+ static CSprite2d TommySprite;
+ static CSprite2d PhoneSprite;
+ static CSprite2d RadioWildstyleSprite;
+ static CSprite2d RadioFlashSprite;
+ static CSprite2d RadioKChatSprite;
+ static CSprite2d RadioFeverSprite;
+ static CSprite2d RadioVRockSprite;
+ static CSprite2d RadioVCPRSprite;
+ static CSprite2d RadioEspantosoSprite;
+ static CSprite2d RadioEmotionSprite;
+ static CSprite2d RadioWaveSprite;
+ static CSprite2d *RadarSprites[RADAR_SPRITE_COUNT];
static float cachedCos;
static float cachedSin;
#ifdef MENU_MAP
#define NUM_MAP_LEGENDS 75
static CRGBA ArrowBlipColour1;
static CRGBA ArrowBlipColour2;
- static uint16 MapLegendList[NUM_MAP_LEGENDS];
+ static int16 MapLegendList[NUM_MAP_LEGENDS];
static uint16 MapLegendCounter;
static int TargetMarkerId;
static CVector TargetMarkerPos;
diff --git a/src/core/Stats.cpp b/src/core/Stats.cpp
index ea934dca..3f930d49 100644
--- a/src/core/Stats.cpp
+++ b/src/core/Stats.cpp
@@ -57,9 +57,13 @@ int32 CStats::mmRain;
int32 CStats::CarsCrushed;
int32 CStats::FastestTimes[CStats::TOTAL_FASTEST_TIMES];
int32 CStats::HighestScores[CStats::TOTAL_HIGHEST_SCORES];
+int32 CStats::PropertyDestroyed;
int32 CStats::Sprayings;
float CStats::AutoPaintingBudget;
+int32 CStats::NoMoreHurricanes;
+float CStats::FashionBudget;
+int32 CStats::SafeHouseVisits;
void CStats::Init()
{
@@ -119,6 +123,8 @@ void CStats::Init()
Sprayings = 0;
AutoPaintingBudget = 0.0f;
+ NoMoreHurricanes = 0;
+ SafeHouseVisits = 0;
}
void CStats::RegisterFastestTime(int32 index, int32 time)
@@ -247,6 +253,19 @@ int32 CStats::FindCriminalRatingNumber()
return rating;
}
+float CStats::GetPercentageProgress()
+{
+ float percentCompleted = (CStats::TotalProgressInGame == 0 ? 0 :
+ CStats::ProgressMade * 100.0f / (CGame::nastyGame ? CStats::TotalProgressInGame : CStats::TotalProgressInGame - 1.0f));
+
+ return Min(percentCompleted, 100.0f);
+}
+
+void CStats::MoneySpentOnFashion(int32 money)
+{
+ FashionBudget += money;
+}
+
void CStats::SaveStats(uint8 *buf, uint32 *size)
{
CheckPointReachedSuccessfully();
diff --git a/src/core/Stats.h b/src/core/Stats.h
index 51f1d091..37987ae5 100644
--- a/src/core/Stats.h
+++ b/src/core/Stats.h
@@ -10,7 +10,7 @@ public:
TOTAL_HIGHEST_SCORES = 16
};
static int32 DaysPassed;
- static int32 HeadsPopped;
+ static int32 HeadsPopped;
static int32 CommercialPassed;
static int32 IndustrialPassed;
static int32 SuburbanPassed;
@@ -52,18 +52,22 @@ public:
static int32 LongestFlightInDodo;
static int32 TimeTakenDefuseMission;
static int32 TotalNumberKillFrenzies;
- static int32 TotalNumberMissions;
- static int32 RoundsFiredByPlayer;
- static int32 KgsOfExplosivesUsed;
- static int32 InstantHitsFiredByPlayer;
- static int32 InstantHitsHitByPlayer;
- static int32 BestTimeBombDefusal;
- static int32 mmRain;
- static int32 CarsCrushed;
+ static int32 TotalNumberMissions;
+ static int32 RoundsFiredByPlayer;
+ static int32 KgsOfExplosivesUsed;
+ static int32 InstantHitsFiredByPlayer;
+ static int32 InstantHitsHitByPlayer;
+ static int32 BestTimeBombDefusal;
+ static int32 mmRain;
+ static int32 CarsCrushed;
static int32 FastestTimes[TOTAL_FASTEST_TIMES];
static int32 HighestScores[TOTAL_HIGHEST_SCORES];
+ static int32 PropertyDestroyed;
static int32 Sprayings;
static float AutoPaintingBudget;
+ static int32 NoMoreHurricanes;
+ static float FashionBudget;
+ static int32 SafeHouseVisits;
public:
static void Init(void);
@@ -89,4 +93,7 @@ public:
static int32 FindCriminalRatingNumber();
static void SaveStats(uint8 *buf, uint32 *size);
static void LoadStats(uint8 *buf, uint32 size);
+ static float GetPercentageProgress();
+
+ static void MoneySpentOnFashion(int32);
};
diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp
index e854da59..985b28c9 100644
--- a/src/core/Streaming.cpp
+++ b/src/core/Streaming.cpp
@@ -1337,8 +1337,7 @@ CStreaming::LoadInitialPeds(void)
void
CStreaming::LoadInitialWeapons(void)
{
- // TODO(Miami): Enable when weapons have been ported
- //CStreaming::RequestModel(MI_NIGHTSTICK, STREAMFLAGS_DONT_REMOVE);
+ CStreaming::RequestModel(MI_NIGHTSTICK, STREAMFLAGS_DONT_REMOVE);
CStreaming::RequestModel(MI_MISSILE, STREAMFLAGS_DONT_REMOVE);
}
@@ -1450,7 +1449,8 @@ CStreaming::StreamVehiclesAndPeds(void)
timeBeforeNextLoad--;
else if(ms_numVehiclesLoaded <= desiredNumVehiclesLoaded){
CZoneInfo zone;
- CTheZones::GetZoneInfoForTimeOfDay(&FindPlayerCoors(), &zone);
+ CVector coors = FindPlayerCoors();
+ CTheZones::GetZoneInfoForTimeOfDay(&coors, &zone);
int32 maxReq = -1;
int32 mostRequestedRating = 0;
for(i = 0; i < CCarCtrl::TOTAL_CUSTOM_CLASSES; i++){
@@ -1524,26 +1524,26 @@ CStreaming::StreamZoneModels(const CVector &pos)
bit = 1<<i;
if(gangsToLoad & bit && (ms_loadedGangs & bit) == 0){
- RequestModel(MI_GANG01 + i*2, STREAMFLAGS_DEPENDENCY);
- RequestModel(MI_GANG01 + i*2 + 1, STREAMFLAGS_DEPENDENCY);
+ RequestModel(CGangs::GetGangPedModel1(i), STREAMFLAGS_DEPENDENCY);
+ RequestModel(CGangs::GetGangPedModel2(i), STREAMFLAGS_DEPENDENCY);
ms_loadedGangs |= bit;
}else if((gangsToLoad & bit) == 0 && ms_loadedGangs & bit){
- SetModelIsDeletable(MI_GANG01 + i*2);
- SetModelIsDeletable(MI_GANG01 + i*2 + 1);
- SetModelTxdIsDeletable(MI_GANG01 + i*2);
- SetModelTxdIsDeletable(MI_GANG01 + i*2 + 1);
+ SetModelIsDeletable(CGangs::GetGangPedModel1(i));
+ SetModelIsDeletable(CGangs::GetGangPedModel2(i));
+ SetModelTxdIsDeletable(CGangs::GetGangPedModel1(i));
+ SetModelTxdIsDeletable(CGangs::GetGangPedModel2(i));
ms_loadedGangs &= ~bit;
}
// TODO(MIAMI): check this
- if(CGangs::GetGangInfo(i)->m_nVehicleMI < 0)
+ if(CGangs::GetGangVehicleModel(i) < 0)
continue;
if((gangCarsToLoad & bit) && (ms_loadedGangCars & bit) == 0){
- RequestModel(CGangs::GetGangInfo(i)->m_nVehicleMI, STREAMFLAGS_DEPENDENCY);
+ RequestModel(CGangs::GetGangVehicleModel(i), STREAMFLAGS_DEPENDENCY);
}else if((gangCarsToLoad & bit) == 0 && ms_loadedGangCars & bit){
- SetModelIsDeletable(CGangs::GetGangInfo(i)->m_nVehicleMI);
- SetModelTxdIsDeletable(CGangs::GetGangInfo(i)->m_nVehicleMI);
+ SetModelIsDeletable(CGangs::GetGangVehicleModel(i));
+ SetModelTxdIsDeletable(CGangs::GetGangVehicleModel(i));
}
}
ms_loadedGangCars = gangCarsToLoad;
@@ -1563,10 +1563,10 @@ CStreaming::RemoveCurrentZonesModels(void)
}
for(i = 0; i < NUM_GANGS; i++){
- SetModelIsDeletable(MI_GANG01 + i*2);
- SetModelIsDeletable(MI_GANG01 + i*2 + 1);
- if(CGangs::GetGangInfo(i)->m_nVehicleMI != -1)
- SetModelIsDeletable(CGangs::GetGangInfo(i)->m_nVehicleMI);
+ SetModelIsDeletable(CGangs::GetGangPedModel1(i));
+ SetModelIsDeletable(CGangs::GetGangPedModel2(i));
+ if(CGangs::GetGangVehicleModel(i) != -1)
+ SetModelIsDeletable(CGangs::GetGangVehicleModel(i));
}
ms_currentPedGrp = -1;
diff --git a/src/core/SurfaceTable.cpp b/src/core/SurfaceTable.cpp
index 08a84cfd..9076a9a6 100644
--- a/src/core/SurfaceTable.cpp
+++ b/src/core/SurfaceTable.cpp
@@ -56,40 +56,42 @@ int
CSurfaceTable::GetAdhesionGroup(uint8 surfaceType)
{
switch(surfaceType){
- case SURFACE_0: return ADHESIVE_ROAD;
- case SURFACE_1: return ADHESIVE_ROAD;
- case SURFACE_2: return ADHESIVE_LOOSE;
- case SURFACE_3: return ADHESIVE_LOOSE;
- case SURFACE_4: return ADHESIVE_HARD;
- case SURFACE_5: return ADHESIVE_ROAD;
- case SURFACE_6: return ADHESIVE_HARD;
- case SURFACE_7: return ADHESIVE_HARD;
- case SURFACE_8: return ADHESIVE_HARD;
- case SURFACE_9: return ADHESIVE_HARD;
- case SURFACE_10: return ADHESIVE_HARD;
- case SURFACE_11: return ADHESIVE_HARD;
- case SURFACE_12: return ADHESIVE_HARD;
- case SURFACE_13: return ADHESIVE_HARD;
- case SURFACE_14: return ADHESIVE_HARD;
- case SURFACE_15: return ADHESIVE_HARD;
- case SURFACE_16: return ADHESIVE_HARD;
- case SURFACE_17: return ADHESIVE_RUBBER;
- case SURFACE_18: return ADHESIVE_LOOSE;
- case SURFACE_19: return ADHESIVE_WET;
- case SURFACE_20: return ADHESIVE_ROAD;
- case SURFACE_21: return ADHESIVE_ROAD;
- case SURFACE_22: return ADHESIVE_ROAD;
- case SURFACE_23: return ADHESIVE_RUBBER;
- case SURFACE_24: return ADHESIVE_HARD;
- case SURFACE_25: return ADHESIVE_LOOSE;
- case SURFACE_26: return ADHESIVE_LOOSE;
- case SURFACE_27: return ADHESIVE_HARD;
- case SURFACE_28: return ADHESIVE_HARD;
- case SURFACE_29: return ADHESIVE_RUBBER;
- case SURFACE_30: return ADHESIVE_LOOSE;
- case SURFACE_31: return ADHESIVE_HARD;
- case SURFACE_32: return ADHESIVE_HARD;
- default: return ADHESIVE_ROAD;
+ case SURFACE_DEFAULT: return ADHESIVE_ROAD;
+ case SURFACE_TARMAC: return ADHESIVE_ROAD;
+ case SURFACE_GRASS: return ADHESIVE_LOOSE;
+ case SURFACE_GRAVEL: return ADHESIVE_LOOSE;
+ case SURFACE_MUD_DRY: return ADHESIVE_HARD;
+ case SURFACE_PAVEMENT: return ADHESIVE_ROAD;
+ case SURFACE_CAR: return ADHESIVE_HARD;
+ case SURFACE_GLASS: return ADHESIVE_HARD;
+ 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_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_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;
}
}
@@ -97,40 +99,45 @@ float
CSurfaceTable::GetWetMultiplier(uint8 surfaceType)
{
switch(surfaceType){
- case SURFACE_0:
- case SURFACE_1:
- case SURFACE_4:
- case SURFACE_5:
- case SURFACE_8:
- case SURFACE_20:
- case SURFACE_21:
- case SURFACE_22:
- case SURFACE_25:
- case SURFACE_30:
- case SURFACE_31:
+ case SURFACE_DEFAULT:
+ case SURFACE_TARMAC:
+ case SURFACE_MUD_DRY:
+ case SURFACE_PAVEMENT:
+ case SURFACE_TRANSPARENT_CLOTH:
+ case SURFACE_WOOD_CRATES:
+ case SURFACE_WOOD_BENCH:
+ case SURFACE_WOOD_SOLID:
+ case SURFACE_HEDGE:
+ case SURFACE_CARDBOARDBOX:
+ case SURFACE_TRANSPARENT_STONE:
+ case SURFACE_CONCRETE_BEACH:
return 1.0f - CWeather::WetRoads*0.25f;
- case SURFACE_2:
- case SURFACE_6:
- case SURFACE_7:
- case SURFACE_9:
- case SURFACE_10:
- case SURFACE_11:
- case SURFACE_12:
- case SURFACE_13:
- case SURFACE_14:
- case SURFACE_15:
- case SURFACE_16:
- case SURFACE_17:
- case SURFACE_23:
- case SURFACE_24:
- case SURFACE_26:
- case SURFACE_27:
- case SURFACE_28:
- case SURFACE_29:
- case SURFACE_32:
+ case SURFACE_GRASS:
+ case SURFACE_CAR:
+ case SURFACE_GLASS:
+ 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_SAND_BEACH:
+ return 1.0f - CWeather::WetRoads*0.5f;
+
default:
return 1.0f;
}
diff --git a/src/core/SurfaceTable.h b/src/core/SurfaceTable.h
index 12246dce..d8f9be3d 100644
--- a/src/core/SurfaceTable.h
+++ b/src/core/SurfaceTable.h
@@ -1,86 +1,42 @@
#pragma once
-
-enum
-{
- SURFACE_0,
- SURFACE_1,
- SURFACE_2,
- SURFACE_3,
- SURFACE_4,
- SURFACE_5,
- SURFACE_6,
- SURFACE_7,
- SURFACE_8,
- SURFACE_9,
- SURFACE_10,
- SURFACE_11,
- SURFACE_12,
- SURFACE_13,
- SURFACE_14,
- SURFACE_15,
- SURFACE_16,
- SURFACE_17,
- SURFACE_18,
- SURFACE_19,
- SURFACE_20,
- SURFACE_21,
- SURFACE_22,
- SURFACE_23,
- SURFACE_24,
- SURFACE_25,
- SURFACE_26,
- SURFACE_27,
- SURFACE_28,
- SURFACE_29,
- SURFACE_30,
- SURFACE_31,
- SURFACE_32,
-
- NUMSURFACETYPES
-};
-
-// From nick
-// TODO: check and use 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,
-
- // These are illegal
- 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
@@ -89,6 +45,7 @@ enum
ADHESIVE_HARD,
ADHESIVE_ROAD,
ADHESIVE_LOOSE,
+ ADHESIVE_SAND,
ADHESIVE_WET,
NUMADHESIVEGROUPS
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/Timer.h b/src/core/Timer.h
index 004cda4d..e7b6fec8 100644
--- a/src/core/Timer.h
+++ b/src/core/Timer.h
@@ -58,7 +58,7 @@ public:
friend bool GenericSave(int file);
#ifdef FIX_BUGS
- static float GetDefaultTimeStep(void) { return 5.0f / 3.0f; }
+ static float GetDefaultTimeStep(void) { return 50.0f / 30.0f; }
static float GetTimeStepFix(void) { return GetTimeStep() / GetDefaultTimeStep(); }
#endif
};
diff --git a/src/core/World.cpp b/src/core/World.cpp
index 8c69d846..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;
@@ -340,21 +342,6 @@ CWorld::ProcessLineOfSightSectorList(CPtrList &list, const CColLine &line, CColP
if(e->IsPed()) {
if(e->bUsesCollision || deadPeds && ((CPed *)e)->m_nPedState == PED_DEAD) {
colmodel = ((CPedModelInfo *)CModelInfo::GetModelInfo(e->GetModelIndex()))->AnimatePedColModelSkinned(e->GetClump());
-/* this should all be gone, right?
- if(((CPed *)e)->UseGroundColModel())
- colmodel = &CTempColModels::ms_colModelPedGroundHit;
- else
-#ifdef ANIMATE_PED_COL_MODEL
- colmodel = CPedModelInfo::AnimatePedColModel(
- ((CPedModelInfo *)CModelInfo::GetModelInfo(e->GetModelIndex()))
- ->GetHitColModel(),
- RpClumpGetFrame(e->GetClump()));
-#else
- colmodel =
- ((CPedModelInfo *)CModelInfo::GetModelInfo(e->GetModelIndex()))
- ->GetHitColModel();
-#endif
-*/
} else
colmodel = nil;
@@ -362,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;
}
}
@@ -451,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;
}
}
@@ -652,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;
}
}
@@ -1828,18 +1815,21 @@ void
CWorld::RepositionOneObject(CEntity *pEntity)
{
int16 modelId = pEntity->GetModelIndex();
- if (IsTrafficLight(modelId) || IsTreeModel(modelId) || modelId == MI_PARKINGMETER ||
- modelId == MI_PHONEBOOTH1 || modelId == MI_WASTEBIN || modelId == MI_BIN || modelId == MI_POSTBOX1 ||
- modelId == MI_NEWSSTAND || modelId == MI_TRAFFICCONE || modelId == MI_DUMP1 ||
- modelId == MI_ROADWORKBARRIER1 || modelId == MI_BUSSIGN1 || modelId == MI_NOPARKINGSIGN1 ||
- modelId == MI_PHONESIGN || modelId == MI_TAXISIGN || modelId == MI_FISHSTALL01 ||
- modelId == MI_FISHSTALL02 || modelId == MI_FISHSTALL03 || modelId == MI_FISHSTALL04 ||
- modelId == MI_BAGELSTAND2 || modelId == MI_FIRE_HYDRANT || modelId == MI_BOLLARDLIGHT ||
- modelId == MI_PARKTABLE) {
+ if (modelId == MI_PARKINGMETER || modelId == MI_PHONEBOOTH1 || modelId == MI_WASTEBIN ||
+ modelId == MI_BIN || modelId == MI_POSTBOX1 || modelId == MI_NEWSSTAND || modelId == MI_TRAFFICCONE ||
+ modelId == MI_DUMP1 || modelId == MI_ROADWORKBARRIER1 || modelId == MI_BUSSIGN1 || modelId == MI_NOPARKINGSIGN1 ||
+ modelId == MI_PHONESIGN || modelId == MI_FIRE_HYDRANT || modelId == MI_BOLLARDLIGHT ||
+ modelId == MI_PARKTABLE || modelId == MI_PARKINGMETER2 || modelId == MI_TELPOLE02 ||
+ modelId == MI_PARKBENCH || modelId == MI_BARRIER1 || IsTreeModel(modelId) ||
+ IsLightThatNeedsRepositioning(modelId)
+ ) {
CVector &position = pEntity->GetMatrix().GetPosition();
- float fBoundingBoxMinZ = pEntity->GetColModel()->boundingBox.min.z;
+ CColModel *pColModel = pEntity->GetColModel();
+ float fBoundingBoxMinZ = pColModel->boundingBox.min.z;
+ float fHeight = pColModel->boundingBox.max.z - pColModel->boundingBox.min.z;
+ if(fHeight < OBJECT_REPOSITION_OFFSET_Z) fHeight = OBJECT_REPOSITION_OFFSET_Z;
position.z = CWorld::FindGroundZFor3DCoord(position.x, position.y,
- position.z + OBJECT_REPOSITION_OFFSET_Z, nil) -
+ position.z + fHeight, nil) -
fBoundingBoxMinZ;
pEntity->m_matrix.UpdateRW();
pEntity->UpdateRwFrame();
@@ -2240,3 +2230,58 @@ CWorld::UseDetonator(CEntity *pEntity)
}
CProjectileInfo::RemoveDetonatorProjectiles();
}
+
+bool
+CWorld::IsWanderPathClear(CVector const& point1, CVector const& point2, float distance, int maxSteps)
+{
+ if (Abs(point1.z - point2.z) > distance)
+ return false;
+ if (!GetIsLineOfSightClear(point1, point2, true, false, false, false, false, false, false))
+ return false;
+ CVector vecBetween = point2 - point1;
+ uint32 nSteps = Max(vecBetween.Magnitude(), maxSteps);
+ if (nSteps == 0)
+ return true;
+ vecBetween.Normalise();
+ uint32 step = 1;
+ for (step = 1; step < nSteps; step++) {
+ CVector posThisStep = point1 + vecBetween * step;
+ float level;
+ if (!CWaterLevel::GetWaterLevel(posThisStep, &level, false))
+ continue;
+ posThisStep.z = level;
+ AdvanceCurrentScanCode();
+
+ CVector vecCheckedPos(posThisStep.x, posThisStep.y, Max(point1.z, point2.z));
+ CColPoint colpoint;
+ CEntity* entity;
+ if (!ProcessVerticalLineSector(*GetSector(GetSectorIndexX(posThisStep.x), GetSectorIndexY(posThisStep.y)),
+ CColLine(posThisStep, vecCheckedPos), colpoint, entity, true, false, false, false, false, false, nil))
+ return false;
+ }
+
+ CVector posThisStep = point1;
+ AdvanceCurrentScanCode();
+ CVector vecCheckedPos(posThisStep.x, posThisStep.y, point1.z - 5.0f);
+
+ CColPoint colpoint;
+ CEntity* entity;
+ if (!ProcessVerticalLineSector(*GetSector(GetSectorIndexX(posThisStep.x), GetSectorIndexY(posThisStep.y)),
+ CColLine(posThisStep, vecCheckedPos), colpoint, entity, true, false, false, false, false, false, nil))
+ return false;
+
+ float heightNextStep = colpoint.point.z + 0.5f;
+ for (step = 1; step < nSteps; step++) {
+ CVector posThisStep = point1 + vecBetween * step;
+ posThisStep.z = heightNextStep;
+ AdvanceCurrentScanCode();
+ CVector vecCheckedPos(posThisStep.x, posThisStep.y, heightNextStep - 2.0f);
+ if (!ProcessVerticalLineSector(*GetSector(GetSectorIndexX(posThisStep.x), GetSectorIndexY(posThisStep.y)),
+ CColLine(posThisStep, vecCheckedPos), colpoint, entity, true, false, false, false, false, false, nil))
+ return false;
+ if (Abs(colpoint.point.z - heightNextStep) > 1.0f)
+ return false;
+ heightNextStep = colpoint.point.z + 0.5f;
+ }
+ return true;
+}
diff --git a/src/core/World.h b/src/core/World.h
index bc905bf5..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);
@@ -125,6 +126,8 @@ public:
static void CallOffChaseForAreaSectorListVehicles(CPtrList& list, float x1, float y1, float x2, float y2, float fStartX, float fStartY, float fEndX, float fEndY);
static void CallOffChaseForAreaSectorListPeds(CPtrList& list, float x1, float y1, float x2, float y2);
+ static bool IsWanderPathClear(CVector const&, CVector const&, float, int);
+
static float GetSectorX(float f) { return ((f - WORLD_MIN_X)/SECTOR_SIZE_X); }
static float GetSectorY(float f) { return ((f - WORLD_MIN_Y)/SECTOR_SIZE_Y); }
static int GetSectorIndexX(float f) { return (int)GetSectorX(f); }
diff --git a/src/core/Zones.cpp b/src/core/Zones.cpp
index 8e73a07b..84b5ca29 100644
--- a/src/core/Zones.cpp
+++ b/src/core/Zones.cpp
@@ -112,6 +112,7 @@ CTheZones::Init(void)
memset(&MapZoneArray[i], 0, sizeof(CZone));
MapZoneArray[i].type = ZONE_MAPZONE;
}
+ TotalNumberOfMapZones = 1;
strcpy(MapZoneArray[0].name, "THEMAP");
MapZoneArray[0].minx = -2400.0f;
MapZoneArray[0].miny = -2000.0f;
@@ -724,17 +725,17 @@ CTheZones::LoadAllZones(uint8 *buffer, uint32 size)
for(i = 0; i < ARRAY_SIZE(NavigationZoneArray); i++){
NavigationZoneArray[i] = ReadSaveBuf<CZone>(buffer);
- NavigationZoneArray[i].child = GetPointerForZoneIndex((int32)NavigationZoneArray[i].child);
- NavigationZoneArray[i].parent = GetPointerForZoneIndex((int32)NavigationZoneArray[i].parent);
- NavigationZoneArray[i].next = GetPointerForZoneIndex((int32)NavigationZoneArray[i].next);
+ NavigationZoneArray[i].child = GetPointerForZoneIndex((uintptr)NavigationZoneArray[i].child);
+ NavigationZoneArray[i].parent = GetPointerForZoneIndex((uintptr)NavigationZoneArray[i].parent);
+ NavigationZoneArray[i].next = GetPointerForZoneIndex((uintptr)NavigationZoneArray[i].next);
}
for(i = 0; i < ARRAY_SIZE(InfoZoneArray); i++){
InfoZoneArray[i] = ReadSaveBuf<CZone>(buffer);
- InfoZoneArray[i].child = GetPointerForZoneIndex((int32)InfoZoneArray[i].child);
- InfoZoneArray[i].parent = GetPointerForZoneIndex((int32)InfoZoneArray[i].parent);
- InfoZoneArray[i].next = GetPointerForZoneIndex((int32)InfoZoneArray[i].next);
+ InfoZoneArray[i].child = GetPointerForZoneIndex((uintptr)InfoZoneArray[i].child);
+ InfoZoneArray[i].parent = GetPointerForZoneIndex((uintptr)InfoZoneArray[i].parent);
+ InfoZoneArray[i].next = GetPointerForZoneIndex((uintptr)InfoZoneArray[i].next);
}
for(i = 0; i < ARRAY_SIZE(ZoneInfoArray); i++)
diff --git a/src/core/config.h b/src/core/config.h
index 30f6b898..ea31a3c8 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -66,7 +66,7 @@ enum Config {
// Cull zones
NUMATTRIBZONES = 704,
- NUMHANDLINGS = 106,
+ NUMOCCLUSIONVOLUMES = 350,
PATHNODESIZE = 4500,
@@ -95,7 +95,7 @@ enum Config {
NUMPACMANPICKUPS = 256,
NUMEVENTS = 64,
- NUM_CARGENS = 160,
+ NUM_CARGENS = 185,
NUM_PATH_NODES_IN_AUTOPILOT = 8,
@@ -135,6 +135,8 @@ enum Config {
NUM_CRANES = 8,
NUM_EXPLOSIONS = 48,
+
+ NUM_SETPIECES = 96
};
// We'll use this once we're ready to become independent of the game
@@ -194,15 +196,13 @@ enum Config {
#define FIX_BUGS // fixes bugs that we've came across during reversing, TODO: use this more
#define TOGGLEABLE_BETA_FEATURES // toggleable from debug menu. not too many things
-#define MORE_LANGUAGES // Add more translations to the game
+//#define MORE_LANGUAGES // Add more translations to the game
#define DEFAULT_NATIVE_RESOLUTION // Set default video mode to your native resolution (fixes Windows 10 launch)
#define USE_TXD_CDIMAGE // generate and load textures from txd.img
#define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number
//#define USE_TEXTURE_POOL
-#ifdef _WIN32
-#define AUDIO_MSS
-#else
-#define AUDIO_OAL
+#ifdef DEBUGMENU
+#define RELOADABLES // some debug menu options to reload TXD files
#endif
// Particle
@@ -222,7 +222,6 @@ enum Config {
// Hud, frontend and radar
#define ASPECT_RATIO_SCALE // Not just makes everything scale with aspect ratio, also adds support for all aspect ratios
#define TRIANGULAR_BLIPS // height indicating triangular radar blips, as in VC
-#define PS2_SAVE_DIALOG // PS2 style save dialog with transparent black box
// #define PS2_LIKE_MENU // An effort to recreate PS2 menu, cycling through tabs, different bg etc.
#define MENU_MAP // VC-like menu map. Make sure you have new menu.txd
#define SCROLLABLE_STATS_PAGE // only draggable by mouse atm
diff --git a/src/core/main.cpp b/src/core/main.cpp
index dc61f03f..aefabfc7 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -81,7 +81,7 @@ RwRGBA gColourTop;
bool gameAlreadyInitialised;
float NumberOfChunksLoaded;
-#define TOTALNUMCHUNKS 73.0f
+#define TOTALNUMCHUNKS 95.0f
bool g_SlowMode = false;
char version_name[64];
@@ -137,9 +137,10 @@ DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomR
CRGBA TopColor(TopRed, TopGreen, TopBlue, Alpha);
CRGBA BottomColor(BottomRed, BottomGreen, BottomBlue, Alpha);
+ CDraw::CalculateAspectRatio();
CameraSize(Scene.camera, nil, SCREEN_VIEWWINDOW, SCREEN_ASPECT_RATIO);
CVisibilityPlugins::SetRenderWareCamera(Scene.camera);
- RwCameraClear(Scene.camera, &gColourTop, rwCAMERACLEARZ);
+ RwCameraClear(Scene.camera, &TopColor.rwRGBA, rwCAMERACLEARZ);
if(!RsCameraBeginUpdate(Scene.camera))
return false;
@@ -155,6 +156,7 @@ DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomR
bool
DoRWStuffStartOfFrame_Horizon(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha)
{
+ CDraw::CalculateAspectRatio();
CameraSize(Scene.camera, nil, SCREEN_VIEWWINDOW, SCREEN_ASPECT_RATIO);
CVisibilityPlugins::SetRenderWareCamera(Scene.camera);
RwCameraClear(Scene.camera, &gColourTop, rwCAMERACLEARZ);
@@ -199,13 +201,13 @@ DoFade(void)
}
}
- if(CDraw::FadeValue != 0 || CMenuManager::m_PrefsBrightness < 256){
+ if(CDraw::FadeValue != 0 || FrontEndMenuManager.m_PrefsBrightness < 256){
CSprite2d *splash = LoadSplash(nil);
CRGBA fadeColor;
CRect rect;
int fadeValue = CDraw::FadeValue;
- float brightness = Min(CMenuManager::m_PrefsBrightness, 256);
+ float brightness = Min(FrontEndMenuManager.m_PrefsBrightness, 256);
if(brightness <= 50)
brightness = 50;
if(FrontEndMenuManager.m_bMenuActive)
@@ -328,7 +330,7 @@ PluginAttach(void)
static RwBool
Initialise3D(void *param)
{
- if (RsRwInitialise(param))
+ if (RsRwInitialize(param))
{
#ifdef DEBUGMENU
DebugMenuInit();
@@ -356,6 +358,7 @@ Terminate3D(void)
CSprite2d splash;
int splashTxdId = -1;
+//--MIAMI: done
CSprite2d*
LoadSplash(const char *name)
{
@@ -401,22 +404,23 @@ DestroySplashScreen(void)
splashTxdId = -1;
}
+//--MIAMI: done
Const char*
GetRandomSplashScreen(void)
{
int index;
static int index2 = 0;
static char splashName[128];
- static int splashIndex[24] = {
- 25, 22, 4, 13,
- 1, 21, 14, 16,
- 10, 12, 5, 9,
- 11, 18, 3, 2,
- 19, 23, 7, 17,
- 15, 6, 8, 20
+ static int splashIndex[12] = {
+ 1, 2,
+ 3, 4,
+ 5, 11,
+ 6, 8,
+ 9, 10,
+ 7, 12
};
- index = splashIndex[4*index2 + CGeneral::GetRandomNumberInRange(0, 3)];
+ index = splashIndex[2*index2 + CGeneral::GetRandomNumberInRange(0, 2)];
index2++;
if(index2 == 6)
index2 = 0;
@@ -443,17 +447,14 @@ ResetLoadingScreenBar()
NumberOfChunksLoaded = 0.0f;
}
-// TODO: compare with PS2
+//--MIAMI: done
void
LoadingScreen(const char *str1, const char *str2, const char *splashscreen)
{
CSprite2d *splash;
#ifndef RANDOMSPLASH
- if(CGame::frenchGame || CGame::germanGame || !CGame::nastyGame)
- splashscreen = "mainsc2";
- else
- splashscreen = "mainsc1";
+ splashscreen = "LOADSC0";
#endif
splash = LoadSplash(splashscreen);
@@ -474,36 +475,50 @@ LoadingScreen(const char *str1, const char *str2, const char *splashscreen)
if(str1){
NumberOfChunksLoaded += 1;
+#ifndef RANDOMSPLASH
float hpos = SCREEN_SCALE_X(40);
- float length = SCREEN_WIDTH - SCREEN_SCALE_X(100);
- float vpos = SCREEN_HEIGHT - SCREEN_SCALE_Y(13);
- float height = SCREEN_SCALE_Y(7);
- CSprite2d::DrawRect(CRect(hpos, vpos, hpos + length, vpos + height), CRGBA(40, 53, 68, 255));
+ float length = SCREEN_WIDTH - SCREEN_SCALE_X(80);
+ float top = SCREEN_HEIGHT - SCREEN_SCALE_Y(14);
+ float bottom = top + SCREEN_SCALE_Y(5);
+#else
+ float hpos = SCREEN_STRETCH_X(40);
+ float length = SCREEN_STRETCH_X(440);
+ // this is rather weird
+ float top = SCREEN_STRETCH_Y(407.4f - 7.0f/3.0f);
+ float bottom = SCREEN_STRETCH_Y(407.4f + 7.0f/3.0f);
+#endif
+
+ CSprite2d::DrawRect(CRect(hpos-1.0f, top-1.0f, hpos+length+1.0f, bottom+1.0f), CRGBA(40, 53, 68, 255));
+
+ CSprite2d::DrawRect(CRect(hpos, top, hpos+length, bottom), CRGBA(155, 50, 125, 255));
length *= NumberOfChunksLoaded/TOTALNUMCHUNKS;
- CSprite2d::DrawRect(CRect(hpos, vpos, hpos + length, vpos + height), CRGBA(81, 106, 137, 255));
+ CSprite2d::DrawRect(CRect(hpos, top, hpos+length, bottom), CRGBA(255, 150, 225, 255));
// this is done by the game but is unused
+ CFont::SetBackgroundOff();
CFont::SetScale(SCREEN_SCALE_X(2), SCREEN_SCALE_Y(2));
CFont::SetPropOn();
CFont::SetRightJustifyOn();
+ CFont::SetDropShadowPosition(1);
+ CFont::SetDropColor(CRGBA(0, 0, 0, 255));
CFont::SetFontStyle(FONT_HEADING);
#ifdef CHATTYSPLASH
// my attempt
static wchar tmpstr[80];
float yscale = SCREEN_SCALE_Y(0.9f);
- vpos -= 45*yscale;
+ top -= 45*yscale;
CFont::SetScale(SCREEN_SCALE_X(0.75f), yscale);
CFont::SetPropOn();
CFont::SetRightJustifyOff();
CFont::SetFontStyle(FONT_BANK);
CFont::SetColor(CRGBA(255, 255, 255, 255));
AsciiToUnicode(str1, tmpstr);
- CFont::PrintString(hpos, vpos, tmpstr);
- vpos += 22*yscale;
+ CFont::PrintString(hpos, top, tmpstr);
+ top += 22*yscale;
AsciiToUnicode(str2, tmpstr);
- CFont::PrintString(hpos, vpos, tmpstr);
+ CFont::PrintString(hpos, top, tmpstr);
#endif
}
@@ -676,11 +691,13 @@ DisplayGameDebugText()
{
static bool bDisplayPosn = false;
static bool bDisplayRate = false;
+ static bool bDisplayCheatStr = false;
{
SETTWEAKPATH("GameDebugText");
TWEAKBOOL(bDisplayPosn);
TWEAKBOOL(bDisplayRate);
+ TWEAKBOOL(bDisplayCheatStr);
}
@@ -768,6 +785,26 @@ DisplayGameDebugText()
CFont::SetColor(CRGBA(255, 108, 0, 255));
CFont::PrintString(40.0f, 40.0f, ustr);
}
+
+ if (bDisplayCheatStr)
+ {
+ sprintf(str, "%s", CPad::KeyBoardCheatString);
+ AsciiToUnicode(str, ustr);
+
+ CFont::SetPropOff();
+ CFont::SetBackgroundOff();
+ CFont::SetScale(0.7f, 1.5f);
+ CFont::SetCentreOn();
+ CFont::SetBackGroundOnlyTextOff();
+ CFont::SetWrapx(640.0f);
+ CFont::SetFontStyle(FONT_HEADING);
+
+ CFont::SetColor(CRGBA(0, 0, 0, 255));
+ CFont::PrintString(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH * 0.5f)+2.f, SCREEN_SCALE_FROM_BOTTOM(20.0f)+2.f, ustr);
+
+ CFont::SetColor(CRGBA(255, 150, 225, 255));
+ CFont::PrintString(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH * 0.5f), SCREEN_SCALE_FROM_BOTTOM(20.0f), ustr);
+ }
}
#endif
@@ -913,15 +950,12 @@ Render2dStuffAfterFade(void)
CHud::DrawAfterFade();
CFont::DrawFonts();
+ CCredits::Render();
}
void
Idle(void *arg)
{
-#ifdef ASPECT_RATIO_SCALE
- CDraw::SetAspectRatio(CDraw::FindAspectRatio());
-#endif
-
CTimer::Update();
#ifdef TIMEBARS
@@ -931,35 +965,6 @@ Idle(void *arg)
CSprite2d::InitPerFrame();
CFont::InitPerFrame();
- // We're basically merging FrontendIdle and Idle (just like TheGame on PS2)
-#ifdef PS2_SAVE_DIALOG
- // Only exists on PC FrontendIdle, probably some PS2 bug fix
- if (FrontEndMenuManager.m_bMenuActive)
- CSprite2d::SetRecipNearClip();
-
- if (FrontEndMenuManager.m_bGameNotLoaded) {
- CPad::UpdatePads();
- FrontEndMenuManager.Process();
- } else {
- CPointLights::InitPerFrame();
-#ifdef TIMEBARS
- tbStartTimer(0, "CGame::Process");
-#endif
- CGame::Process();
-#ifdef TIMEBARS
- tbEndTimer("CGame::Process");
- tbStartTimer(0, "DMAudio.Service");
-#endif
- DMAudio.Service();
-
-#ifdef TIMEBARS
- tbEndTimer("DMAudio.Service");
-#endif
- }
-
- if (RsGlobal.quit)
- return;
-#else
CPointLights::InitPerFrame();
#ifdef TIMEBARS
tbStartTimer(0, "CGame::Process");
@@ -975,7 +980,6 @@ Idle(void *arg)
#ifdef TIMEBARS
tbEndTimer("DMAudio.Service");
#endif
-#endif
if(CGame::bDemoMode && CTimer::GetTimeInMilliseconds() > (3*60 + 30)*1000 && !CCutsceneMgr::IsCutsceneProcessing()){
FrontEndMenuManager.m_bWantToRestart = true;
@@ -991,17 +995,16 @@ Idle(void *arg)
if(arg == nil)
return;
- if((!FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.m_bRenderGameInMenu) &&
+ // m_bRenderGameInMenu is there in III PS2 but I don't know about VC PS2.
+ if((!FrontEndMenuManager.m_bMenuActive/* || FrontEndMenuManager.m_bRenderGameInMenu*/) &&
TheCamera.GetScreenFadeStatus() != FADE_2)
{
#ifdef GTA_PC
- if (!FrontEndMenuManager.m_bRenderGameInMenu) {
// This is from SA, but it's nice for windowed mode
RwV2d pos;
pos.x = SCREEN_WIDTH / 2.0f;
pos.y = SCREEN_HEIGHT / 2.0f;
RsMouseSetPos(&pos);
- }
#endif
#ifdef TIMEBARS
tbStartTimer(0, "CnstrRenderList");
@@ -1058,6 +1061,7 @@ Idle(void *arg)
tbEndTimer("Render2dStuff");
#endif
}else{
+ CDraw::CalculateAspectRatio();
#ifdef ASPECT_RATIO_SCALE
CameraSize(Scene.camera, nil, SCREEN_VIEWWINDOW, SCREEN_ASPECT_RATIO);
#else
@@ -1069,10 +1073,6 @@ Idle(void *arg)
return;
}
-#ifdef PS2_SAVE_DIALOG
- if (FrontEndMenuManager.m_bMenuActive)
- DefinedState();
-#endif
#ifdef TIMEBARS
tbStartTimer(0, "RenderMenus");
#endif
@@ -1090,7 +1090,7 @@ Idle(void *arg)
#ifdef TIMEBARS
tbEndTimer("Render2dStuff-Fade");
#endif
- CCredits::Render();
+ // CCredits::Render(); // They added it to function above and also forgot it here
#ifdef TIMEBARS
tbDisplay();
@@ -1105,10 +1105,7 @@ Idle(void *arg)
void
FrontendIdle(void)
{
-#ifdef ASPECT_RATIO_SCALE
- CDraw::SetAspectRatio(CDraw::FindAspectRatio());
-#endif
-
+ CDraw::CalculateAspectRatio();
CTimer::Update();
CSprite2d::SetRecipNearClip(); // this should be on InitialiseRenderWare according to PS2 asm. seems like a bug fix
CSprite2d::InitPerFrame();
@@ -1119,11 +1116,7 @@ FrontendIdle(void)
if(RsGlobal.quit)
return;
-#ifdef ASPECT_RATIO_SCALE
CameraSize(Scene.camera, nil, SCREEN_VIEWWINDOW, SCREEN_ASPECT_RATIO);
-#else
- CameraSize(Scene.camera, nil, SCREEN_VIEWWINDOW, DEFAULT_ASPECT_RATIO);
-#endif
CVisibilityPlugins::SetRenderWareCamera(Scene.camera);
RwCameraClear(Scene.camera, &gColourTop, rwCAMERACLEARZ);
if(!RsCameraBeginUpdate(Scene.camera))
@@ -1133,7 +1126,7 @@ FrontendIdle(void)
RenderMenus();
DoFade();
Render2dStuffAfterFade();
-// CFont::DrawFonts(); // redundant
+ CFont::DrawFonts();
DoRWStuffEndOfFrame();
}
@@ -1149,10 +1142,10 @@ AppEventHandler(RsEvent event, void *param)
{
switch( event )
{
- case rsINITIALISE:
+ case rsINITIALIZE:
{
CGame::InitialiseOnceBeforeRW();
- return RsInitialise() ? rsEVENTPROCESSED : rsEVENTERROR;
+ return RsInitialize() ? rsEVENTPROCESSED : rsEVENTERROR;
}
case rsCAMERASIZE:
@@ -1164,7 +1157,7 @@ AppEventHandler(RsEvent event, void *param)
return rsEVENTPROCESSED;
}
- case rsRWINITIALISE:
+ case rsRWINITIALIZE:
{
return Initialise3D(param) ? rsEVENTPROCESSED : rsEVENTERROR;
}
@@ -1204,11 +1197,7 @@ AppEventHandler(RsEvent event, void *param)
case rsFRONTENDIDLE:
{
-#ifdef PS2_SAVE_DIALOG
- Idle((void*)1);
-#else
FrontendIdle();
-#endif
return rsEVENTPROCESSED;
}
@@ -1243,9 +1232,8 @@ TheModelViewer(void)
#if (defined(GTA_PS2) || defined(GTA_XBOX))
//TODO
#else
-#ifdef ASPECT_RATIO_SCALE
- CDraw::SetAspectRatio(CDraw::FindAspectRatio());
-#endif
+
+ CDraw::CalculateAspectRatio();
CAnimViewer::Update();
CTimer::Update();
SetLightsWithTimeOfDayColour(Scene.world);
@@ -1294,9 +1282,9 @@ void TheGame(void)
strcpy(TheMemoryCard.LoadFileName, TheMemoryCard.field37);
TheMemoryCard.b_FoundRecentSavedGameWantToLoad = true;
- if (CMenuManager::m_PrefsLanguage != TheMemoryCard.GetLanguageToLoad())
+ if (FrontEndMenuManager.m_PrefsLanguage != TheMemoryCard.GetLanguageToLoad())
{
- CMenuManager::m_PrefsLanguage = TheMemoryCard.GetLanguageToLoad();
+ FrontEndMenuManager.m_PrefsLanguage = TheMemoryCard.GetLanguageToLoad();
TheText.Unload();
TheText.Load();
}
@@ -1370,7 +1358,8 @@ void TheGame(void)
gMainHeap.PushMemId(_TODOCONST(15));
#endif
- if (!FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.m_bRenderGameInMenu == true && TheCamera.GetScreenFadeStatus() != FADE_2 )
+ // m_bRenderGameInMenu is there in III PS2 but I don't know about VC PS2.
+ if (!FrontEndMenuManager.m_bMenuActive || /*FrontEndMenuManager.m_bRenderGameInMenu == true && */TheCamera.GetScreenFadeStatus() != FADE_2 )
{
#ifdef GTA_PS2
gMainHeap.PushMemId(_TODOCONST(11));
@@ -1577,30 +1566,30 @@ void SystemInit()
CGame::frenchGame = false;
CGame::germanGame = false;
CGame::nastyGame = true;
- CMenuManager::m_PrefsAllowNastyGame = true;
+ FrontEndMenuManager.m_PrefsAllowNastyGame = true;
#ifdef GTA_PS2
int32 lang = sceScfGetLanguage();
if ( lang == SCE_ITALIAN_LANGUAGE )
- CMenuManager::m_PrefsLanguage = LANGUAGE_ITALIAN;
+ FrontEndMenuManager.m_PrefsLanguage = LANGUAGE_ITALIAN;
else if ( lang == SCE_SPANISH_LANGUAGE )
- CMenuManager::m_PrefsLanguage = LANGUAGE_SPANISH;
+ FrontEndMenuManager.m_PrefsLanguage = LANGUAGE_SPANISH;
else if ( lang == SCE_GERMAN_LANGUAGE )
{
CGame::germanGame = true;
CGame::nastyGame = false;
- CMenuManager::m_PrefsAllowNastyGame = false;
- CMenuManager::m_PrefsLanguage = LANGUAGE_GERMAN;
+ FrontEndMenuManager.m_PrefsAllowNastyGame = false;
+ FrontEndMenuManager.m_PrefsLanguage = LANGUAGE_GERMAN;
}
else if ( lang == SCE_FRENCH_LANGUAGE )
{
CGame::frenchGame = true;
CGame::nastyGame = false;
- CMenuManager::m_PrefsAllowNastyGame = false;
- CMenuManager::m_PrefsLanguage = LANGUAGE_FRENCH;
+ FrontEndMenuManager.m_PrefsAllowNastyGame = false;
+ FrontEndMenuManager.m_PrefsLanguage = LANGUAGE_FRENCH;
}
else
- CMenuManager::m_PrefsLanguage = LANGUAGE_AMERICAN;
+ FrontEndMenuManager.m_PrefsLanguage = LANGUAGE_AMERICAN;
FrontEndMenuManager.InitialiseMenuContentsAfterLoadingGame();
#else
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index 0e62f3a5..54077e6f 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -69,7 +69,7 @@ mysrand(unsigned int seed)
#ifdef DEBUGMENU
void WeaponCheat();
void HealthCheat();
-void TankCheat();
+void VehicleCheat(bool something, int model);
void BlowUpCarsCheat();
void ChangePlayerCheat();
void MayhemCheat();
@@ -160,6 +160,13 @@ TeleportToWaypoint(void)
}
#endif
+static void
+SwitchCarCollision(void)
+{
+ if (FindPlayerVehicle() && FindPlayerVehicle()->IsCar())
+ FindPlayerVehicle()->bUsesCollision = !FindPlayerVehicle()->bUsesCollision;
+}
+
static int engineStatus;
static void
SetEngineStatus(void)
@@ -273,7 +280,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 +288,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);
@@ -293,7 +300,7 @@ DebugMenuPopulate(void)
DebugMenuAddCmd("Cheats", "Health", HealthCheat);
DebugMenuAddCmd("Cheats", "Wanted level up", WantedLevelUpCheat);
DebugMenuAddCmd("Cheats", "Wanted level down", WantedLevelDownCheat);
- DebugMenuAddCmd("Cheats", "Tank", TankCheat);
+ DebugMenuAddCmd("Cheats", "Tank", []() { VehicleCheat(true, MI_TAXI); });
DebugMenuAddCmd("Cheats", "Blow up cars", BlowUpCarsCheat);
DebugMenuAddCmd("Cheats", "Change player", ChangePlayerCheat);
DebugMenuAddCmd("Cheats", "Mayhem", MayhemCheat);
@@ -337,7 +344,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); });
@@ -365,6 +376,7 @@ DebugMenuPopulate(void)
#ifdef MENU_MAP
DebugMenuAddCmd("Debug", "Teleport to map waypoint", TeleportToWaypoint);
#endif
+ DebugMenuAddCmd("Debug", "Switch car collision", SwitchCarCollision);
DebugMenuAddVar("Debug", "Engine Status", &engineStatus, nil, 1, 0, 226, nil);
DebugMenuAddCmd("Debug", "Set Engine Status", SetEngineStatus);
DebugMenuAddCmd("Debug", "Fix Car", FixCar);
@@ -385,6 +397,13 @@ DebugMenuPopulate(void)
DebugMenuAddCmd("Debug", "Start Credits", CCredits::Start);
DebugMenuAddCmd("Debug", "Stop Credits", CCredits::Stop);
+#ifdef RELOADABLES
+ DebugMenuAddCmd("Reload", "HUD.TXD", CHud::ReloadTXD);
+ DebugMenuAddCmd("Reload", "FONTS.TXD", NULL);
+ DebugMenuAddCmd("Reload", "FRONTEN1.TXD", NULL);
+ DebugMenuAddCmd("Reload", "FRONTEN2.TXD", NULL);
+#endif
+
extern bool PrintDebugCode;
extern int16 DebugCamMode;
DebugMenuAddVarBool8("Cam", "Use mouse Cam", &CCamera::m_bUseMouse3rdPerson, nil);