diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/animation/AnimManager.cpp | 12 | ||||
-rw-r--r-- | src/animation/AnimManager.h | 12 | ||||
-rw-r--r-- | src/animation/CutsceneMgr.cpp | 26 | ||||
-rw-r--r-- | src/animation/CutsceneMgr.h | 26 | ||||
-rw-r--r-- | src/audio/sampman.cpp | 3 | ||||
-rw-r--r-- | src/control/Bridge.cpp | 20 | ||||
-rw-r--r-- | src/control/Bridge.h | 10 | ||||
-rw-r--r-- | src/control/Darkel.cpp | 40 | ||||
-rw-r--r-- | src/control/Darkel.h | 32 | ||||
-rw-r--r-- | src/control/Garages.cpp | 45 | ||||
-rw-r--r-- | src/control/Garages.h | 44 | ||||
-rw-r--r-- | src/core/MenuScreens.h | 2 | ||||
-rw-r--r-- | src/core/Radar.cpp | 8 | ||||
-rw-r--r-- | src/core/Radar.h | 5 | ||||
-rw-r--r-- | src/core/re3.cpp | 18 | ||||
-rw-r--r-- | src/peds/Ped.cpp | 94 | ||||
-rw-r--r-- | src/peds/PedRoutes.cpp | 2 | ||||
-rw-r--r-- | src/peds/PedStats.cpp | 1 | ||||
-rw-r--r-- | src/peds/PedType.cpp | 2 | ||||
-rw-r--r-- | src/peds/PedType.h | 2 | ||||
-rw-r--r-- | src/render/Clouds.cpp | 14 | ||||
-rw-r--r-- | src/render/Clouds.h | 12 | ||||
-rw-r--r-- | src/render/Console.cpp | 2 | ||||
-rw-r--r-- | src/render/Console.h | 2 | ||||
-rw-r--r-- | src/render/Coronas.cpp | 16 | ||||
-rw-r--r-- | src/render/Coronas.h | 16 | ||||
-rw-r--r-- | src/render/Sprite2d.cpp | 2 | ||||
-rw-r--r-- | src/render/Sprite2d.h | 2 | ||||
-rw-r--r-- | src/rw/Lights.cpp | 2 |
29 files changed, 266 insertions, 206 deletions
diff --git a/src/animation/AnimManager.cpp b/src/animation/AnimManager.cpp index e5721bdf..82343e93 100644 --- a/src/animation/AnimManager.cpp +++ b/src/animation/AnimManager.cpp @@ -10,12 +10,12 @@ #include "AnimBlendAssocGroup.h" #include "AnimManager.h" -CAnimBlock *CAnimManager::ms_aAnimBlocks = (CAnimBlock*)0x6F01A0; -CAnimBlendHierarchy *CAnimManager::ms_aAnimations = (CAnimBlendHierarchy*)0x70F430; -int32 &CAnimManager::ms_numAnimBlocks = *(int32*)0x885AF8; -int32 &CAnimManager::ms_numAnimations = *(int32*)0x8E2DD4; -CAnimBlendAssocGroup *&CAnimManager::ms_aAnimAssocGroups = *(CAnimBlendAssocGroup**)0x8F583C; -CLinkList<CAnimBlendHierarchy*> &CAnimManager::ms_animCache = *(CLinkList<CAnimBlendHierarchy*>*)0x9414DC; +CAnimBlock CAnimManager::ms_aAnimBlocks[2]; +CAnimBlendHierarchy CAnimManager::ms_aAnimations[250]; +int32 CAnimManager::ms_numAnimBlocks; +int32 CAnimManager::ms_numAnimations; +CAnimBlendAssocGroup *CAnimManager::ms_aAnimAssocGroups; +CLinkList<CAnimBlendHierarchy*> CAnimManager::ms_animCache; AnimAssocDesc aStdAnimDescs[] = { { ANIM_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_FLAG80 }, diff --git a/src/animation/AnimManager.h b/src/animation/AnimManager.h index 0d4e17fe..93fec74b 100644 --- a/src/animation/AnimManager.h +++ b/src/animation/AnimManager.h @@ -242,12 +242,12 @@ struct AnimAssocDefinition class CAnimManager { static const AnimAssocDefinition ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS]; - static CAnimBlock *ms_aAnimBlocks; //[2] - static CAnimBlendHierarchy *ms_aAnimations; //[250] - static int32 &ms_numAnimBlocks; - static int32 &ms_numAnimations; - static CAnimBlendAssocGroup *&ms_aAnimAssocGroups; - static CLinkList<CAnimBlendHierarchy*> &ms_animCache; + static CAnimBlock ms_aAnimBlocks[2]; + static CAnimBlendHierarchy ms_aAnimations[250]; + static int32 ms_numAnimBlocks; + static int32 ms_numAnimations; + static CAnimBlendAssocGroup *ms_aAnimAssocGroups; + static CLinkList<CAnimBlendHierarchy*> ms_animCache; public: static void Initialise(void); diff --git a/src/animation/CutsceneMgr.cpp b/src/animation/CutsceneMgr.cpp index 6f8e9790..5c0daaf0 100644 --- a/src/animation/CutsceneMgr.cpp +++ b/src/animation/CutsceneMgr.cpp @@ -117,19 +117,19 @@ FindCutsceneAudioTrackId(const char *szCutsceneName) return -1; } -bool &CCutsceneMgr::ms_running = *(bool*)0x95CCF5; -bool &CCutsceneMgr::ms_cutsceneProcessing = *(bool*)0x95CD9F; -CDirectory *&CCutsceneMgr::ms_pCutsceneDir = *(CDirectory**)0x8F5F88; -CCutsceneObject *(&CCutsceneMgr::ms_pCutsceneObjects)[NUMCUTSCENEOBJECTS] = *(CCutsceneObject*(*)[NUMCUTSCENEOBJECTS]) *(uintptr*) 0x862170; -int32 &CCutsceneMgr::ms_numCutsceneObjs = *(int32*)0x942FA4; -bool &CCutsceneMgr::ms_loaded = *(bool*)0x95CD95; -bool &CCutsceneMgr::ms_animLoaded = *(bool*)0x95CDA0; -bool &CCutsceneMgr::ms_useLodMultiplier = *(bool*)0x95CD74; -char(&CCutsceneMgr::ms_cutsceneName)[CUTSCENENAMESIZE] = *(char(*)[CUTSCENENAMESIZE]) *(uintptr*)0x70D9D0; -CAnimBlendAssocGroup &CCutsceneMgr::ms_cutsceneAssociations = *(CAnimBlendAssocGroup*)0x709C58; -CVector &CCutsceneMgr::ms_cutsceneOffset = *(CVector*)0x8F2C0C; -float &CCutsceneMgr::ms_cutsceneTimer = *(float*)0x941548; -uint32 &CCutsceneMgr::ms_cutsceneLoadStatus = *(uint32*)0x95CB40; +bool CCutsceneMgr::ms_running; +bool CCutsceneMgr::ms_cutsceneProcessing; +CDirectory *CCutsceneMgr::ms_pCutsceneDir; +CCutsceneObject *CCutsceneMgr::ms_pCutsceneObjects[NUMCUTSCENEOBJECTS]; +int32 CCutsceneMgr::ms_numCutsceneObjs; +bool CCutsceneMgr::ms_loaded; +bool CCutsceneMgr::ms_animLoaded; +bool CCutsceneMgr::ms_useLodMultiplier; +char CCutsceneMgr::ms_cutsceneName[CUTSCENENAMESIZE]; +CAnimBlendAssocGroup CCutsceneMgr::ms_cutsceneAssociations; +CVector CCutsceneMgr::ms_cutsceneOffset; +float CCutsceneMgr::ms_cutsceneTimer; +uint32 CCutsceneMgr::ms_cutsceneLoadStatus; RpAtomic * CalculateBoundingSphereRadiusCB(RpAtomic *atomic, void *data) diff --git a/src/animation/CutsceneMgr.h b/src/animation/CutsceneMgr.h index a455e784..bfdcdb57 100644 --- a/src/animation/CutsceneMgr.h +++ b/src/animation/CutsceneMgr.h @@ -9,22 +9,22 @@ class CCutsceneHead; class CCutsceneMgr { - static bool &ms_running; - static CCutsceneObject *(&ms_pCutsceneObjects)[NUMCUTSCENEOBJECTS]; + static bool ms_running; + static CCutsceneObject *ms_pCutsceneObjects[NUMCUTSCENEOBJECTS]; - static int32 &ms_numCutsceneObjs; - static bool &ms_loaded; - static bool &ms_animLoaded; - static bool &ms_useLodMultiplier; + static int32 ms_numCutsceneObjs; + static bool ms_loaded; + static bool ms_animLoaded; + static bool ms_useLodMultiplier; - static char(&ms_cutsceneName)[CUTSCENENAMESIZE]; - static CAnimBlendAssocGroup &ms_cutsceneAssociations; - static CVector &ms_cutsceneOffset; - static float &ms_cutsceneTimer; - static bool &ms_cutsceneProcessing; + static char ms_cutsceneName[CUTSCENENAMESIZE]; + static CAnimBlendAssocGroup ms_cutsceneAssociations; + static CVector ms_cutsceneOffset; + static float ms_cutsceneTimer; + static bool ms_cutsceneProcessing; public: - static CDirectory *&ms_pCutsceneDir; - static uint32 &ms_cutsceneLoadStatus; + static CDirectory *ms_pCutsceneDir; + static uint32 ms_cutsceneLoadStatus; static void StartCutsceneProcessing() { ms_cutsceneProcessing = true; } static bool IsRunning(void) { return ms_running; } diff --git a/src/audio/sampman.cpp b/src/audio/sampman.cpp index 6dd744c3..7887c363 100644 --- a/src/audio/sampman.cpp +++ b/src/audio/sampman.cpp @@ -2221,6 +2221,9 @@ cSampleManager::InitialiseSampleBanks(void) for ( int32 i = 0; i < TOTAL_AUDIO_SAMPLES; i++ ) { +#ifdef FIX_BUGS + if (nBank >= MAX_SAMPLEBANKS) break; +#endif if ( BankStartOffset[nBank] == BankStartOffset[SAMPLEBANK_MAIN] + i ) { nSampleBankDiscStartOffset[nBank] = m_aSamples[i].nOffset; diff --git a/src/control/Bridge.cpp b/src/control/Bridge.cpp index 6a577449..53cf6af2 100644 --- a/src/control/Bridge.cpp +++ b/src/control/Bridge.cpp @@ -6,20 +6,20 @@ #include "PathFind.h" #include "Stats.h" -CEntity*& CBridge::pLiftRoad = *(CEntity**)0x8E2C8C; -CEntity*& CBridge::pLiftPart = *(CEntity**)0x8E2C94; -CEntity*& CBridge::pWeight = *(CEntity**)0x8E28BC; +CEntity *CBridge::pLiftRoad; +CEntity *CBridge::pLiftPart; +CEntity *CBridge::pWeight; -int& CBridge::State = *(int*)0x8F2A1C; -int& CBridge::OldState = *(int*)0x8F2A20; +int CBridge::State; +int CBridge::OldState; -float& CBridge::DefaultZLiftPart = *(float*)0x941430; -float& CBridge::DefaultZLiftRoad = *(float*)0x941438; -float& CBridge::DefaultZLiftWeight = *(float*)0x8F1A44; +float CBridge::DefaultZLiftPart; +float CBridge::DefaultZLiftRoad; +float CBridge::DefaultZLiftWeight; -float& CBridge::OldLift = *(float*)0x8F6254; +float CBridge::OldLift; -uint32& CBridge::TimeOfBridgeBecomingOperational = *(uint32*)0x8F2BC0; +uint32 CBridge::TimeOfBridgeBecomingOperational; void CBridge::Init() { diff --git a/src/control/Bridge.h b/src/control/Bridge.h index 63f41578..c5702629 100644 --- a/src/control/Bridge.h +++ b/src/control/Bridge.h @@ -14,11 +14,11 @@ enum bridgeStates { class CBridge { public: - static CEntity *&pLiftRoad, *&pLiftPart, *&pWeight; - static int &State, &OldState; - static float &DefaultZLiftPart, &DefaultZLiftRoad, &DefaultZLiftWeight; - static float &OldLift; - static uint32 &TimeOfBridgeBecomingOperational; + static CEntity *pLiftRoad, *pLiftPart, *pWeight; + static int State, OldState; + static float DefaultZLiftPart, DefaultZLiftRoad, DefaultZLiftWeight; + static float OldLift; + static uint32 TimeOfBridgeBecomingOperational; static void Init(); static void Update(); diff --git a/src/control/Darkel.cpp b/src/control/Darkel.cpp index b4d15abf..3265d1c2 100644 --- a/src/control/Darkel.cpp +++ b/src/control/Darkel.cpp @@ -17,29 +17,29 @@ #define FRENZY_ANY_PED -1 #define FRENZY_ANY_CAR -2 -int32 &CDarkel::TimeLimit = *(int32*)0x885BAC; -int32 &CDarkel::PreviousTime = *(int32*)0x885B00; -int32 &CDarkel::TimeOfFrenzyStart = *(int32*)0x9430D8; -int32 &CDarkel::WeaponType = *(int32*)0x9430F0; -int32 &CDarkel::AmmoInterruptedWeapon = *(int32*)0x8E29C8; -int32 &CDarkel::KillsNeeded = *(int32*)0x8F1AB8; -int8 &CDarkel::InterruptedWeapon = *(int8*)0x95CD60; +int32 CDarkel::TimeLimit; +int32 CDarkel::PreviousTime; +int32 CDarkel::TimeOfFrenzyStart; +int32 CDarkel::WeaponType; +int32 CDarkel::AmmoInterruptedWeapon; +int32 CDarkel::KillsNeeded; +int8 CDarkel::InterruptedWeapon; /* * bStandardSoundAndMessages is a completely beta thing, * makes game handle sounds & messages instead of SCM (just like in GTA2) * but it's never been used in the game. Has unused sliding text when frenzy completed etc. */ -int8 &CDarkel::bStandardSoundAndMessages = *(int8*)0x95CDB6; -int8 &CDarkel::bNeedHeadShot = *(int8*)0x95CDCA; -int8 &CDarkel::bProperKillFrenzy = *(int8*)0x95CD98; -uint16 &CDarkel::Status = *(uint16*)0x95CCB4; -uint16 (&CDarkel::RegisteredKills)[NUM_DEFAULT_MODELS] = *(uint16(*)[NUM_DEFAULT_MODELS]) * (uintptr*)0x6EDBE0; -int32 &CDarkel::ModelToKill = *(int32*)0x8F2C78; -int32 &CDarkel::ModelToKill2 = *(int32*)0x885B40; -int32 &CDarkel::ModelToKill3 = *(int32*)0x885B3C; -int32 &CDarkel::ModelToKill4 = *(int32*)0x885B34; -wchar *CDarkel::pStartMessage = (wchar*)0x8F2C08; +int8 CDarkel::bStandardSoundAndMessages; +int8 CDarkel::bNeedHeadShot; +int8 CDarkel::bProperKillFrenzy; +uint16 CDarkel::Status; +uint16 CDarkel::RegisteredKills[NUM_DEFAULT_MODELS]; +int32 CDarkel::ModelToKill; +int32 CDarkel::ModelToKill2; +int32 CDarkel::ModelToKill3; +int32 CDarkel::ModelToKill4; +wchar *CDarkel::pStartMessage; uint8 CDarkel::CalcFade(uint32 time, uint32 start, uint32 end) @@ -262,10 +262,10 @@ CDarkel::StartFrenzy(eWeaponType weaponType, int32 time, uint16 kill, int32 mode pStartMessage = text; if (text == TheText.Get("PAGE_00")) { - CDarkel::bProperKillFrenzy = 1; - CDarkel::pStartMessage = 0; + CDarkel::bProperKillFrenzy = true; + CDarkel::pStartMessage = nil; } else - bProperKillFrenzy = 0; + bProperKillFrenzy = false; bStandardSoundAndMessages = standardSound; bNeedHeadShot = needHeadShot; diff --git a/src/control/Darkel.h b/src/control/Darkel.h index 12ce4451..b6092dcb 100644 --- a/src/control/Darkel.h +++ b/src/control/Darkel.h @@ -16,22 +16,22 @@ enum class CDarkel { private: - static int32 &TimeLimit; - static int32 &PreviousTime; - static int32 &TimeOfFrenzyStart; - static int32 &WeaponType; - static int32 &AmmoInterruptedWeapon; - static int32 &KillsNeeded; - static int8 &InterruptedWeapon; - static int8 &bStandardSoundAndMessages; - static int8 &bNeedHeadShot; - static int8 &bProperKillFrenzy; - static uint16 &Status; - static uint16 (&RegisteredKills)[NUM_DEFAULT_MODELS]; - static int32 &ModelToKill; - static int32 &ModelToKill2; - static int32 &ModelToKill3; - static int32 &ModelToKill4; + static int32 TimeLimit; + static int32 PreviousTime; + static int32 TimeOfFrenzyStart; + static int32 WeaponType; + static int32 AmmoInterruptedWeapon; + static int32 KillsNeeded; + static int8 InterruptedWeapon; + static int8 bStandardSoundAndMessages; + static int8 bNeedHeadShot; + static int8 bProperKillFrenzy; + static uint16 Status; + static uint16 RegisteredKills[NUM_DEFAULT_MODELS]; + static int32 ModelToKill; + static int32 ModelToKill2; + static int32 ModelToKill3; + static int32 ModelToKill4; static wchar *pStartMessage; public: diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp index d187f666..cca8c3b8 100644 --- a/src/control/Garages.cpp +++ b/src/control/Garages.cpp @@ -111,27 +111,27 @@ const int32 gaCarsToCollectInCraigsGarages[TOTAL_COLLECTCARS_GARAGES][TOTAL_COLL { MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_LANDSTAL, MI_CHEETAH, MI_TAXI, MI_ESPERANT, MI_SENTINEL, MI_IDAHO } }; -int32& CGarages::BankVansCollected = *(int32*)0x8F1B34; -bool& CGarages::BombsAreFree = *(bool*)0x95CD7A; -bool& CGarages::RespraysAreFree = *(bool*)0x95CD1D; -int32& CGarages::CarsCollected = *(int32*)0x880E18; -int32(&CGarages::CarTypesCollected)[TOTAL_COLLECTCARS_GARAGES] = *(int32(*)[TOTAL_COLLECTCARS_GARAGES]) * (uintptr*)0x8E286C; -int32& CGarages::CrushedCarId = *(int32*)0x943060; -uint32& CGarages::LastTimeHelpMessage = *(uint32*)0x8F1B58; -int32& CGarages::MessageNumberInString = *(int32*)0x885BA8; -char(&CGarages::MessageIDString)[MESSAGE_LENGTH] = *(char(*)[MESSAGE_LENGTH]) * (uintptr*)0x878358; -int32& CGarages::MessageNumberInString2 = *(int32*)0x8E2C14; -uint32& CGarages::MessageStartTime = *(uint32*)0x8F2530; -uint32& CGarages::MessageEndTime = *(uint32*)0x8F597C; -uint32& CGarages::NumGarages = *(uint32*)0x8F29F4; -bool& CGarages::PlayerInGarage = *(bool*)0x95CD83; -int32& CGarages::PoliceCarsCollected = *(int32*)0x941444; -CStoredCar(&CGarages::aCarsInSafeHouse1)[NUM_GARAGE_STORED_CARS] = *(CStoredCar(*)[NUM_GARAGE_STORED_CARS]) * (uintptr*)0x6FA210; -CStoredCar(&CGarages::aCarsInSafeHouse2)[NUM_GARAGE_STORED_CARS] = *(CStoredCar(*)[NUM_GARAGE_STORED_CARS]) * (uintptr*)0x6FA300; -CStoredCar(&CGarages::aCarsInSafeHouse3)[NUM_GARAGE_STORED_CARS] = *(CStoredCar(*)[NUM_GARAGE_STORED_CARS]) * (uintptr*)0x6FA3F0; -int32& CGarages::AudioEntity = *(int32*)0x5ECEA8; -CGarage(&CGarages::aGarages)[NUM_GARAGES] = *(CGarage(*)[NUM_GARAGES]) * (uintptr*)0x72BCD0; -bool& CGarages::bCamShouldBeOutisde = *(bool*)0x95CDB2; +int32 CGarages::BankVansCollected; +bool CGarages::BombsAreFree; +bool CGarages::RespraysAreFree; +int32 CGarages::CarsCollected; +int32 CGarages::CarTypesCollected[TOTAL_COLLECTCARS_GARAGES]; +int32 CGarages::CrushedCarId; +uint32 CGarages::LastTimeHelpMessage; +int32 CGarages::MessageNumberInString; +char CGarages::MessageIDString[MESSAGE_LENGTH]; +int32 CGarages::MessageNumberInString2; +uint32 CGarages::MessageStartTime; +uint32 CGarages::MessageEndTime; +uint32 CGarages::NumGarages; +bool CGarages::PlayerInGarage; +int32 CGarages::PoliceCarsCollected; +CStoredCar CGarages::aCarsInSafeHouse1[NUM_GARAGE_STORED_CARS]; +CStoredCar CGarages::aCarsInSafeHouse2[NUM_GARAGE_STORED_CARS]; +CStoredCar CGarages::aCarsInSafeHouse3[NUM_GARAGE_STORED_CARS]; +int32 CGarages::AudioEntity = AEHANDLE_NONE; +CGarage CGarages::aGarages[NUM_GARAGES]; +bool CGarages::bCamShouldBeOutisde; void CGarages::Init(void) { @@ -2256,7 +2256,7 @@ void CGarages::Save(uint8 * buf, uint32 * size) #endif } -CStoredCar::CStoredCar(const CStoredCar & other) +const CStoredCar &CStoredCar::operator=(const CStoredCar & other) { m_nModelIndex = other.m_nModelIndex; m_vecPos = other.m_vecPos; @@ -2272,6 +2272,7 @@ CStoredCar::CStoredCar(const CStoredCar & other) m_nVariationA = other.m_nVariationA; m_nVariationB = other.m_nVariationB; m_nCarBombType = other.m_nCarBombType; + return *this; } void CGarages::Load(uint8* buf, uint32 size) diff --git a/src/control/Garages.h b/src/control/Garages.h index 26e7a89a..65193b32 100644 --- a/src/control/Garages.h +++ b/src/control/Garages.h @@ -70,7 +70,7 @@ public: void Init() { m_nModelIndex = 0; } void Clear() { m_nModelIndex = 0; } bool HasCar() { return m_nModelIndex != 0; } - CStoredCar(const CStoredCar& other); + const CStoredCar &operator=(const CStoredCar& other); void StoreCar(CVehicle*); CVehicle* RestoreCar(); }; @@ -179,27 +179,27 @@ class CGarages enum { MESSAGE_LENGTH = 8 }; - static int32 &BankVansCollected; - static bool &BombsAreFree; - static bool &RespraysAreFree; - static int32 &CarsCollected; - static int32 (&CarTypesCollected)[TOTAL_COLLECTCARS_GARAGES]; - static int32 &CrushedCarId; - static uint32 &LastTimeHelpMessage; - static int32 &MessageNumberInString; - static char(&MessageIDString)[MESSAGE_LENGTH]; - static int32 &MessageNumberInString2; - static uint32 &MessageStartTime; - static uint32 &MessageEndTime; - static uint32 &NumGarages; - static bool &PlayerInGarage; - static int32 &PoliceCarsCollected; - static CGarage(&aGarages)[NUM_GARAGES]; - static CStoredCar(&aCarsInSafeHouse1)[NUM_GARAGE_STORED_CARS]; - static CStoredCar(&aCarsInSafeHouse2)[NUM_GARAGE_STORED_CARS]; - static CStoredCar(&aCarsInSafeHouse3)[NUM_GARAGE_STORED_CARS]; - static int32 &AudioEntity; - static bool &bCamShouldBeOutisde; + static int32 BankVansCollected; + static bool BombsAreFree; + static bool RespraysAreFree; + static int32 CarsCollected; + static int32 CarTypesCollected[TOTAL_COLLECTCARS_GARAGES]; + static int32 CrushedCarId; + static uint32 LastTimeHelpMessage; + static int32 MessageNumberInString; + static char MessageIDString[MESSAGE_LENGTH]; + static int32 MessageNumberInString2; + static uint32 MessageStartTime; + static uint32 MessageEndTime; + static uint32 NumGarages; + static bool PlayerInGarage; + static int32 PoliceCarsCollected; + static CGarage aGarages[NUM_GARAGES]; + static CStoredCar aCarsInSafeHouse1[NUM_GARAGE_STORED_CARS]; + static CStoredCar aCarsInSafeHouse2[NUM_GARAGE_STORED_CARS]; + static CStoredCar aCarsInSafeHouse3[NUM_GARAGE_STORED_CARS]; + static int32 AudioEntity; + static bool bCamShouldBeOutisde; public: static void Init(void); diff --git a/src/core/MenuScreens.h b/src/core/MenuScreens.h index e1b1bac6..8692d4dc 100644 --- a/src/core/MenuScreens.h +++ b/src/core/MenuScreens.h @@ -32,7 +32,7 @@ const CMenuScreen aScreens[] = { MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE, }, - // MENU_CONTROLLER_SETTINGS = 4 + // MENUPAGE_CONTROLLER_SETTINGS = 4 { "FET_CON", 1, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 0, 0, MENUACTION_CTRLCONFIG, "FEC_CCF", SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS, MENUACTION_CTRLDISPLAY, "FEC_CDP", SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS, diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp index 154e7e9a..ed24814d 100644 --- a/src/core/Radar.cpp +++ b/src/core/Radar.cpp @@ -16,9 +16,9 @@ #include "Streaming.h" #include "SpecialFX.h" -float &CRadar::m_radarRange = *(float*)0x8E281C; -sRadarTrace (&CRadar::ms_RadarTrace)[NUMRADARBLIPS] = *(sRadarTrace(*)[NUMRADARBLIPS]) * (uintptr*)0x6ED5E0; -CVector2D &vec2DRadarOrigin = *(CVector2D*)0x6299B8; +float CRadar::m_radarRange; +sRadarTrace CRadar::ms_RadarTrace[NUMRADARBLIPS]; +CVector2D vec2DRadarOrigin; int32 gRadarTxdIds[64];// = (int*)0x6299C0; CSprite2d CRadar::AsukaSprite;// = *(CSprite2d*)0x8F1A40; @@ -81,6 +81,7 @@ CRGBA CRadar::ArrowBlipColour2; uint16 CRadar::MapLegendCounter; uint16 CRadar::MapLegendList[NUM_MAP_LEGENDS]; int CRadar::TargetMarkerId = -1; +CVector CRadar::TargetMarkerPos; #endif // taken from VC @@ -1442,6 +1443,7 @@ CRadar::ToggleTargetMarker(float x, float y) ms_RadarTrace[nextBlip].m_bInUse = 1; ms_RadarTrace[nextBlip].m_Radius = 1.0f; CVector pos(x, y, CWorld::FindGroundZForCoord(x,y)); + TargetMarkerPos = pos; ms_RadarTrace[nextBlip].m_vec2DPos = pos; ms_RadarTrace[nextBlip].m_vecPos = pos; ms_RadarTrace[nextBlip].m_nEntityHandle = 0; diff --git a/src/core/Radar.h b/src/core/Radar.h index 27f3a6f0..e39a17f0 100644 --- a/src/core/Radar.h +++ b/src/core/Radar.h @@ -82,8 +82,8 @@ static_assert(sizeof(sRadarTrace) == 0x30, "sRadarTrace: error"); class CRadar { public: - static float &m_radarRange; - static sRadarTrace (&ms_RadarTrace)[NUMRADARBLIPS]; + static float m_radarRange; + static sRadarTrace ms_RadarTrace[NUMRADARBLIPS]; static CSprite2d AsukaSprite; static CSprite2d BombSprite; static CSprite2d CatSprite; @@ -114,6 +114,7 @@ public: static uint16 MapLegendList[NUM_MAP_LEGENDS]; static uint16 MapLegendCounter; static int TargetMarkerId; + static CVector TargetMarkerPos; static void InitFrontEndMap(); static void DrawYouAreHereSprite(float, float); diff --git a/src/core/re3.cpp b/src/core/re3.cpp index 5d76d642..2046a7f9 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -24,6 +24,8 @@ #include "Hud.h" #include "SceneEdit.h" #include "Pad.h" +#include "PlayerPed.h" +#include "Radar.h" #include <list> @@ -164,6 +166,19 @@ FixCar(void) ((CAutomobile*)veh)->Fix(); } +#ifdef MENU_MAP +static void +TeleportToWaypoint(void) +{ + if (FindPlayerVehicle()) { + if (CRadar::TargetMarkerId != -1) + FindPlayerVehicle()->Teleport(CRadar::TargetMarkerPos + CVector(0.0f, 0.0f, FindPlayerVehicle()->GetColModel()->boundingSphere.center.z)); + } else + if(CRadar::TargetMarkerId != -1) + FindPlayerPed()->Teleport(CRadar::TargetMarkerPos + CVector(0.0f, 0.0f, FEET_OFFSET)); +} +#endif + static int engineStatus; static void SetEngineStatus(void) @@ -335,6 +350,9 @@ DebugMenuPopulate(void) DebugMenuAddVarBool8("Debug", "Draw hud", (int8*)&CHud::m_Wants_To_Draw_Hud, nil); DebugMenuAddVarBool8("Debug", "Edit on", (int8*)&CSceneEdit::m_bEditOn, nil); +#ifdef MENU_MAP + DebugMenuAddCmd("Debug", "Teleport to map waypoint", TeleportToWaypoint); +#endif DebugMenuAddVar("Debug", "Engine Status", &engineStatus, nil, 1, 0, 226, nil); DebugMenuAddCmd("Debug", "Set Engine Status", SetEngineStatus); DebugMenuAddCmd("Debug", "Fix Car", FixCar); diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index 412b1f04..8ea41230 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -1623,6 +1623,15 @@ CPed::PedSetDraggedOutCarCB(CAnimBlendAssociation *dragAssoc, void *arg) if (ped->IsPlayer()) AudioManager.PlayerJustLeftCar(); +#ifdef VC_PED_PORTS + if (ped->m_objective == OBJECTIVE_LEAVE_CAR_AND_DIE) { + dragAssoc->SetDeleteCallback(PedSetDraggedOutCarPositionCB, ped); + ped->m_fHealth = 0.0f; + ped->SetDie(ANIM_FLOOR_HIT, 1000.0f, 0.5f); + return; + } +#endif + if (quickJackedAssoc) { dragAssoc->SetDeleteCallback(PedSetQuickDraggedOutCarPositionCB, ped); } else { @@ -5186,7 +5195,7 @@ CPed::SetFall(int extraTime, AnimationId animId, uint8 evenIfNotInControl) } if (extraTime == -1) { - m_getUpTimer = -1; + m_getUpTimer = UINT32_MAX; } else if (fallAssoc) { if (IsPlayer()) { m_getUpTimer = 1000.0f * fallAssoc->hierarchy->totalLength @@ -6448,7 +6457,7 @@ CPed::ExitCar(void) void CPed::Fall(void) { - if (m_getUpTimer != -1 && CTimer::GetTimeInMilliseconds() > m_getUpTimer + if (m_getUpTimer != UINT32_MAX && CTimer::GetTimeInMilliseconds() > m_getUpTimer #ifdef VC_PED_PORTS && bIsStanding #endif @@ -10663,7 +10672,7 @@ CPed::PedAnimDoorCloseCB(CAnimBlendAssociation *animAssoc, void *arg) return; if (ped->EnteringCar()) { - bool isLow = veh->bLowVehicle; + bool isLow = !!veh->bLowVehicle; if (!veh->bIsBus) veh->ProcessOpenDoor(ped->m_vehEnterType, ANIM_CAR_CLOSEDOOR_LHS, 1.0f); @@ -10691,7 +10700,11 @@ CPed::PedAnimDoorCloseCB(CAnimBlendAssociation *animAssoc, void *arg) #endif || !veh->IsRoomForPedToLeaveCar(CAR_DOOR_LF, nil))))) { - if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER) + if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_DRIVER +#ifdef VC_PED_PORTS + || ped->m_nPedState == PED_CARJACK +#endif + ) veh->bIsBeingCarJacked = false; ped->m_objective = OBJECTIVE_ENTER_CAR_AS_PASSENGER; @@ -11027,9 +11040,9 @@ CPed::PedAnimGetInCB(CAnimBlendAssociation *animAssoc, void *arg) PedSetInCarCB(nil, ped); return; } - bool isVan = veh->bIsVan; - bool isBus = veh->bIsBus; - bool isLow = veh->bLowVehicle; + bool isVan = !!veh->bIsVan; + bool isBus = !!veh->bIsBus; + bool isLow = !!veh->bLowVehicle; eDoors enterDoor; switch (ped->m_vehEnterType) { case CAR_DOOR_RF: @@ -11144,7 +11157,7 @@ CPed::PedAnimPullPedOutCB(CAnimBlendAssociation* animAssoc, void* arg) if (!ped->IsNotInWreckedVehicle()) return; - bool isLow = veh->bLowVehicle; + bool isLow = !!veh->bLowVehicle; int padNo; if (ped->IsPlayer()) { @@ -11426,7 +11439,9 @@ CPed::PedSetDraggedOutCarPositionCB(CAnimBlendAssociation* animAssoc, void* arg) CMatrix pedMat(ped->GetMatrix()); CVector posAfterBeingDragged = Multiply3x3(pedMat, (itsRearDoor ? -vecPedDraggedOutCarAnimOffset : vecPedDraggedOutCarAnimOffset)); posAfterBeingDragged += ped->GetPosition(); +#ifndef VC_PED_PORTS posAfterBeingDragged.z += 1.0f; +#endif CPedPlacement::FindZCoorForPed(&posAfterBeingDragged); ped->m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f); ped->GetPosition() = posAfterBeingDragged; @@ -11476,17 +11491,26 @@ CPed::PedSetDraggedOutCarPositionCB(CAnimBlendAssociation* animAssoc, void* arg) && ped->m_pMyVehicle->VehicleCreatedBy != MISSION_VEHICLE && driver && driver->IsPlayer() && !CTheScripts::IsPlayerOnAMission()) { +#ifndef VC_PED_PORTS if (CGeneral::GetRandomNumber() & 1) ped->SetObjective(OBJECTIVE_KILL_CHAR_ON_FOOT, driver); else +#endif ped->SetObjective(OBJECTIVE_ENTER_CAR_AS_DRIVER, ped->m_pMyVehicle); } else { - ped->m_nPedState = PED_NONE; - ped->m_nLastPedState = PED_NONE; - ped->SetFlee(ped->m_pMyVehicle->GetPosition(), 10000); - ped->bUsePedNodeSeek = true; - ped->m_pNextPathNode = nil; +#ifdef VC_PED_PORTS + if (ped->m_pedStats->m_temper > ped->m_pedStats->m_fear && ped->CharCreatedBy != MISSION_CHAR + && ped->m_pMyVehicle->VehicleCreatedBy != MISSION_VEHICLE && !driver + && FindPlayerPed()->m_carInObjective == ped->m_pMyVehicle && !CTheScripts::IsPlayerOnAMission()) + ped->SetObjective(OBJECTIVE_ENTER_CAR_AS_DRIVER, ped->m_pMyVehicle); + else +#endif + { + ped->m_nPedState = PED_NONE; + ped->m_nLastPedState = PED_NONE; + ped->SetFindPathAndFlee(ped->m_pMyVehicle->GetPosition(), 10000); + } } ped->SetGetUp(); } @@ -12289,24 +12313,36 @@ CPed::PedSetQuickDraggedOutCarPositionCB(CAnimBlendAssociation *animAssoc, void ped->Say(SOUND_PED_FLEE_RUN); } } else { - if (ped->m_pedStats->m_temper <= ped->m_pedStats->m_fear - || ped->CharCreatedBy == MISSION_CHAR || veh->VehicleCreatedBy == MISSION_VEHICLE - || !veh->pDriver || !veh->pDriver->IsPlayer() - || CTheScripts::IsPlayerOnAMission()) { + if (ped->m_pedStats->m_temper > ped->m_pedStats->m_fear + && ped->CharCreatedBy != MISSION_CHAR && veh->VehicleCreatedBy != MISSION_VEHICLE + && veh->pDriver && veh->pDriver->IsPlayer() + && !CTheScripts::IsPlayerOnAMission()) { - ped->SetFlee(veh->GetPosition(), 10000); - ped->bUsePedNodeSeek = true; - ped->m_pNextPathNode = nil; - if (CGeneral::GetRandomNumber() & 1 || ped->m_pedStats->m_fear > 70) { - ped->SetMoveState(PEDMOVE_SPRINT); - ped->Say(SOUND_PED_FLEE_SPRINT); - } else { - ped->Say(SOUND_PED_FLEE_RUN); +#ifndef VC_PED_PORTS + if (CGeneral::GetRandomNumber() < MYRAND_MAX / 2) { + ped->SetObjective(OBJECTIVE_KILL_CHAR_ON_FOOT, veh->pDriver); + } else +#endif + ped->SetObjective(OBJECTIVE_ENTER_CAR_AS_DRIVER, veh); + + } else { +#ifdef VC_PED_PORTS + if (ped->m_pedStats->m_temper > ped->m_pedStats->m_fear && ped->CharCreatedBy != MISSION_CHAR + && ped->m_pMyVehicle->VehicleCreatedBy != MISSION_VEHICLE && !veh->pDriver + && FindPlayerPed()->m_carInObjective == ped->m_pMyVehicle && !CTheScripts::IsPlayerOnAMission()) + ped->SetObjective(OBJECTIVE_ENTER_CAR_AS_DRIVER, veh); + else +#endif + { + ped->SetFindPathAndFlee(veh->GetPosition(), 10000); + if (CGeneral::GetRandomNumber() & 1 || ped->m_pedStats->m_fear > 70) { + ped->SetMoveState(PEDMOVE_SPRINT); + ped->Say(SOUND_PED_FLEE_SPRINT); + } else { + ped->Say(SOUND_PED_FLEE_RUN); + } } - } else if (CGeneral::GetRandomNumber() < 0x3FFF) { - ped->SetObjective(OBJECTIVE_KILL_CHAR_ON_FOOT, veh->pDriver); - } else - ped->SetObjective(OBJECTIVE_ENTER_CAR_AS_DRIVER, veh); + } } } if (ped->m_nLastPedState == PED_IDLE) diff --git a/src/peds/PedRoutes.cpp b/src/peds/PedRoutes.cpp index 3bc17002..b6512edd 100644 --- a/src/peds/PedRoutes.cpp +++ b/src/peds/PedRoutes.cpp @@ -3,7 +3,7 @@ #include "main.h" #include "PedRoutes.h" -CRouteNode (&gaRoutes)[NUMPEDROUTES] = *(CRouteNode(*)[NUMPEDROUTES]) * (uintptr*)0x62E090; +CRouteNode gaRoutes[NUMPEDROUTES]; void CRouteNode::Initialise() diff --git a/src/peds/PedStats.cpp b/src/peds/PedStats.cpp index 147f11e2..a2ccb567 100644 --- a/src/peds/PedStats.cpp +++ b/src/peds/PedStats.cpp @@ -4,7 +4,6 @@ #include "FileMgr.h" #include "PedStats.h" -//CPedStats *(&CPedStats::ms_apPedStats)[NUM_PEDSTATS] = *(CPedStats *(*)[NUM_PEDSTATS]) *(uintptr*)0x9404D4; CPedStats *CPedStats::ms_apPedStats[NUM_PEDSTATS]; void diff --git a/src/peds/PedType.cpp b/src/peds/PedType.cpp index 4c9d6b3f..30af6dcc 100644 --- a/src/peds/PedType.cpp +++ b/src/peds/PedType.cpp @@ -3,7 +3,7 @@ #include "FileMgr.h" #include "PedType.h" -CPedType *(&CPedType::ms_apPedType)[NUM_PEDTYPES] = *(CPedType *(*)[NUM_PEDTYPES]) *(uintptr*)0x941594; +CPedType *CPedType::ms_apPedType[NUM_PEDTYPES]; void CPedType::Initialise(void) diff --git a/src/peds/PedType.h b/src/peds/PedType.h index 3d927df5..c0c72550 100644 --- a/src/peds/PedType.h +++ b/src/peds/PedType.h @@ -71,7 +71,7 @@ class CPedType uint32 m_threats; uint32 m_avoid; - static CPedType *(&ms_apPedType)[NUM_PEDTYPES]; + static CPedType *ms_apPedType[NUM_PEDTYPES]; public: static void Initialise(void); diff --git a/src/render/Clouds.cpp b/src/render/Clouds.cpp index 7debe3d3..02035896 100644 --- a/src/render/Clouds.cpp +++ b/src/render/Clouds.cpp @@ -16,15 +16,15 @@ #define SMALLSTRIPHEIGHT 4.0f #define HORIZSTRIPHEIGHT 48.0f -RwTexture **gpCloudTex = (RwTexture**)0x9411C0; //[5]; +RwTexture *gpCloudTex[5]; -float &CClouds::CloudRotation = *(float*)0x8F5F40; -uint32 &CClouds::IndividualRotation = *(uint32*)0x943078; +float CClouds::CloudRotation; +uint32 CClouds::IndividualRotation; -float &CClouds::ms_cameraRoll = *(float*)0x8F29CC; -float &CClouds::ms_horizonZ = *(float*)0x8F31C0; -CRGBA &CClouds::ms_colourTop = *(CRGBA*)0x94143C; -CRGBA &CClouds::ms_colourBottom = *(CRGBA*)0x8F2C38; +float CClouds::ms_cameraRoll; +float CClouds::ms_horizonZ; +CRGBA CClouds::ms_colourTop; +CRGBA CClouds::ms_colourBottom; void CClouds::Init(void) diff --git a/src/render/Clouds.h b/src/render/Clouds.h index c8000569..4d8cd2c8 100644 --- a/src/render/Clouds.h +++ b/src/render/Clouds.h @@ -3,13 +3,13 @@ class CClouds { public: - static float &CloudRotation; - static uint32 &IndividualRotation; + static float CloudRotation; + static uint32 IndividualRotation; - static float &ms_cameraRoll; - static float &ms_horizonZ; - static CRGBA &ms_colourTop; - static CRGBA &ms_colourBottom; + static float ms_cameraRoll; + static float ms_horizonZ; + static CRGBA ms_colourTop; + static CRGBA ms_colourBottom; static void Init(void); static void Shutdown(void); diff --git a/src/render/Console.cpp b/src/render/Console.cpp index 545122b0..bfdb2701 100644 --- a/src/render/Console.cpp +++ b/src/render/Console.cpp @@ -9,7 +9,7 @@ #define CONSOLE_Y_POS (10.0f) #define CONSOLE_LINE_HEIGHT (12.0f) -CConsole &TheConsole = *(CConsole*)0x8F6498; +CConsole TheConsole; void CConsole::AddLine(char *s, uint8 r, uint8 g, uint8 b) diff --git a/src/render/Console.h b/src/render/Console.h index c454d75e..b4fa60c4 100644 --- a/src/render/Console.h +++ b/src/render/Console.h @@ -22,4 +22,4 @@ public: void Init() { m_nCurrentLine = 0; m_nLineCount = 0; } }; -extern CConsole &TheConsole; +extern CConsole TheConsole; diff --git a/src/render/Coronas.cpp b/src/render/Coronas.cpp index 68994b0b..d70f70d6 100644 --- a/src/render/Coronas.cpp +++ b/src/render/Coronas.cpp @@ -48,16 +48,16 @@ FlareDef HeadLightsFlareDef[] = { }; -RwTexture **gpCoronaTexture = (RwTexture**)0x5FAF44; //[9] +RwTexture *gpCoronaTexture[9] = { nil, nil, nil, nil, nil, nil, nil, nil, nil }; -float &CCoronas::LightsMult = *(float*)0x5FB088; // 1.0 -float &CCoronas::SunScreenX = *(float*)0x8F4358; -float &CCoronas::SunScreenY = *(float*)0x8F4354; -bool &CCoronas::bSmallMoon = *(bool*)0x95CD49; -bool &CCoronas::SunBlockedByClouds = *(bool*)0x95CD73; -int &CCoronas::bChangeBrightnessImmediately = *(int*)0x8E2C30; +float CCoronas::LightsMult = 1.0f; +float CCoronas::SunScreenX; +float CCoronas::SunScreenY; +bool CCoronas::bSmallMoon; +bool CCoronas::SunBlockedByClouds; +int CCoronas::bChangeBrightnessImmediately; -CRegisteredCorona *CCoronas::aCoronas = (CRegisteredCorona*)0x72E518; +CRegisteredCorona CCoronas::aCoronas[NUMCORONAS]; const char aCoronaSpriteNames[][32] = { "coronastar", diff --git a/src/render/Coronas.h b/src/render/Coronas.h index 359a34ed..4b49e40e 100644 --- a/src/render/Coronas.h +++ b/src/render/Coronas.h @@ -1,6 +1,6 @@ #pragma once -extern RwTexture **gpCoronaTexture; //[9] +extern RwTexture *gpCoronaTexture[9]; struct CRegisteredCorona { @@ -42,7 +42,7 @@ static_assert(sizeof(CRegisteredCorona) == 0x80, "CRegisteredCorona: error"); class CCoronas { - static CRegisteredCorona *aCoronas; //[NUMCORONAS]; + static CRegisteredCorona aCoronas[NUMCORONAS]; public: enum { SUN_CORE = 1, @@ -77,12 +77,12 @@ public: STREAK_ON, }; - static float &LightsMult; - static float &SunScreenY; - static float &SunScreenX; - static bool &bSmallMoon; - static bool &SunBlockedByClouds; - static int &bChangeBrightnessImmediately; + static float LightsMult; + static float SunScreenY; + static float SunScreenX; + static bool bSmallMoon; + static bool SunBlockedByClouds; + static int bChangeBrightnessImmediately; static void Init(void); static void Shutdown(void); diff --git a/src/render/Sprite2d.cpp b/src/render/Sprite2d.cpp index 1fe70121..655fd841 100644 --- a/src/render/Sprite2d.cpp +++ b/src/render/Sprite2d.cpp @@ -5,7 +5,7 @@ #include "Camera.h" #include "Sprite2d.h" -RwIm2DVertex CSprite2d::maVertices[4]; +RwIm2DVertex CSprite2d::maVertices[8]; float CSprite2d::RecipNearClip; int32 CSprite2d::mCurrentBank; RwTexture *CSprite2d::mpBankTextures[10]; diff --git a/src/render/Sprite2d.h b/src/render/Sprite2d.h index 0b073557..0e12d441 100644 --- a/src/render/Sprite2d.h +++ b/src/render/Sprite2d.h @@ -8,7 +8,7 @@ class CSprite2d static int32 mCurrentSprite[10]; static int32 mBankStart[10]; static RwIm2DVertex maBankVertices[500]; - static RwIm2DVertex maVertices[4]; + static RwIm2DVertex maVertices[8]; public: RwTexture *m_pTexture; diff --git a/src/rw/Lights.cpp b/src/rw/Lights.cpp index 9218a055..112c8982 100644 --- a/src/rw/Lights.cpp +++ b/src/rw/Lights.cpp @@ -108,7 +108,7 @@ LightsCreate(RpWorld *world) pDirect = RpLightCreate(rpLIGHTDIRECTIONAL); RpLightSetFlags(pDirect, rpLIGHTLIGHTATOMICS); color.red = 1.0f; - color.green = 0.84f; + color.green = 0.85f; color.blue = 0.45f; RpLightSetColor(pDirect, &color); RpLightSetRadius(pDirect, 2.0f); |