PS2 Cheats, restored R*names

This commit is contained in:
Fire-Head 2020-04-09 06:20:44 +03:00
parent c97ff5b31a
commit 590ff32469
12 changed files with 320 additions and 197 deletions

View File

@ -1129,8 +1129,8 @@ void CReplay::StoreStuffInMem(void)
pEmptyReferences = CReferences::pEmptyList; pEmptyReferences = CReferences::pEmptyList;
pStoredCam = new uint8[sizeof(CCamera)]; pStoredCam = new uint8[sizeof(CCamera)];
memcpy(pStoredCam, &TheCamera, sizeof(CCamera)); memcpy(pStoredCam, &TheCamera, sizeof(CCamera));
pRadarBlips = new uint8[sizeof(CBlip) * NUMRADARBLIPS]; pRadarBlips = new uint8[sizeof(sRadarTrace) * NUMRADARBLIPS];
memcpy(pRadarBlips, CRadar::ms_RadarTrace, NUMRADARBLIPS * sizeof(CBlip)); memcpy(pRadarBlips, CRadar::ms_RadarTrace, NUMRADARBLIPS * sizeof(sRadarTrace));
PlayerWanted = *FindPlayerPed()->m_pWanted; PlayerWanted = *FindPlayerPed()->m_pWanted;
PlayerInfo = CWorld::Players[0]; PlayerInfo = CWorld::Players[0];
Time1 = CTimer::GetTimeInMilliseconds(); Time1 = CTimer::GetTimeInMilliseconds();
@ -1179,7 +1179,7 @@ void CReplay::RestoreStuffFromMem(void)
memcpy(&TheCamera, pStoredCam, sizeof(CCamera)); memcpy(&TheCamera, pStoredCam, sizeof(CCamera));
delete[] pStoredCam; delete[] pStoredCam;
pStoredCam = nil; pStoredCam = nil;
memcpy(CRadar::ms_RadarTrace, pRadarBlips, sizeof(CBlip) * NUMRADARBLIPS); memcpy(CRadar::ms_RadarTrace, pRadarBlips, sizeof(sRadarTrace) * NUMRADARBLIPS);
delete[] pRadarBlips; delete[] pRadarBlips;
pRadarBlips = nil; pRadarBlips = nil;
FindPlayerPed()->m_pWanted = new CWanted(PlayerWanted); FindPlayerPed()->m_pWanted = new CWanted(PlayerWanted);

View File

@ -91,10 +91,10 @@ uint8 (&CTheScripts::ScriptSpace)[SIZE_SCRIPT_SPACE] = *(uint8(*)[SIZE_SCRIPT_SP
CRunningScript(&CTheScripts::ScriptsArray)[MAX_NUM_SCRIPTS] = *(CRunningScript(*)[MAX_NUM_SCRIPTS])*(uintptr*)0x6F5C08; CRunningScript(&CTheScripts::ScriptsArray)[MAX_NUM_SCRIPTS] = *(CRunningScript(*)[MAX_NUM_SCRIPTS])*(uintptr*)0x6F5C08;
int32(&CTheScripts::BaseBriefIdForContact)[MAX_NUM_CONTACTS] = *(int32(*)[MAX_NUM_CONTACTS])*(uintptr*)0x880200; int32(&CTheScripts::BaseBriefIdForContact)[MAX_NUM_CONTACTS] = *(int32(*)[MAX_NUM_CONTACTS])*(uintptr*)0x880200;
int32(&CTheScripts::OnAMissionForContactFlag)[MAX_NUM_CONTACTS] = *(int32(*)[MAX_NUM_CONTACTS])*(uintptr*)0x8622F0; int32(&CTheScripts::OnAMissionForContactFlag)[MAX_NUM_CONTACTS] = *(int32(*)[MAX_NUM_CONTACTS])*(uintptr*)0x8622F0;
CTextLine (&CTheScripts::IntroTextLines)[MAX_NUM_INTRO_TEXT_LINES] = *(CTextLine (*)[MAX_NUM_INTRO_TEXT_LINES])*(uintptr*)0x70EA68; intro_text_line (&CTheScripts::IntroTextLines)[MAX_NUM_INTRO_TEXT_LINES] = *(intro_text_line (*)[MAX_NUM_INTRO_TEXT_LINES])*(uintptr*)0x70EA68;
CScriptRectangle (&CTheScripts::IntroRectangles)[MAX_NUM_INTRO_RECTANGLES] = *(CScriptRectangle (*)[MAX_NUM_INTRO_RECTANGLES])*(uintptr*)0x72D108; intro_script_rectangle (&CTheScripts::IntroRectangles)[MAX_NUM_INTRO_RECTANGLES] = *(intro_script_rectangle (*)[MAX_NUM_INTRO_RECTANGLES])*(uintptr*)0x72D108;
CSprite2d (&CTheScripts::ScriptSprites)[MAX_NUM_SCRIPT_SRPITES] = *(CSprite2d(*)[MAX_NUM_SCRIPT_SRPITES])*(uintptr*)0x72B090; CSprite2d (&CTheScripts::ScriptSprites)[MAX_NUM_SCRIPT_SRPITES] = *(CSprite2d(*)[MAX_NUM_SCRIPT_SRPITES])*(uintptr*)0x72B090;
CScriptSphere(&CTheScripts::ScriptSphereArray)[MAX_NUM_SCRIPT_SPHERES] = *(CScriptSphere(*)[MAX_NUM_SCRIPT_SPHERES])*(uintptr*)0x727D60; script_sphere_struct(&CTheScripts::ScriptSphereArray)[MAX_NUM_SCRIPT_SPHERES] = *(script_sphere_struct(*)[MAX_NUM_SCRIPT_SPHERES])*(uintptr*)0x727D60;
tCollectiveData(&CTheScripts::CollectiveArray)[MAX_NUM_COLLECTIVES] = *(tCollectiveData(*)[MAX_NUM_COLLECTIVES])*(uintptr*)0x6FA008; tCollectiveData(&CTheScripts::CollectiveArray)[MAX_NUM_COLLECTIVES] = *(tCollectiveData(*)[MAX_NUM_COLLECTIVES])*(uintptr*)0x6FA008;
tUsedObject(&CTheScripts::UsedObjectArray)[MAX_NUM_USED_OBJECTS] = *(tUsedObject(*)[MAX_NUM_USED_OBJECTS])*(uintptr*)0x6E69C8; tUsedObject(&CTheScripts::UsedObjectArray)[MAX_NUM_USED_OBJECTS] = *(tUsedObject(*)[MAX_NUM_USED_OBJECTS])*(uintptr*)0x6E69C8;
int32(&CTheScripts::MultiScriptArray)[MAX_NUM_MISSION_SCRIPTS] = *(int32(*)[MAX_NUM_MISSION_SCRIPTS])*(uintptr*)0x6F0558; int32(&CTheScripts::MultiScriptArray)[MAX_NUM_MISSION_SCRIPTS] = *(int32(*)[MAX_NUM_MISSION_SCRIPTS])*(uintptr*)0x6F0558;
@ -313,7 +313,7 @@ bool CUpsideDownCarCheck::HasCarBeenUpsideDownForAWhile(int32 id)
return false; return false;
} }
void CStuckCarCheckEntry::Reset() void stuck_car_data::Reset()
{ {
m_nVehicleIndex = -1; m_nVehicleIndex = -1;
m_vecPos = CVector(-5000.0f, -5000.0f, -5000.0f); m_vecPos = CVector(-5000.0f, -5000.0f, -5000.0f);

View File

@ -15,22 +15,25 @@ class CRunningScript;
#define KEY_LENGTH_IN_SCRIPT 8 #define KEY_LENGTH_IN_SCRIPT 8
struct CScriptRectangle struct intro_script_rectangle
{ {
bool m_bIsUsed; bool m_bIsUsed;
bool m_bBeforeFade; bool m_bBeforeFade;
int16 m_nTextureId; int16 m_nTextureId;
CRect m_sRect; CRect m_sRect;
CRGBA m_sColor; CRGBA m_sColor;
intro_script_rectangle() { }
~intro_script_rectangle() { }
}; };
static_assert(sizeof(CScriptRectangle) == 0x18, "Script.h: error"); static_assert(sizeof(intro_script_rectangle) == 0x18, "Script.h: error");
enum { enum {
SCRIPT_TEXT_MAX_LENGTH = 500 SCRIPT_TEXT_MAX_LENGTH = 500
}; };
struct CTextLine struct intro_text_line
{ {
float m_fScaleX; float m_fScaleX;
float m_fScaleY; float m_fScaleY;
@ -50,6 +53,9 @@ struct CTextLine
float m_fAtY; float m_fAtY;
wchar m_Text[SCRIPT_TEXT_MAX_LENGTH]; wchar m_Text[SCRIPT_TEXT_MAX_LENGTH];
intro_text_line() { }
~intro_text_line() { }
void Reset() void Reset()
{ {
m_fScaleX = 0.48f; m_fScaleX = 0.48f;
@ -72,15 +78,17 @@ struct CTextLine
} }
}; };
static_assert(sizeof(CTextLine) == 0x414, "Script.h: error"); static_assert(sizeof(intro_text_line) == 0x414, "Script.h: error");
struct CScriptSphere struct script_sphere_struct
{ {
bool m_bInUse; bool m_bInUse;
uint16 m_Index; uint16 m_Index;
uint32 m_Id; uint32 m_Id;
CVector m_vecCenter; CVector m_vecCenter;
float m_fRadius; float m_fRadius;
script_sphere_struct() { }
}; };
struct CStoredLine struct CStoredLine
@ -145,7 +153,7 @@ public:
bool HasCarBeenUpsideDownForAWhile(int32); bool HasCarBeenUpsideDownForAWhile(int32);
}; };
struct CStuckCarCheckEntry struct stuck_car_data
{ {
int32 m_nVehicleIndex; int32 m_nVehicleIndex;
CVector m_vecPos; CVector m_vecPos;
@ -154,12 +162,13 @@ struct CStuckCarCheckEntry
uint32 m_nStuckTime; uint32 m_nStuckTime;
bool m_bStuck; bool m_bStuck;
stuck_car_data() { }
inline void Reset(); inline void Reset();
}; };
class CStuckCarCheck class CStuckCarCheck
{ {
CStuckCarCheckEntry m_sCars[MAX_STUCK_CAR_CHECKS]; stuck_car_data m_sCars[MAX_STUCK_CAR_CHECKS];
public: public:
void Init(); void Init();
@ -235,10 +244,10 @@ class CTheScripts
static CRunningScript(&ScriptsArray)[MAX_NUM_SCRIPTS]; static CRunningScript(&ScriptsArray)[MAX_NUM_SCRIPTS];
static int32(&BaseBriefIdForContact)[MAX_NUM_CONTACTS]; static int32(&BaseBriefIdForContact)[MAX_NUM_CONTACTS];
static int32(&OnAMissionForContactFlag)[MAX_NUM_CONTACTS]; static int32(&OnAMissionForContactFlag)[MAX_NUM_CONTACTS];
static CTextLine(&IntroTextLines)[MAX_NUM_INTRO_TEXT_LINES]; static intro_text_line(&IntroTextLines)[MAX_NUM_INTRO_TEXT_LINES];
static CScriptRectangle(&IntroRectangles)[MAX_NUM_INTRO_RECTANGLES]; static intro_script_rectangle(&IntroRectangles)[MAX_NUM_INTRO_RECTANGLES];
static CSprite2d(&ScriptSprites)[MAX_NUM_SCRIPT_SRPITES]; static CSprite2d(&ScriptSprites)[MAX_NUM_SCRIPT_SRPITES];
static CScriptSphere(&ScriptSphereArray)[MAX_NUM_SCRIPT_SPHERES]; static script_sphere_struct(&ScriptSphereArray)[MAX_NUM_SCRIPT_SPHERES];
static tCollectiveData(&CollectiveArray)[MAX_NUM_COLLECTIVES]; static tCollectiveData(&CollectiveArray)[MAX_NUM_COLLECTIVES];
static tUsedObject(&UsedObjectArray)[MAX_NUM_USED_OBJECTS]; static tUsedObject(&UsedObjectArray)[MAX_NUM_USED_OBJECTS];
static int32(&MultiScriptArray)[MAX_NUM_MISSION_SCRIPTS]; static int32(&MultiScriptArray)[MAX_NUM_MISSION_SCRIPTS];

View File

@ -607,7 +607,7 @@ extern void (*DebugMenuProcess)(void);
void CGame::Process(void) void CGame::Process(void)
{ {
CPad::UpdatePads(); CPad::UpdatePads();
#ifdef PS2 #ifdef GTA_PS2
ProcessTidyUpMemory(); ProcessTidyUpMemory();
#endif #endif
TheCamera.SetMotionBlurAlpha(0); TheCamera.SetMotionBlurAlpha(0);

View File

@ -138,6 +138,7 @@ void CKeyboardState::Clear()
LWIN = RWIN = APPS = 0; LWIN = RWIN = APPS = 0;
} }
#ifdef GTA_PS2_STUFF
void CPad::Initialise(void) void CPad::Initialise(void)
{ {
for (int i = 0; i < MAX_PADS; i++) for (int i = 0; i < MAX_PADS; i++)
@ -150,6 +151,7 @@ void CPad::Initialise(void)
bOldDisplayNoControllerMessage = false; bOldDisplayNoControllerMessage = false;
bDisplayNoControllerMessage = false; bDisplayNoControllerMessage = false;
} }
#endif
void CPad::Clear(bool bResetPlayerControls) void CPad::Clear(bool bResetPlayerControls)
{ {
@ -178,13 +180,13 @@ void CPad::Clear(bool bResetPlayerControls)
bApplyBrakes = false; bApplyBrakes = false;
for ( int32 i = 0; i < _TODOCONST(5); i++ ) for ( int32 i = 0; i < HORNHISTORY_SIZE; i++ )
bHornHistory[i] = false; bHornHistory[i] = false;
iCurrHornHistory = 0; iCurrHornHistory = 0;
for ( int32 i = 0; i < _TODOCONST(12); i++ ) for ( int32 i = 0; i < ARRAY_SIZE(CheatString); i++ )
_unk[i] = ' '; CheatString[i] = ' ';
LastTimeTouched = CTimer::GetTimeInMilliseconds(); LastTimeTouched = CTimer::GetTimeInMilliseconds();
AverageWeapon = 0; AverageWeapon = 0;
@ -443,6 +445,108 @@ void CPad::StartShake_Train(float fX, float fY)
} }
} }
#ifdef GTA_PS2_STUFF
void CPad::AddToCheatString(char c)
{
for ( int32 i = ARRAY_SIZE(CheatString) - 2; i >= 0; i-- )
CheatString[i + 1] = CheatString[i];
#define _CHEATCMP(str) strncmp(str, CheatString, sizeof(str)-1)
// "4414LDRULDRU" - R2 R2 L1 R2 LEFT DOWN RIGHT UP LEFT DOWN RIGHT UP
if ( !_CHEATCMP("URDLURDL4144") )
WeaponCheat();
// "4411LDRULDRU" - R2 R2 L1 L1 LEFT DOWN RIGHT UP LEFT DOWN RIGHT UP
else if ( !_CHEATCMP("URDLURDL1144") )
MoneyCheat();
// "4412LDRULDRU" - R2 R2 L1 L2 LEFT DOWN RIGHT UP LEFT DOWN RIGHT UP
else if ( !_CHEATCMP("URDLURDL2144") )
ArmourCheat();
// "4413LDRULDRU" - R2 R2 L1 R1 LEFT DOWN RIGHT UP LEFT DOWN RIGHT UP
else if ( !_CHEATCMP("URDLURDL3144") )
HealthCheat();
// "4414LRLRLR" - R2 R2 L1 R2 LEFT RIGHT LEFT RIGHT LEFT RIGHT
else if ( !_CHEATCMP("RLRLRL4144") )
WantedLevelUpCheat();
// "4414UDUDUD" - R2 R2 L1 R2 UP DOWN UP DOWN UP DOWN
else if ( !_CHEATCMP("DUDUDU4144") )
WantedLevelDownCheat();
// "1234432T" - L1 L2 R1 R2 R2 R1 L2 TRIANGLE
else if ( !_CHEATCMP("T2344321") )
SunnyWeatherCheat();
// "1234432S" - L1 L2 R1 R2 R2 R1 L2 SQUARE
else if ( !_CHEATCMP("S2344321") )
CloudyWeatherCheat();
// "1234432C" - L1 L2 R1 R2 R2 R1 L2 CIRCLE
else if ( !_CHEATCMP("C2344321") )
RainyWeatherCheat();
// "1234432X" - L1 L2 R1 R2 R2 R1 L2 CROSS
else if ( !_CHEATCMP("X2344321") )
FoggyWeatherCheat();
// "CCCCCC321TCT" - CIRCLE CIRCLE CIRCLE CIRCLE CIRCLE CIRCLE R1 L2 L1 TRIANGLE CIRCLE TRIANGLE
else if ( !_CHEATCMP("TCT123CCCCCC") )
TankCheat();
// "CCCSSSSS1TCT" - CIRCLE CIRCLE CIRCLE SQUARE SQUARE SQUARE SQUARE SQUARE L1 TRIANGLE CIRCLE TRIANGLE
else if ( !_CHEATCMP("TCT1SSSSSCCC") )
FastWeatherCheat();
// "241324TSCT21" - L2 R2 L1 R1 L2 R2 TRIANGLE SQUARE CIRCLE TRIANGLE L2 L1
else if ( !_CHEATCMP("12TCST423142") )
BlowUpCarsCheat();
// "RDLU12ULDR" - RIGHT DOWN LEFT UP L1 L2 UP LEFT DOWN RIGHT
else if ( !_CHEATCMP("RDLU21ULDR") )
ChangePlayerCheat();
// "DULUX3421" - DOWN UP LEFT UP CROSS R1 R2 L2 L1
else if ( !_CHEATCMP("1243XULUD") )
MayhemCheat();
// "DULUX3412" - DOWN UP LEFT UP CROSS R1 R2 L1 L2
else if ( !_CHEATCMP("2143XULUD") )
EverybodyAttacksPlayerCheat();
// "43TX21UD" - R2 R1 TRIANGLE CROSS L2 L1 UP DOWN
else if ( !_CHEATCMP("DU12XT34") )
WeaponsForAllCheat();
// "TURDS12" - TRIANGLE UP RIGHT DOWN SQUARE L1 L2
else if ( !_CHEATCMP("21SDRUT") )
FastTimeCheat();
// "TURDS34" - TRIANGLE UP RIGHT DOWN SQUARE R1 R2
else if ( !_CHEATCMP("43SDRUT") )
SlowTimeCheat();
// "11S4T1T" - L1 L1 SQUARE R2 TRIANGLE L1 TRIANGLE
else if ( !_CHEATCMP("T1T4S11") )
OnlyRenderWheelsCheat();
// "R4C32D13" - RIGHT R2 CIRCLE R1 L2 DOWN L1 R1
else if ( !_CHEATCMP("31D23C4R") )
ChittyChittyBangBangCheat();
// "3141L33T" - R1 L1 R2 L1 LEFT R1 R1 TRIANGLE
else if ( !_CHEATCMP("T33L1413") )
StrongGripCheat();
// "S1CD13TR1X" - SQUARE L1 CIRCLE DOWN L1 R1 TRIANGLE RIGHT L1 CROSS
else if ( !_CHEATCMP("X1RT31DC1S") )
NastyLimbsCheat();
#undef _CHEATCMP
}
#endif
void CPad::AddToPCCheatString(char c) void CPad::AddToPCCheatString(char c)
{ {
for ( int32 i = ARRAY_SIZE(KeyBoardCheatString) - 2; i >= 0; i-- ) for ( int32 i = ARRAY_SIZE(KeyBoardCheatString) - 2; i >= 0; i-- )
@ -680,7 +784,7 @@ void CPad::Update(int16 unk)
ProcessPCSpecificStuff(); ProcessPCSpecificStuff();
if ( ++iCurrHornHistory >= _TODOCONST(5) ) if ( ++iCurrHornHistory >= HORNHISTORY_SIZE )
iCurrHornHistory = 0; iCurrHornHistory = 0;
bHornHistory[iCurrHornHistory] = GetHorn(); bHornHistory[iCurrHornHistory] = GetHorn();
@ -697,7 +801,7 @@ void CPad::DoCheats(void)
void CPad::DoCheats(int16 unk) void CPad::DoCheats(int16 unk)
{ {
#ifdef PS2 #ifdef GTA_PS2_STUFF
if ( GetTriangleJustDown() ) if ( GetTriangleJustDown() )
AddToCheatString('T'); AddToCheatString('T');

View File

@ -136,6 +136,10 @@ enum
class CPad class CPad
{ {
public: public:
enum
{
HORNHISTORY_SIZE = 5,
};
CControllerState NewState; CControllerState NewState;
CControllerState OldState; CControllerState OldState;
CControllerState PCTempKeyState; CControllerState PCTempKeyState;
@ -146,11 +150,11 @@ public:
int16 Mode; int16 Mode;
int16 ShakeDur; int16 ShakeDur;
uint8 ShakeFreq; uint8 ShakeFreq;
bool bHornHistory[5]; bool bHornHistory[HORNHISTORY_SIZE];
uint8 iCurrHornHistory; uint8 iCurrHornHistory;
uint8 DisablePlayerControls; uint8 DisablePlayerControls;
int8 bApplyBrakes; int8 bApplyBrakes;
char _unk[12]; //int32 unk[3]; char CheatString[12];
char _pad0[3]; char _pad0[3];
int32 LastTimeTouched; int32 LastTimeTouched;
int32 AverageWeapon; int32 AverageWeapon;
@ -173,8 +177,9 @@ public:
static CMouseControllerState &PCTempMouseControllerState; static CMouseControllerState &PCTempMouseControllerState;
#ifdef GTA_PS2_STUFF
static void Initialise(void); static void Initialise(void);
#endif
void Clear(bool bResetPlayerControls); void Clear(bool bResetPlayerControls);
void ClearMouseHistory(); void ClearMouseHistory();
void UpdateMouse(); void UpdateMouse();
@ -182,6 +187,9 @@ public:
void StartShake(int16 nDur, uint8 nFreq); void StartShake(int16 nDur, uint8 nFreq);
void StartShake_Distance(int16 nDur, uint8 nFreq, float fX, float fY, float fz); void StartShake_Distance(int16 nDur, uint8 nFreq, float fX, float fY, float fz);
void StartShake_Train(float fX, float fY); void StartShake_Train(float fX, float fY);
#ifdef GTA_PS2_STUFF
void AddToCheatString(char c);
#endif
void AddToPCCheatString(char c); void AddToPCCheatString(char c);
static void UpdatePads(void); static void UpdatePads(void);

View File

@ -106,7 +106,9 @@ CPlayerSkin::GetSkinTexture(const char *texName)
tex = RwTextureCreate(raster); tex = RwTextureCreate(raster);
RwTextureSetName(tex, texName); RwTextureSetName(tex, texName);
#ifdef FIX_BUGS
RwTextureSetFilterMode(tex, rwFILTERLINEAR); // filtering bugfix from VC RwTextureSetFilterMode(tex, rwFILTERLINEAR); // filtering bugfix from VC
#endif
RwTexDictionaryAddTexture(CTxdStore::GetSlot(m_txdSlot)->texDict, tex); RwTexDictionaryAddTexture(CTxdStore::GetSlot(m_txdSlot)->texDict, tex);
RwImageDestroy(image); RwImageDestroy(image);

View File

@ -17,7 +17,7 @@
#include "SpecialFX.h" #include "SpecialFX.h"
float &CRadar::m_radarRange = *(float*)0x8E281C; float &CRadar::m_radarRange = *(float*)0x8E281C;
CBlip (&CRadar::ms_RadarTrace)[NUMRADARBLIPS] = *(CBlip(*)[NUMRADARBLIPS]) * (uintptr*)0x6ED5E0; sRadarTrace (&CRadar::ms_RadarTrace)[NUMRADARBLIPS] = *(sRadarTrace(*)[NUMRADARBLIPS]) * (uintptr*)0x6ED5E0;
CVector2D &vec2DRadarOrigin = *(CVector2D*)0x6299B8; CVector2D &vec2DRadarOrigin = *(CVector2D*)0x6299B8;
int32 gRadarTxdIds[64];// = (int*)0x6299C0; int32 gRadarTxdIds[64];// = (int*)0x6299C0;
@ -87,6 +87,134 @@ int CRadar::TargetMarkerId = -1;
float CRadar::cachedCos; float CRadar::cachedCos;
float CRadar::cachedSin; float CRadar::cachedSin;
void ClipRadarTileCoords(int32 &x, int32 &y)
{
if (x < 0)
x = 0;
if (x > RADAR_NUM_TILES-1)
x = RADAR_NUM_TILES-1;
if (y < 0)
y = 0;
if (y > RADAR_NUM_TILES-1)
y = RADAR_NUM_TILES-1;
}
void RequestMapSection(int32 x, int32 y)
{
ClipRadarTileCoords(x, y);
CStreaming::RequestTxd(gRadarTxdIds[x + RADAR_NUM_TILES * y], STREAMFLAGS_DONT_REMOVE | STREAMFLAGS_DEPENDENCY);
}
void RemoveMapSection(int32 x, int32 y)
{
if (x >= 0 && x <= 7 && y >= 0 && y <= 7)
CStreaming::RemoveTxd(gRadarTxdIds[x + RADAR_NUM_TILES * y]);
}
// Transform from section indices to world coordinates
void GetTextureCorners(int32 x, int32 y, CVector2D *out)
{
x = x - RADAR_NUM_TILES/2;
y = -(y - RADAR_NUM_TILES/2);
// bottom left
out[0].x = RADAR_TILE_SIZE * (x);
out[0].y = RADAR_TILE_SIZE * (y - 1);
// bottom right
out[1].x = RADAR_TILE_SIZE * (x + 1);
out[1].y = RADAR_TILE_SIZE * (y - 1);
// top right
out[2].x = RADAR_TILE_SIZE * (x + 1);
out[2].y = RADAR_TILE_SIZE * (y);
// top left
out[3].x = RADAR_TILE_SIZE * (x);
out[3].y = RADAR_TILE_SIZE * (y);
}
bool IsPointInsideRadar(const CVector2D &point)
{
if (point.x < -1.0f || point.x > 1.0f) return false;
if (point.y < -1.0f || point.y > 1.0f) return false;
return true;
}
// clip line p1,p2 against (-1.0, 1.0) in x and y, set out to clipped point closest to p1
int LineRadarBoxCollision(CVector2D &out, const CVector2D &p1, const CVector2D &p2)
{
float d1, d2;
float t;
float x, y;
float shortest = 1.0f;
int edge = -1;
// clip against left edge, x = -1.0
d1 = -1.0f - p1.x;
d2 = -1.0f - p2.x;
if (d1 * d2 < 0.0f) {
// they are on opposite sides, get point of intersection
t = d1 / (d1 - d2);
y = (p2.y - p1.y)*t + p1.y;
if (y >= -1.0f && y <= 1.0f && t <= shortest) {
out.x = -1.0f;
out.y = y;
edge = 3;
shortest = t;
}
}
// clip against right edge, x = 1.0
d1 = p1.x - 1.0f;
d2 = p2.x - 1.0f;
if (d1 * d2 < 0.0f) {
// they are on opposite sides, get point of intersection
t = d1 / (d1 - d2);
y = (p2.y - p1.y)*t + p1.y;
if (y >= -1.0f && y <= 1.0f && t <= shortest) {
out.x = 1.0f;
out.y = y;
edge = 1;
shortest = t;
}
}
// clip against top edge, y = -1.0
d1 = -1.0f - p1.y;
d2 = -1.0f - p2.y;
if (d1 * d2 < 0.0f) {
// they are on opposite sides, get point of intersection
t = d1 / (d1 - d2);
x = (p2.x - p1.x)*t + p1.x;
if (x >= -1.0f && x <= 1.0f && t <= shortest) {
out.y = -1.0f;
out.x = x;
edge = 0;
shortest = t;
}
}
// clip against bottom edge, y = 1.0
d1 = p1.y - 1.0f;
d2 = p2.y - 1.0f;
if (d1 * d2 < 0.0f) {
// they are on opposite sides, get point of intersection
t = d1 / (d1 - d2);
x = (p2.x - p1.x)*t + p1.x;
if (x >= -1.0f && x <= 1.0f && t <= shortest) {
out.y = 1.0f;
out.x = x;
edge = 2;
shortest = t;
}
}
return edge;
}
uint8 CRadar::CalculateBlipAlpha(float dist) uint8 CRadar::CalculateBlipAlpha(float dist)
{ {
#ifdef MENU_MAP #ifdef MENU_MAP
@ -892,7 +1020,7 @@ INITSAVEBUF
CheckSaveHeader(buf, 'R', 'D', 'R', '\0', size - SAVE_HEADER_SIZE); CheckSaveHeader(buf, 'R', 'D', 'R', '\0', size - SAVE_HEADER_SIZE);
for (int i = 0; i < NUMRADARBLIPS; i++) for (int i = 0; i < NUMRADARBLIPS; i++)
ms_RadarTrace[i] = ReadSaveBuf<CBlip>(buf); ms_RadarTrace[i] = ReadSaveBuf<sRadarTrace>(buf);
VALIDATESAVEBUF(size); VALIDATESAVEBUF(size);
} }
@ -925,12 +1053,6 @@ CRadar::LoadTextures()
CTxdStore::PopCurrentTxd(); CTxdStore::PopCurrentTxd();
} }
void RemoveMapSection(int32 x, int32 y)
{
if (x >= 0 && x <= 7 && y >= 0 && y <= 7)
CStreaming::RemoveTxd(gRadarTxdIds[x + RADAR_NUM_TILES * y]);
}
void CRadar::RemoveRadarSections() void CRadar::RemoveRadarSections()
{ {
for (int i = 0; i < 8; i++) for (int i = 0; i < 8; i++)
@ -938,12 +1060,6 @@ void CRadar::RemoveRadarSections()
RemoveMapSection(i, j); RemoveMapSection(i, j);
} }
void CRadar::RequestMapSection(int32 x, int32 y)
{
ClipRadarTileCoords(x, y);
CStreaming::RequestTxd(gRadarTxdIds[x + RADAR_NUM_TILES * y], STREAMFLAGS_DONT_REMOVE | STREAMFLAGS_DEPENDENCY);
}
void CRadar::SaveAllRadarBlips(uint8 *buf, uint32 *size) void CRadar::SaveAllRadarBlips(uint8 *buf, uint32 *size)
{ {
*size = SAVE_HEADER_SIZE + sizeof(ms_RadarTrace); *size = SAVE_HEADER_SIZE + sizeof(ms_RadarTrace);
@ -1242,121 +1358,6 @@ void CRadar::TransformRealWorldPointToRadarSpace(CVector2D &out, const CVector2D
out.y = c * y - s * x; out.y = c * y - s * x;
} }
// Transform from section indices to world coordinates
void CRadar::GetTextureCorners(int32 x, int32 y, CVector2D *out)
{
x = x - RADAR_NUM_TILES/2;
y = -(y - RADAR_NUM_TILES/2);
// bottom left
out[0].x = RADAR_TILE_SIZE * (x);
out[0].y = RADAR_TILE_SIZE * (y - 1);
// bottom right
out[1].x = RADAR_TILE_SIZE * (x + 1);
out[1].y = RADAR_TILE_SIZE * (y - 1);
// top right
out[2].x = RADAR_TILE_SIZE * (x + 1);
out[2].y = RADAR_TILE_SIZE * (y);
// top left
out[3].x = RADAR_TILE_SIZE * (x);
out[3].y = RADAR_TILE_SIZE * (y);
}
void CRadar::ClipRadarTileCoords(int32 &x, int32 &y)
{
if (x < 0)
x = 0;
if (x > RADAR_NUM_TILES-1)
x = RADAR_NUM_TILES-1;
if (y < 0)
y = 0;
if (y > RADAR_NUM_TILES-1)
y = RADAR_NUM_TILES-1;
}
bool CRadar::IsPointInsideRadar(const CVector2D &point)
{
if (point.x < -1.0f || point.x > 1.0f) return false;
if (point.y < -1.0f || point.y > 1.0f) return false;
return true;
}
// clip line p1,p2 against (-1.0, 1.0) in x and y, set out to clipped point closest to p1
int CRadar::LineRadarBoxCollision(CVector2D &out, const CVector2D &p1, const CVector2D &p2)
{
float d1, d2;
float t;
float x, y;
float shortest = 1.0f;
int edge = -1;
// clip against left edge, x = -1.0
d1 = -1.0f - p1.x;
d2 = -1.0f - p2.x;
if (d1 * d2 < 0.0f) {
// they are on opposite sides, get point of intersection
t = d1 / (d1 - d2);
y = (p2.y - p1.y)*t + p1.y;
if (y >= -1.0f && y <= 1.0f && t <= shortest) {
out.x = -1.0f;
out.y = y;
edge = 3;
shortest = t;
}
}
// clip against right edge, x = 1.0
d1 = p1.x - 1.0f;
d2 = p2.x - 1.0f;
if (d1 * d2 < 0.0f) {
// they are on opposite sides, get point of intersection
t = d1 / (d1 - d2);
y = (p2.y - p1.y)*t + p1.y;
if (y >= -1.0f && y <= 1.0f && t <= shortest) {
out.x = 1.0f;
out.y = y;
edge = 1;
shortest = t;
}
}
// clip against top edge, y = -1.0
d1 = -1.0f - p1.y;
d2 = -1.0f - p2.y;
if (d1 * d2 < 0.0f) {
// they are on opposite sides, get point of intersection
t = d1 / (d1 - d2);
x = (p2.x - p1.x)*t + p1.x;
if (x >= -1.0f && x <= 1.0f && t <= shortest) {
out.y = -1.0f;
out.x = x;
edge = 0;
shortest = t;
}
}
// clip against bottom edge, y = 1.0
d1 = p1.y - 1.0f;
d2 = p2.y - 1.0f;
if (d1 * d2 < 0.0f) {
// they are on opposite sides, get point of intersection
t = d1 / (d1 - d2);
x = (p2.x - p1.x)*t + p1.x;
if (x >= -1.0f && x <= 1.0f && t <= shortest) {
out.y = 1.0f;
out.x = x;
edge = 2;
shortest = t;
}
}
return edge;
}
void void
CRadar::CalculateCachedSinCos() CRadar::CalculateCachedSinCos()
{ {
@ -1488,8 +1489,14 @@ STARTPATCHES
InjectHook(0x4A5C60, CRadar::SetRadarMarkerState, PATCH_JUMP); InjectHook(0x4A5C60, CRadar::SetRadarMarkerState, PATCH_JUMP);
InjectHook(0x4A5D10, CRadar::DrawRotatingRadarSprite, PATCH_JUMP); InjectHook(0x4A5D10, CRadar::DrawRotatingRadarSprite, PATCH_JUMP);
InjectHook(0x4A5EF0, CRadar::DrawRadarSprite, PATCH_JUMP); InjectHook(0x4A5EF0, CRadar::DrawRadarSprite, PATCH_JUMP);
InjectHook(0x4A6020, ClipRadarTileCoords, PATCH_JUMP);
InjectHook(0x4A6060, RequestMapSection, PATCH_JUMP);
InjectHook(0x4A60A0, RemoveMapSection, PATCH_JUMP);
InjectHook(0x4A60E0, CRadar::RemoveRadarSections, PATCH_JUMP); InjectHook(0x4A60E0, CRadar::RemoveRadarSections, PATCH_JUMP);
InjectHook(0x4A6100, (void (*)(int32, int32))&CRadar::StreamRadarSections, PATCH_JUMP); InjectHook(0x4A6100, (void (*)(int32, int32))&CRadar::StreamRadarSections, PATCH_JUMP);
InjectHook(0x4A6160, IsPointInsideRadar, PATCH_JUMP);
InjectHook(0x4A61C0, GetTextureCorners, PATCH_JUMP);
InjectHook(0x4A6250, LineRadarBoxCollision, PATCH_JUMP);
InjectHook(0x4A64A0, CRadar::ClipRadarPoly, PATCH_JUMP); InjectHook(0x4A64A0, CRadar::ClipRadarPoly, PATCH_JUMP);
InjectHook(0x4A67E0, CRadar::DrawRadarSection, PATCH_JUMP); InjectHook(0x4A67E0, CRadar::DrawRadarSection, PATCH_JUMP);
InjectHook(0x4A69C0, CRadar::DrawRadarMask, PATCH_JUMP); InjectHook(0x4A69C0, CRadar::DrawRadarMask, PATCH_JUMP);
@ -1497,8 +1504,6 @@ STARTPATCHES
InjectHook(0x4A6C20, CRadar::DrawRadarMap, PATCH_JUMP); InjectHook(0x4A6C20, CRadar::DrawRadarMap, PATCH_JUMP);
InjectHook(0x4A6E30, CRadar::SaveAllRadarBlips, PATCH_JUMP); InjectHook(0x4A6E30, CRadar::SaveAllRadarBlips, PATCH_JUMP);
InjectHook(0x4A6F30, CRadar::LoadAllRadarBlips, PATCH_JUMP); InjectHook(0x4A6F30, CRadar::LoadAllRadarBlips, PATCH_JUMP);
//InjectHook(0x4A7000, `global constructor keyed to'Radar.cpp, PATCH_JUMP);
InjectHook(0x4A61C0, CRadar::GetTextureCorners, PATCH_JUMP); //InjectHook(0x4A7260, sRadarTrace::sRadarTrace, PATCH_JUMP);
InjectHook(0x4A6160, CRadar::IsPointInsideRadar, PATCH_JUMP);
InjectHook(0x4A6250, CRadar::LineRadarBoxCollision, PATCH_JUMP);
ENDPATCHES ENDPATCHES

View File

@ -56,7 +56,7 @@ enum
BLIP_MODE_SQUARE, BLIP_MODE_SQUARE,
}; };
struct CBlip struct sRadarTrace
{ {
uint32 m_nColor; uint32 m_nColor;
uint32 m_eBlipType; // eBlipType uint32 m_eBlipType; // eBlipType
@ -71,7 +71,7 @@ struct CBlip
uint16 m_eBlipDisplay; // eBlipDisplay uint16 m_eBlipDisplay; // eBlipDisplay
uint16 m_eRadarSprite; // eRadarSprite uint16 m_eRadarSprite; // eRadarSprite
}; };
static_assert(sizeof(CBlip) == 0x30, "CBlip: error"); static_assert(sizeof(sRadarTrace) == 0x30, "sRadarTrace: error");
// Values for screen space // Values for screen space
#define RADAR_LEFT (40.0f) #define RADAR_LEFT (40.0f)
@ -83,7 +83,7 @@ class CRadar
{ {
public: public:
static float &m_radarRange; static float &m_radarRange;
static CBlip (&ms_RadarTrace)[NUMRADARBLIPS]; static sRadarTrace (&ms_RadarTrace)[NUMRADARBLIPS];
static CSprite2d AsukaSprite; static CSprite2d AsukaSprite;
static CSprite2d BombSprite; static CSprite2d BombSprite;
static CSprite2d CatSprite; static CSprite2d CatSprite;
@ -144,7 +144,6 @@ public:
static void LoadAllRadarBlips(uint8 *buf, uint32 size); static void LoadAllRadarBlips(uint8 *buf, uint32 size);
static void LoadTextures(); static void LoadTextures();
static void RemoveRadarSections(); static void RemoveRadarSections();
static void RequestMapSection(int32 x, int32 y);
static void SaveAllRadarBlips(uint8*, uint32*); static void SaveAllRadarBlips(uint8*, uint32*);
static void SetBlipSprite(int32 i, int32 icon); static void SetBlipSprite(int32 i, int32 icon);
static int32 SetCoordBlip(eBlipType type, CVector pos, int32, eBlipDisplay); static int32 SetCoordBlip(eBlipType type, CVector pos, int32, eBlipDisplay);
@ -161,10 +160,6 @@ public:
static void TransformRadarPointToScreenSpace(CVector2D &out, const CVector2D &in); static void TransformRadarPointToScreenSpace(CVector2D &out, const CVector2D &in);
static void TransformRealWorldPointToRadarSpace(CVector2D &out, const CVector2D &in); static void TransformRealWorldPointToRadarSpace(CVector2D &out, const CVector2D &in);
// no in CRadar in the game: // no in CRadar in the game:
static void GetTextureCorners(int32 x, int32 y, CVector2D *out);
static void ClipRadarTileCoords(int32 &x, int32 &y);
static bool IsPointInsideRadar(const CVector2D &);
static int LineRadarBoxCollision(CVector2D &, const CVector2D &, const CVector2D &);
static void CalculateCachedSinCos(); static void CalculateCachedSinCos();
}; };

View File

@ -150,6 +150,7 @@ enum Config {
//#define MASTER //#define MASTER
#if defined GTA_PS2 #if defined GTA_PS2
# define GTA_PS2_STUFF
# define RANDOMSPLASH # define RANDOMSPLASH
#elif defined GTA_PC #elif defined GTA_PC
# define GTA3_1_1_PATCH # define GTA3_1_1_PATCH

View File

@ -455,8 +455,10 @@ LoadingScreen(const char *str1, const char *str2, const char *splashscreen)
splash = LoadSplash(splashscreen); splash = LoadSplash(splashscreen);
#ifndef GTA_PS2
if(RsGlobal.quit) if(RsGlobal.quit)
return; return;
#endif
if(DoRWStuffStartOfFrame(0, 0, 0, 0, 0, 0, 255)){ if(DoRWStuffStartOfFrame(0, 0, 0, 0, 0, 0, 255)){
CSprite2d::SetRecipNearClip(); CSprite2d::SetRecipNearClip();
@ -1226,7 +1228,7 @@ AppEventHandler(RsEvent event, void *param)
void void
TheModelViewer(void) TheModelViewer(void)
{ {
#if (defined(PS2) || defined(XBOX)) #if (defined(GTA_PS2) || defined(GTA_XBOX))
//TODO //TODO
#else #else
#ifdef ASPECT_RATIO_SCALE #ifdef ASPECT_RATIO_SCALE
@ -1255,13 +1257,13 @@ void TheGame(void)
{ {
printf("Into TheGame!!!\n"); printf("Into TheGame!!!\n");
#ifdef PS2 #ifdef GTA_PS2
gMainHeap.PushMemId(_TODOCONST(1)); gMainHeap.PushMemId(_TODOCONST(1));
#endif #endif
CTimer::Initialise(); CTimer::Initialise();
#ifdef PS2 #ifdef GTA_PS2
CGame::Initialise(); CGame::Initialise();
#else #else
CGame::Initialise("DATA\\GTA3.DAT"); CGame::Initialise("DATA\\GTA3.DAT");
@ -1271,10 +1273,8 @@ void TheGame(void)
LoadingScreen("Starting Game", NULL, splash); LoadingScreen("Starting Game", NULL, splash);
#ifdef PS2 #ifdef GTA_PS2
int32 state = TheMemoryCard.CheckCardInserted(_TODOCONST(0)); if ( TheMemoryCard.CheckCardInserted(_TODOCONST(0)) == _TODOCONST(26)
if (state == _TODOCONST(26)
&& TheMemoryCard.ChangeDirectory(_TODOCONST(0), TheMemoryCard.field154) && TheMemoryCard.ChangeDirectory(_TODOCONST(0), TheMemoryCard.field154)
&& TheMemoryCard.FindMostRecentFileName(_TODOCONST(0), TheMemoryCard.field37) == 1 && TheMemoryCard.FindMostRecentFileName(_TODOCONST(0), TheMemoryCard.field37) == 1
&& TheMemoryCard.CheckDataNotCorrupt(TheMemoryCard.field37)) && TheMemoryCard.CheckDataNotCorrupt(TheMemoryCard.field37))
@ -1324,12 +1324,12 @@ void TheGame(void)
CSprite2d::InitPerFrame(); CSprite2d::InitPerFrame();
CFont::InitPerFrame(); CFont::InitPerFrame();
#ifdef PS2 #ifdef GTA_PS2
gMainHeap.PushMemId(_TODOCONST(12)); gMainHeap.PushMemId(_TODOCONST(12));
#endif #endif
CPointLights::NumLights = 0; CPointLights::NumLights = 0;
CGame::Process(); CGame::Process();
#ifdef PS2 #ifdef GTA_PS2
gMainHeap.PopMemId(); gMainHeap.PopMemId();
#endif #endif
@ -1354,18 +1354,18 @@ void TheGame(void)
break; break;
SetLightsWithTimeOfDayColour(Scene.world); SetLightsWithTimeOfDayColour(Scene.world);
#ifdef PS2 #ifdef GTA_PS2
gMainHeap.PushMemId(_TODOCONST(15)); gMainHeap.PushMemId(_TODOCONST(15));
#endif #endif
if (!FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.m_bRenderGameInMenu == true && TheCamera.GetScreenFadeStatus() != FADE_2 ) if (!FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.m_bRenderGameInMenu == true && TheCamera.GetScreenFadeStatus() != FADE_2 )
{ {
#ifdef PS2 #ifdef GTA_PS2
gMainHeap.PushMemId(_TODOCONST(11)); gMainHeap.PushMemId(_TODOCONST(11));
#endif #endif
CRenderer::ConstructRenderList(); CRenderer::ConstructRenderList();
CRenderer::PreRender(); CRenderer::PreRender();
#ifdef PS2 #ifdef GTA_PS2
gMainHeap.PopMemId(); gMainHeap.PopMemId();
#endif #endif
@ -1405,7 +1405,7 @@ void TheGame(void)
if (FrontEndMenuManager.m_bWantToLoad) if (FrontEndMenuManager.m_bWantToLoad)
#endif #endif
{ {
#ifdef PS2 #ifdef GTA_PS2
gMainHeap.PopMemId(); gMainHeap.PopMemId();
#endif #endif
break; break;
@ -1424,7 +1424,7 @@ void TheGame(void)
CTimer::Update(); CTimer::Update();
#ifdef PS2 #ifdef GTA_PS2
gMainHeap.PopMemId(); gMainHeap.PopMemId();
#endif #endif
@ -1478,11 +1478,11 @@ void SystemInit()
mwInit(); mwInit();
#endif #endif
#ifdef PS2 #ifdef GTA_PS2
InitMemoryMgr(); InitMemoryMgr();
#endif #endif
#ifdef PS2 #ifdef GTA_PS2
CFileMgr::InitCdSystem(); CFileMgr::InitCdSystem();
char path[256]; char path[256];
@ -1505,10 +1505,9 @@ void SystemInit()
CFileMgr::Initialise(); CFileMgr::Initialise();
#ifdef PS2 #ifdef GTA_PS2
CFileMgr::InitCd(); CFileMgr::InitCd();
Char modulepath[256]; Char modulepath[256];
strcpy(modulepath, "cdrom0:\\"); strcpy(modulepath, "cdrom0:\\");
@ -1543,7 +1542,7 @@ void SystemInit()
#endif #endif
#ifdef PS2 #ifdef GTA_PS2
ThreadParam param; ThreadParam param;
param.entry = &IdleThread; param.entry = &IdleThread;
@ -1567,7 +1566,7 @@ void SystemInit()
CGame::nastyGame = true; CGame::nastyGame = true;
CMenuManager::m_PrefsAllowNastyGame = true; CMenuManager::m_PrefsAllowNastyGame = true;
#ifdef PS2 #ifdef GTA_PS2
int32 lang = sceScfGetLanguage(); int32 lang = sceScfGetLanguage();
if ( lang == SCE_ITALIAN_LANGUAGE ) if ( lang == SCE_ITALIAN_LANGUAGE )
CMenuManager::m_PrefsLanguage = LANGUAGE_ITALIAN; CMenuManager::m_PrefsLanguage = LANGUAGE_ITALIAN;
@ -1604,7 +1603,7 @@ void GameInit()
{ {
if ( !gameAlreadyInitialised ) if ( !gameAlreadyInitialised )
{ {
#ifdef PS2 #ifdef GTA_PS2
char path[256]; char path[256];
strcpy(path, "cdrom0:\\"); strcpy(path, "cdrom0:\\");
@ -1630,7 +1629,7 @@ void GameInit()
//TODO //TODO
#endif #endif
#ifdef PS2 #ifdef GTA_PS2
char *files[] = char *files[] =
{ {
"\\ANIM\\CUTS.IMG;1", "\\ANIM\\CUTS.IMG;1",
@ -1730,7 +1729,7 @@ void GameInit()
CreateDebugFont(); CreateDebugFont();
#ifdef PS2 #ifdef GTA_PS2
AddIntcHandler(_TODOCONST(2), VBlankCounter, 0); AddIntcHandler(_TODOCONST(2), VBlankCounter, 0);
#endif #endif
@ -1738,18 +1737,18 @@ void GameInit()
CSprite2d::SetRecipNearClip(); CSprite2d::SetRecipNearClip();
CTxdStore::Initialise(); CTxdStore::Initialise();
#ifdef PS2 #ifdef GTA_PS2
gMainHeap.PushMemId(_TODOCONST(9)); gMainHeap.PushMemId(_TODOCONST(9));
#endif #endif
CFont::Initialise(); CFont::Initialise();
CHud::Initialise(); CHud::Initialise();
#ifdef PS2 #ifdef GTA_PS2
gMainHeap.PopMemId(); gMainHeap.PopMemId();
#endif #endif
ValidateVersion(); ValidateVersion();
#ifdef PS2 #ifdef GTA_PS2
sceCdCLOCK rtc; sceCdCLOCK rtc;
sceCdReadClock(&rtc); sceCdReadClock(&rtc);
uint32 seed = rtc.minute + rtc.day; uint32 seed = rtc.minute + rtc.day;
@ -1789,7 +1788,7 @@ main(int argc, char *argv[])
} }
#endif #endif
#ifdef PS2 #ifdef GTA_PS2
{ {
if (gameAlreadyInitialised) if (gameAlreadyInitialised)
RpSkySuspend(); RpSkySuspend();

View File

@ -815,7 +815,7 @@ void CHud::Draw()
DrawScriptText DrawScriptText
*/ */
if (!CTimer::GetIsUserPaused()) { if (!CTimer::GetIsUserPaused()) {
CTextLine* IntroText = CTheScripts::IntroTextLines; intro_text_line* IntroText = CTheScripts::IntroTextLines;
for (int i = 0; i < MAX_NUM_INTRO_TEXT_LINES; i++) { for (int i = 0; i < MAX_NUM_INTRO_TEXT_LINES; i++) {
if (CTheScripts::IntroTextLines[i].m_Text[0] && CTheScripts::IntroTextLines[i].m_bTextBeforeFade) { if (CTheScripts::IntroTextLines[i].m_Text[0] && CTheScripts::IntroTextLines[i].m_bTextBeforeFade) {
@ -862,7 +862,7 @@ void CHud::Draw()
} }
} }
CScriptRectangle* IntroRect = CTheScripts::IntroRectangles; intro_script_rectangle* IntroRect = CTheScripts::IntroRectangles;
for (int i = 0; i < 16; i++) { for (int i = 0; i < 16; i++) {
if (CTheScripts::IntroRectangles[i].m_bIsUsed && CTheScripts::IntroRectangles[i].m_bBeforeFade) { if (CTheScripts::IntroRectangles[i].m_bIsUsed && CTheScripts::IntroRectangles[i].m_bBeforeFade) {