diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-02-16 23:08:54 +0300 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-02-16 23:08:54 +0300 |
commit | 1337a9b6034570861a7cadaf5338d0cbb5b06255 (patch) | |
tree | dc65656c184c0060f053d0f0ea45a8125628e9cd /src/core | |
parent | a36da99798b99ca1d15ccdde00ef86af412d2a16 (diff) |
script 1000-1154
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/Camera.cpp | 8 | ||||
-rw-r--r-- | src/core/Camera.h | 2 | ||||
-rw-r--r-- | src/core/CutsceneMgr.h | 1 | ||||
-rw-r--r-- | src/core/Stats.cpp | 93 | ||||
-rw-r--r-- | src/core/Stats.h | 32 | ||||
-rw-r--r-- | src/core/World.cpp | 1 | ||||
-rw-r--r-- | src/core/World.h | 1 | ||||
-rw-r--r-- | src/core/config.h | 2 |
8 files changed, 138 insertions, 2 deletions
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index 64a52bdc..88c87c95 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -30,6 +30,7 @@ WRAPPER void CCamera::Process(void) { EAXJMP(0x46D3F0); } WRAPPER void CCamera::LoadPathSplines(int file) { EAXJMP(0x46D1D0); } WRAPPER void CCamera::RestoreWithJumpCut(void) { EAXJMP(0x46FAE0); }; WRAPPER void CCamera::SetPercentAlongCutScene(float) { EAXJMP(0x46FE20); }; +WRAPPER void CCamera::SetParametersForScriptInterpolation(float, float, int32) { EAXJMP(0x46FDE0); } bool CCamera::GetFading() @@ -155,6 +156,13 @@ CCamera::SetMotionBlurAlpha(int a) } void +CCamera::SetNearClipScript(float clip) +{ + m_fNearClipScript = clip; + m_bUseNearClipScript = true; +} + +void CCamera::RenderMotionBlur(void) { if(m_BlurType == 0) diff --git a/src/core/Camera.h b/src/core/Camera.h index 6b631ee2..980af5c1 100644 --- a/src/core/Camera.h +++ b/src/core/Camera.h @@ -485,6 +485,7 @@ int m_iModeObbeCamIsInForCar; void Restore(void); void SetWideScreenOn(void); void SetWideScreenOff(void); + void SetNearClipScript(float); float Find3rdPersonQuickAimPitch(void); @@ -512,6 +513,7 @@ int m_iModeObbeCamIsInForCar; void UpdateAimingCoors(CVector const &); void SetPercentAlongCutScene(float); + void SetParametersForScriptInterpolation(float, float, int32); void dtor(void) { this->CCamera::~CCamera(); } }; diff --git a/src/core/CutsceneMgr.h b/src/core/CutsceneMgr.h index e95a2a04..381c71c9 100644 --- a/src/core/CutsceneMgr.h +++ b/src/core/CutsceneMgr.h @@ -26,6 +26,7 @@ public: static CDirectory *&ms_pCutsceneDir; static uint32 &ms_cutsceneLoadStatus; + static void SetRunning(bool running) { ms_running = running; } static bool IsRunning(void) { return ms_running; } static bool IsCutsceneProcessing(void) { return ms_cutsceneProcessing; } static CCutsceneObject* GetCutsceneObject(int id) { return ms_pCutsceneObjects[id]; } diff --git a/src/core/Stats.cpp b/src/core/Stats.cpp index cd5bee06..2c27ba70 100644 --- a/src/core/Stats.cpp +++ b/src/core/Stats.cpp @@ -33,13 +33,102 @@ int32 &CStats::MissionsPassed = *(int32*)0x940768; char(&CStats::LastMissionPassedName)[8] = *(char(*)[8])*(uintptr*)0x70D828; int32 &CStats::TotalLegitimateKills = *(int32*)0x8F6004; int32 &CStats::ElBurroTime = *(int32*)0x8E2A6C; +int32& CStats::Record4x4One = *(int32*)0x940570; +int32& CStats::Record4x4Two = *(int32*)0x94058C; +int32& CStats::Record4x4Three = *(int32*)0x880FA8; +int32& CStats::Record4x4Mayhem = *(int32*)0x885B70; +int32& CStats::LivesSavedWithAmbulance = *(int32*)0x8F57E0; +int32& CStats::CriminalsCaught = *(int32*)0x8F2518; +int32& CStats::HighestLevelAmbulanceMission = *(int32*)0x8F2A04; +int32& CStats::FiresExtinguished = *(int32*)0x8F5FEC; +int32& CStats::LongestFlightInDodo = *(int32*)0x8F5FE4; +int32& CStats::TimeTakenDefuseMission = *(int32*)0x880E24; +int32& CStats::TotalNumberKillFrenzies = *(int32*)0x8E2884; +int32& CStats::TotalNumberMissions = *(int32*)0x8E2820; +int32(&CStats::FastestTimes)[CStats::TOTAL_FASTEST_TIMES] = *(int32(*)[CStats::TOTAL_FASTEST_TIMES])*(uintptr*)0x6E9128; +int32(&CStats::HighestScores)[CStats::TOTAL_HIGHEST_SCORES] = *(int32(*)[CStats::TOTAL_HIGHEST_SCORES]) * (uintptr*)0x8622B0; -void CStats::AnotherKillFrenzyPassed() +void CStats::RegisterFastestTime(int32 index, int32 time) { - ++NumberKillFrenziesPassed; + assert(index >= 0 && index < TOTAL_FASTEST_TIMES); + if (FastestTimes[index] == 0) + FastestTimes[index] = time; + else + FastestTimes[index] = min(FastestTimes[index], time); +} + +void CStats::RegisterHighestScore(int32 index, int32 score) +{ + assert(index >= 0 && index < TOTAL_HIGHEST_SCORES); + HighestScores[index] = max(HighestScores[index], score); } void CStats::RegisterElBurroTime(int32 time) { ElBurroTime = (ElBurroTime && ElBurroTime < time) ? ElBurroTime : time; } + +void CStats::Register4x4OneTime(int32 time) +{ + Record4x4One = (Record4x4One && Record4x4One < time) ? Record4x4One : time; +} + +void CStats::Register4x4TwoTime(int32 time) +{ + Record4x4Two = (Record4x4Two && Record4x4Two < time) ? Record4x4Two : time; +} + +void CStats::Register4x4ThreeTime(int32 time) +{ + Record4x4Three = (Record4x4Three && Record4x4Three < time) ? Record4x4Three : time; +} + +void CStats::Register4x4MayhemTime(int32 time) +{ + Record4x4Mayhem = (Record4x4Mayhem && Record4x4Mayhem < time) ? Record4x4Mayhem : time; +} + +void CStats::AnotherLifeSavedWithAmbulance() +{ + ++LivesSavedWithAmbulance; +} + +void CStats::AnotherCriminalCaught() +{ + ++CriminalsCaught; +} + +void CStats::RegisterLevelAmbulanceMission(int32 level) +{ + HighestLevelAmbulanceMission = max(HighestLevelAmbulanceMission, level); +} + +void CStats::AnotherFireExtinguished() +{ + ++FiresExtinguished; +} + +void CStats::RegisterLongestFlightInDodo(int32 time) +{ + LongestFlightInDodo = max(LongestFlightInDodo, time); +} + +void CStats::RegisterTimeTakenDefuseMission(int32 time) +{ + TimeTakenDefuseMission = (TimeTakenDefuseMission && TimeTakenDefuseMission < time) ? TimeTakenDefuseMission : time; +} + +void CStats::AnotherKillFrenzyPassed() +{ + ++NumberKillFrenziesPassed; +} + +void CStats::SetTotalNumberKillFrenzies(int32 total) +{ + TotalNumberKillFrenzies = total; +} + +void CStats::SetTotalNumberMissions(int32 total) +{ + TotalNumberMissions = total; +} diff --git a/src/core/Stats.h b/src/core/Stats.h index e1ef3749..4b558c32 100644 --- a/src/core/Stats.h +++ b/src/core/Stats.h @@ -3,6 +3,10 @@ class CStats { public: + enum { + TOTAL_FASTEST_TIMES = 16, + TOTAL_HIGHEST_SCORES = 16 + }; static int32 &DaysPassed; static int32 &HeadsPopped; static bool& CommercialPassed; @@ -35,9 +39,37 @@ public: static char (&LastMissionPassedName)[8]; static int32 &TotalLegitimateKills; static int32 &ElBurroTime; + static int32 &Record4x4One; + static int32 &Record4x4Two; + static int32 &Record4x4Three; + static int32 &Record4x4Mayhem; + static int32 &LivesSavedWithAmbulance; + static int32 &CriminalsCaught; + static int32 &HighestLevelAmbulanceMission; + static int32 &FiresExtinguished; + static int32 &LongestFlightInDodo; + static int32 &TimeTakenDefuseMission; + static int32 &TotalNumberKillFrenzies; + static int32 &TotalNumberMissions; + static int32(&FastestTimes)[TOTAL_FASTEST_TIMES]; + static int32(&HighestScores)[TOTAL_HIGHEST_SCORES]; public: + static void RegisterFastestTime(int32, int32); + static void RegisterHighestScore(int32, int32); static void AnotherKillFrenzyPassed(); + static void AnotherLifeSavedWithAmbulance(); + static void AnotherCriminalCaught(); + static void RegisterLevelAmbulanceMission(int32); + static void AnotherFireExtinguished(); + static void Register4x4OneTime(int32); + static void Register4x4TwoTime(int32); + static void Register4x4ThreeTime(int32); + static void Register4x4MayhemTime(int32); + static void RegisterLongestFlightInDodo(int32); + static void RegisterTimeTakenDefuseMission(int32); + static void SetTotalNumberKillFrenzies(int32); + static void SetTotalNumberMissions(int32); static void CheckPointReachedUnsuccessfully() { KillsSinceLastCheckpoint = 0; }; static void CheckPointReachedSuccessfully() { TotalLegitimateKills += KillsSinceLastCheckpoint; KillsSinceLastCheckpoint = 0; }; static void RegisterElBurroTime(int32); diff --git a/src/core/World.cpp b/src/core/World.cpp index 70e526e8..c6236f42 100644 --- a/src/core/World.cpp +++ b/src/core/World.cpp @@ -50,6 +50,7 @@ WRAPPER void CWorld::FindObjectsOfTypeInRange(uint32, CVector&, float, bool, sho WRAPPER void CWorld::FindObjectsOfTypeInRangeSectorList(uint32, CPtrList&, CVector&, float, bool, short*, short, CEntity**) { EAXJMP(0x4B2960); } WRAPPER void CWorld::FindMissionEntitiesIntersectingCube(const CVector&, const CVector&, int16*, int16, CEntity**, bool, bool, bool) { EAXJMP(0x4B3680); } WRAPPER void CWorld::ClearCarsFromArea(float, float, float, float, float, float) { EAXJMP(0x4B50E0); } +WRAPPER void CWorld::ClearPedsFromArea(float, float, float, float, float, float) { EAXJMP(0x4B52B0); } void CWorld::Initialise() diff --git a/src/core/World.h b/src/core/World.h index 68af156c..12582d49 100644 --- a/src/core/World.h +++ b/src/core/World.h @@ -116,6 +116,7 @@ public: static void FindObjectsIntersectingAngledCollisionBox(const CColBox &, const CMatrix &, const CVector &, float, float, float, float, int16*, int16, CEntity **, bool, bool, bool, bool, bool); static void FindMissionEntitiesIntersectingCube(const CVector&, const CVector&, int16*, int16, CEntity**, bool, bool, bool); static void ClearCarsFromArea(float, float, float, float, float, float); + static void ClearPedsFromArea(float, float, float, float, float, float); 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); } diff --git a/src/core/config.h b/src/core/config.h index de96ad1b..770b51e6 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -163,6 +163,8 @@ enum Config { // Script #define USE_DEBUG_SCRIPT_LOADER // makes game load main_freeroam.scm by default +#define USE_MEASUREMENTS_IN_METERS // makes game use meters instead of feet in script +#define USE_PRECISE_MEASUREMENT_CONVERTION // makes game convert feet to meeters more precisely // Vehicles #define EXPLODING_AIRTRAIN // can blow up jumbo jet with rocket launcher |