From eda50bc32bafaea788def2f00f4ac036329dd46c Mon Sep 17 00:00:00 2001 From: erorcun Date: Wed, 1 Jul 2020 15:28:43 +0300 Subject: Restored beta police system(disabled), fixes from miami, debug info for CFO crash (#639) --- src/core/Cam.cpp | 2 +- src/core/Frontend.cpp | 12 +++++++++--- src/core/Wanted.cpp | 36 +++++++++++++++++++++++++++++++++++- src/core/config.h | 4 ++-- src/core/re3.cpp | 4 ---- 5 files changed, 47 insertions(+), 11 deletions(-) (limited to 'src/core') diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp index d038c423..3e5a82a9 100644 --- a/src/core/Cam.cpp +++ b/src/core/Cam.cpp @@ -1688,7 +1688,7 @@ CCam::Process_BehindCar(const CVector &CameraTarget, float TargetOrientation, fl if(Length < 0.002f) Length = 0.002f; Beta = CGeneral::GetATanOfXY(TargetCoors.x - Source.x, TargetCoors.y - Source.y); -#ifdef TOGGLEABLE_BETA_FEATURES +#if 1 // This is completely made up but Bill's cam manipulates an angle before calling this // and otherwise calculating Beta doesn't make much sense. Beta += fBillsBetaOffset; diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index 3aefa005..3400d10f 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -1217,8 +1217,10 @@ CMenuManager::Draw() rightText = option.drawFunc(&isOptionDisabled); } } - } else + } else { + debug("screen:%d - totalCo: %d, coId: %d, coScreen:%d, coOption:%d\n", m_nCurrScreen, numCustomFrontendOptions, aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu, option.screen, option.screenOptionOrder); assert(0 && "Custom frontend options is borked"); + } break; #endif @@ -4775,8 +4777,10 @@ CMenuManager::ProcessButtonPresses(void) } else if (option.type == FEOPTION_GOBACK) { goBack = true; } - } else + } else { + debug("screen:%d - totalCo: %d, coId: %d, coScreen:%d, coOption:%d\n", m_nCurrScreen, numCustomFrontendOptions, aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, option.screen, option.screenOptionOrder); assert(0 && "Custom frontend options are borked"); + } break; #endif @@ -4998,8 +5002,10 @@ CMenuManager::ProcessButtonPresses(void) } DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0); } - else + else { + debug("screen:%d - totalCo: %d, coId: %d, coScreen:%d, coOption:%d\n", m_nCurrScreen, numCustomFrontendOptions, aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, option.screen, option.screenOptionOrder); assert(0 && "Custom frontend options are borked"); + } break; #endif diff --git a/src/core/Wanted.cpp b/src/core/Wanted.cpp index 7508c9f4..909674d0 100644 --- a/src/core/Wanted.cpp +++ b/src/core/Wanted.cpp @@ -161,7 +161,11 @@ CWanted::RegisterCrime(eCrimeType type, const CVector &coors, uint32 id, bool po void CWanted::RegisterCrime_Immediately(eCrimeType type, const CVector &coors, uint32 id, bool policeDoesntCare) { - if(!AddCrimeToQ(type, id, coors, false, policeDoesntCare)) +#if defined FIX_SIGNIFICANT_BUGS || defined PEDS_REPORT_CRIMES_ON_PHONE + if (!AddCrimeToQ(type, id, coors, true, policeDoesntCare)) +#else + if (!AddCrimeToQ(type, id, coors, false, policeDoesntCare)) +#endif ReportCrimeNow(type, coors, policeDoesntCare); } @@ -219,6 +223,9 @@ CWanted::ReportCrimeNow(eCrimeType type, const CVector &coors, bool policeDoesnt chaos *= 0.333f; switch(type){ case CRIME_POSSESSION_GUN: +#ifdef PEDS_REPORT_CRIMES_ON_PHONE + m_nChaos += 5.0f*chaos; +#endif break; case CRIME_HIT_PED: m_nChaos += 5.0f*chaos; @@ -440,6 +447,30 @@ CWanted::Reset(void) Initialise(); } +#ifdef PEDS_REPORT_CRIMES_ON_PHONE +bool +CrimeShouldBeReportedOnPhone(eCrimeType crime) +{ + switch (crime) { + case CRIME_POSSESSION_GUN: + case CRIME_HIT_PED: + case CRIME_HIT_COP: + case CRIME_SHOOT_PED: + case CRIME_SHOOT_COP: + case CRIME_STEAL_CAR: + case CRIME_RECKLESS_DRIVING: + case CRIME_RUNOVER_PED: + case CRIME_RUNOVER_COP: + case CRIME_PED_BURNED: + case CRIME_COP_BURNED: + case CRIME_VEHICLE_BURNED: + return true; + default: + return false; + } +} +#endif + void CWanted::UpdateCrimesQ(void) { @@ -447,6 +478,9 @@ CWanted::UpdateCrimesQ(void) CCrimeBeingQd &crime = m_aCrimes[i]; if (crime.m_nType != CRIME_NONE) { +#ifdef PEDS_REPORT_CRIMES_ON_PHONE + if (!CrimeShouldBeReportedOnPhone(crime.m_nType)) +#endif if (CTimer::GetTimeInMilliseconds() > crime.m_nTime + 500 && !crime.m_bReported) { ReportCrimeNow(crime.m_nType, crime.m_vecPosn, crime.m_bPoliceDoesntCare); crime.m_bReported = true; diff --git a/src/core/config.h b/src/core/config.h index ed36a493..839fbc34 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -190,7 +190,6 @@ enum Config { #endif #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 COMPATIBLE_SAVES // this allows changing structs while keeping saves compatible @@ -242,7 +241,7 @@ enum Config { # define MISSION_REPLAY // mobile feature #endif //#define SIMPLIER_MISSIONS // apply simplifications from mobile -#define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT +//#define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT #define SCRIPT_LOG_FILE_LEVEL 1 // 0 == no log, 1 == overwrite every frame, 2 == full log #ifndef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT @@ -267,6 +266,7 @@ enum Config { #define VC_PED_PORTS // various ports from VC's CPed, mostly subtle // #define NEW_WALK_AROUND_ALGORITHM // to make walking around vehicles/objects less awkward #define CANCELLABLE_CAR_ENTER +//#define PEDS_REPORT_CRIMES_ON_PHONE // Camera //#define PS2_CAM_TRANSITION // old way of transitioning between cam modes diff --git a/src/core/re3.cpp b/src/core/re3.cpp index b21bff58..a2edcdee 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -484,11 +484,7 @@ DebugMenuPopulate(void) #ifdef CUSTOM_FRONTEND_OPTIONS DebugMenuAddCmd("Debug", "Reload custom frontend options", ReloadFrontendOptions); #endif -#ifdef TOGGLEABLE_BETA_FEATURES DebugMenuAddVarBool8("Debug", "Toggle popping heads on headshot", &CPed::bPopHeadsOnHeadshot, nil); - DebugMenuAddVarBool8("Debug", "Toggle peds running to phones to report crimes", &CPed::bMakePedsRunToPhonesToReportCrimes, nil); -#endif - DebugMenuAddCmd("Debug", "Start Credits", CCredits::Start); DebugMenuAddCmd("Debug", "Stop Credits", CCredits::Stop); -- cgit v1.2.3 From c4cd210ae0a39fbfbc3f12b0379c210c40ea4750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Thu, 2 Jul 2020 16:01:42 +0300 Subject: Disable VC_PED_PORTS, better cancellable car enter, weapon and cops fixes --- src/core/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/config.h b/src/core/config.h index 839fbc34..b0aeaf4a 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -263,7 +263,7 @@ enum Config { // Peds #define PED_SKIN // support for skinned geometry on peds #define ANIMATE_PED_COL_MODEL -#define VC_PED_PORTS // various ports from VC's CPed, mostly subtle +// #define VC_PED_PORTS // various ports from VC's CPed, mostly subtle // #define NEW_WALK_AROUND_ALGORITHM // to make walking around vehicles/objects less awkward #define CANCELLABLE_CAR_ENTER //#define PEDS_REPORT_CRIMES_ON_PHONE -- cgit v1.2.3 From bf2624692c6b04c25275ddb35b7da1cf1e6a9953 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Fri, 3 Jul 2020 00:04:49 +0200 Subject: Fix displaying stats --- src/core/Stats.cpp | 4 ++-- src/core/Stats.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core') diff --git a/src/core/Stats.cpp b/src/core/Stats.cpp index 99274e04..9afd8ac3 100644 --- a/src/core/Stats.cpp +++ b/src/core/Stats.cpp @@ -16,8 +16,8 @@ int32 CStats::PedsKilledOfThisType[NUM_PEDTYPES]; int32 CStats::TimesDied; int32 CStats::TimesArrested; int32 CStats::KillsSinceLastCheckpoint; -int32 CStats::DistanceTravelledInVehicle; -int32 CStats::DistanceTravelledOnFoot; +float CStats::DistanceTravelledInVehicle; +float CStats::DistanceTravelledOnFoot; int32 CStats::ProgressMade; int32 CStats::TotalProgressInGame; int32 CStats::CarsExploded; diff --git a/src/core/Stats.h b/src/core/Stats.h index ae3c0cb4..5dfcf803 100644 --- a/src/core/Stats.h +++ b/src/core/Stats.h @@ -21,8 +21,8 @@ public: static int32 TimesDied; static int32 TimesArrested; static int32 KillsSinceLastCheckpoint; - static int32 DistanceTravelledInVehicle; - static int32 DistanceTravelledOnFoot; + static float DistanceTravelledInVehicle; + static float DistanceTravelledOnFoot; static int32 CarsExploded; static int32 PeopleKilledByPlayer; static int32 ProgressMade; -- cgit v1.2.3 From 01b15fe8071a4c18404c76b9063946548c480a11 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Fri, 3 Jul 2020 01:28:41 +0300 Subject: reenabled script logging --- src/core/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/config.h b/src/core/config.h index b0aeaf4a..9d9577ff 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -241,7 +241,7 @@ enum Config { # define MISSION_REPLAY // mobile feature #endif //#define SIMPLIER_MISSIONS // apply simplifications from mobile -//#define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT +#define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT #define SCRIPT_LOG_FILE_LEVEL 1 // 0 == no log, 1 == overwrite every frame, 2 == full log #ifndef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT -- cgit v1.2.3 From ed036df3ce0253fe639a441c22a58ecc0f9a116a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Fri, 3 Jul 2020 05:40:22 +0300 Subject: Re-enable console for debugging frontend --- src/core/Frontend.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core') diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index 3400d10f..bd03500e 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -1218,7 +1218,7 @@ CMenuManager::Draw() } } } else { - debug("screen:%d - totalCo: %d, coId: %d, coScreen:%d, coOption:%d\n", m_nCurrScreen, numCustomFrontendOptions, aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu, option.screen, option.screenOptionOrder); + debug("A- screen:%d option:%d - totalCo: %d, coId: %d, coScreen:%d, coOption:%d\n", m_nCurrScreen, i, numCustomFrontendOptions, aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu, option.screen, option.screenOptionOrder); assert(0 && "Custom frontend options is borked"); } @@ -4778,7 +4778,7 @@ CMenuManager::ProcessButtonPresses(void) goBack = true; } } else { - debug("screen:%d - totalCo: %d, coId: %d, coScreen:%d, coOption:%d\n", m_nCurrScreen, numCustomFrontendOptions, aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, option.screen, option.screenOptionOrder); + debug("B- screen:%d option:%d - totalCo: %d, coId: %d, coScreen:%d, coOption:%d\n", m_nCurrScreen, m_nCurrOption, numCustomFrontendOptions, aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, option.screen, option.screenOptionOrder); assert(0 && "Custom frontend options are borked"); } @@ -5003,7 +5003,7 @@ CMenuManager::ProcessButtonPresses(void) DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0); } else { - debug("screen:%d - totalCo: %d, coId: %d, coScreen:%d, coOption:%d\n", m_nCurrScreen, numCustomFrontendOptions, aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, option.screen, option.screenOptionOrder); + debug("C- screen:%d option:%d - totalCo: %d, coId: %d, coScreen:%d, coOption:%d\n", m_nCurrScreen, m_nCurrOption, numCustomFrontendOptions, aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, option.screen, option.screenOptionOrder); assert(0 && "Custom frontend options are borked"); } -- cgit v1.2.3 From 15548758ac825e61648fd6adc2fba96256875fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Fri, 3 Jul 2020 16:51:33 +0300 Subject: Bettah car enter canceling, fix CFO crash, ped objs. renaming --- src/core/Cam.cpp | 2 +- src/core/Frontend.cpp | 1 - src/core/PlayerInfo.cpp | 2 +- src/core/re3.cpp | 3 ++- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core') diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp index 3e5a82a9..fcffce9b 100644 --- a/src/core/Cam.cpp +++ b/src/core/Cam.cpp @@ -5060,7 +5060,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation, // This is not working on cars as SA // Because III/VC doesn't have any buttons tied to LeftStick if you're not in Classic Configuration, using Dodo or using GInput/Pad, so :shrug: if (Abs(pad->GetSteeringUpDown()) > 120.0f) { - if (car->pDriver && car->pDriver->m_objective != OBJECTIVE_LEAVE_VEHICLE) { + if (car->pDriver && car->pDriver->m_objective != OBJECTIVE_LEAVE_CAR) { yMovement += Abs(pad->GetSteeringUpDown()) * (FOV / 80.0f * 3.f / 70.f) * pad->GetSteeringUpDown() * 0.007f * 0.007f * 0.5; } } diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index bd03500e..841f6bbb 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -3068,7 +3068,6 @@ CMenuManager::InitialiseChangedLanguageSettings() } #ifdef CUSTOM_FRONTEND_OPTIONS - RemoveCustomFrontendOptions(); CustomFrontendOptionsPopulate(); #endif } diff --git a/src/core/PlayerInfo.cpp b/src/core/PlayerInfo.cpp index 128b22b4..69c1fe49 100644 --- a/src/core/PlayerInfo.cpp +++ b/src/core/PlayerInfo.cpp @@ -409,7 +409,7 @@ CPlayerInfo::Process(void) if (veh->m_vehType != VEHICLE_TYPE_BIKE || veh->m_nDoorLock == CARLOCK_LOCKED_PLAYER_INSIDE) { if (veh->GetStatus() != STATUS_WRECKED && veh->GetStatus() != STATUS_TRAIN_MOVING && veh->m_nDoorLock != CARLOCK_LOCKED_PLAYER_INSIDE) { if (veh->m_vecMoveSpeed.Magnitude() < 0.17f && CTimer::GetTimeScale() >= 0.5f && !veh->bIsInWater) { - m_pPed->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh); + m_pPed->SetObjective(OBJECTIVE_LEAVE_CAR, veh); } } } else { diff --git a/src/core/re3.cpp b/src/core/re3.cpp index a2edcdee..7aa6800e 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -75,7 +75,6 @@ mysrand(unsigned int seed) void ReloadFrontendOptions(void) { - RemoveCustomFrontendOptions(); CustomFrontendOptionsPopulate(); } @@ -137,6 +136,8 @@ void ToggleFreeCam(int8 action) void CustomFrontendOptionsPopulate(void) { + RemoveCustomFrontendOptions(); // if exist + #ifdef MORE_LANGUAGES FrontendOptionSetPosition(MENUPAGE_LANGUAGE_SETTINGS); FrontendOptionAddDynamic(TheText.Get("FEL_POL"), nil, LangPolSelect, nil); -- cgit v1.2.3 From cf69f22a0ce5b808a4d945a5cef1d9d4c51c0b5c Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Thu, 9 Jul 2020 19:18:42 +0300 Subject: Remove island loading --- src/core/Collision.cpp | 29 +++++++++++++++++++++++++++-- src/core/Streaming.cpp | 14 +++++++++++++- src/core/config.h | 1 + 3 files changed, 41 insertions(+), 3 deletions(-) (limited to 'src/core') diff --git a/src/core/Collision.cpp b/src/core/Collision.cpp index 23eaa8dd..cb8b4189 100644 --- a/src/core/Collision.cpp +++ b/src/core/Collision.cpp @@ -180,12 +180,16 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange) if(level == CGame::currLevel || forceChange){ CTimer::Stop(); +#ifndef NO_ISLAND_LOADING DMAudio.SetEffectsFadeVol(0); CPad::StopPadsShaking(); LoadCollisionScreen(CGame::currLevel); DMAudio.Service(); +#endif CPopulation::DealWithZoneChange(ms_collisionInMemory, CGame::currLevel, false); + +#ifndef NO_ISLAND_LOADING CStreaming::RemoveIslandsNotUsed(LEVEL_INDUSTRIAL); CStreaming::RemoveIslandsNotUsed(LEVEL_COMMERCIAL); CStreaming::RemoveIslandsNotUsed(LEVEL_SUBURBAN); @@ -196,19 +200,27 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange) CStreaming::RemoveUnusedModelsInLoadedList(); CGame::TidyUpMemory(true, true); CFileLoader::LoadCollisionFromDatFile(CGame::currLevel); +#endif + ms_collisionInMemory = CGame::currLevel; CReplay::EmptyReplayBuffer(); +#ifndef NO_ISLAND_LOADING if(CGame::currLevel != LEVEL_NONE) LoadSplash(GetLevelSplashScreen(CGame::currLevel)); CStreaming::RemoveUnusedBigBuildings(CGame::currLevel); CStreaming::RemoveUnusedBuildings(CGame::currLevel); CStreaming::RequestBigBuildings(CGame::currLevel); +#endif CStreaming::LoadAllRequestedModels(true); +#ifndef NO_ISLAND_LOADING CStreaming::HaveAllBigBuildingsLoaded(CGame::currLevel); CGame::TidyUpMemory(true, true); +#endif CTimer::Update(); +#ifndef NO_ISLAND_LOADING DMAudio.SetEffectsFadeVol(127); +#endif } } @@ -217,10 +229,23 @@ CCollision::SortOutCollisionAfterLoad(void) { if(ms_collisionInMemory == CGame::currLevel) return; - +#ifndef NO_ISLAND_LOADING CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel); - if(CGame::currLevel != LEVEL_NONE){ +#endif + if (CGame::currLevel != LEVEL_NONE) { +#ifdef NO_ISLAND_LOADING + static bool bAlreadyLoaded = false; + if (bAlreadyLoaded) { + ms_collisionInMemory = CGame::currLevel; + return; + } + bAlreadyLoaded = true; + CFileLoader::LoadCollisionFromDatFile(LEVEL_INDUSTRIAL); + CFileLoader::LoadCollisionFromDatFile(LEVEL_COMMERCIAL); + CFileLoader::LoadCollisionFromDatFile(LEVEL_SUBURBAN); +#else CFileLoader::LoadCollisionFromDatFile(CGame::currLevel); +#endif if(!CGame::playingIntro) LoadSplash(GetLevelSplashScreen(CGame::currLevel)); } diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp index c961f53d..b701f43f 100644 --- a/src/core/Streaming.cpp +++ b/src/core/Streaming.cpp @@ -725,7 +725,11 @@ CStreaming::RequestBigBuildings(eLevelName level) n = CPools::GetBuildingPool()->GetSize()-1; for(i = n; i >= 0; i--){ b = CPools::GetBuildingPool()->GetSlot(i); - if(b && b->bIsBIGBuilding && b->m_level == level) + if(b && b->bIsBIGBuilding +#ifndef NO_ISLAND_LOADING + && b->m_level == level +#endif + ) RequestModel(b->GetModelIndex(), BIGBUILDINGFLAGS); } RequestIslands(level); @@ -735,6 +739,7 @@ CStreaming::RequestBigBuildings(eLevelName level) void CStreaming::RequestIslands(eLevelName level) { +#ifndef NO_ISLAND_LOADING switch(level){ case LEVEL_INDUSTRIAL: RequestModel(islandLODcomInd, BIGBUILDINGFLAGS); @@ -750,6 +755,7 @@ CStreaming::RequestIslands(eLevelName level) break; default: break; } +#endif } void @@ -935,12 +941,14 @@ CStreaming::RemoveBuildings(eLevelName level) void CStreaming::RemoveUnusedBigBuildings(eLevelName level) { +#ifndef NO_ISLAND_LOADING if(level != LEVEL_INDUSTRIAL) RemoveBigBuildings(LEVEL_INDUSTRIAL); if(level != LEVEL_COMMERCIAL) RemoveBigBuildings(LEVEL_COMMERCIAL); if(level != LEVEL_SUBURBAN) RemoveBigBuildings(LEVEL_SUBURBAN); +#endif RemoveIslandsNotUsed(level); } @@ -960,6 +968,7 @@ DeleteIsland(CEntity *island) void CStreaming::RemoveIslandsNotUsed(eLevelName level) { +#ifndef NO_ISLAND_LOADING switch(level){ case LEVEL_INDUSTRIAL: DeleteIsland(pIslandLODindustEntity); @@ -977,13 +986,16 @@ CStreaming::RemoveIslandsNotUsed(eLevelName level) DeleteIsland(pIslandLODcomIndEntity); break; default: +#endif // !NO_ISLAND_LOADING DeleteIsland(pIslandLODindustEntity); DeleteIsland(pIslandLODcomIndEntity); DeleteIsland(pIslandLODcomSubEntity); DeleteIsland(pIslandLODsubIndEntity); DeleteIsland(pIslandLODsubComEntity); +#ifndef NO_ISLAND_LOADING break; } +#endif // !NO_ISLAND_LOADING } void diff --git a/src/core/config.h b/src/core/config.h index 9d9577ff..5010ed3d 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -198,6 +198,7 @@ enum Config { #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 NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU //#define USE_TEXTURE_POOL // Particle -- cgit v1.2.3 From c012e5a7ffa4a1d2d4a0d67a7aeacf973d9f8db4 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Thu, 9 Jul 2020 20:40:15 +0300 Subject: Disable loading screen --- src/core/config.h | 3 ++- src/core/main.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/config.h b/src/core/config.h index 5010ed3d..b43fc90b 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -198,7 +198,8 @@ enum Config { #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 NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU +#define DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time +#define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU //#define USE_TEXTURE_POOL // Particle diff --git a/src/core/main.cpp b/src/core/main.cpp index 1e26381a..2608612a 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -471,6 +471,7 @@ ResetLoadingScreenBar() void LoadingScreen(const char *str1, const char *str2, const char *splashscreen) { +#ifndef DISABLE_LOADING_SCREEN CSprite2d *splash; #ifndef RANDOMSPLASH @@ -534,6 +535,7 @@ LoadingScreen(const char *str1, const char *str2, const char *splashscreen) CFont::DrawFonts(); DoRWStuffEndOfFrame(); } +#endif } void -- cgit v1.2.3 From aabf0f4c2c5b7b4b5dd528653b7fd6c755ecbfbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Thu, 9 Jul 2020 21:48:43 +0300 Subject: keep loading screen, but for a second --- src/core/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/core') diff --git a/src/core/main.cpp b/src/core/main.cpp index 2608612a..f8a3bd0d 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -467,13 +467,16 @@ ResetLoadingScreenBar() NumberOfChunksLoaded = 0.0f; } -// TODO: compare with PS2 void LoadingScreen(const char *str1, const char *str2, const char *splashscreen) { -#ifndef DISABLE_LOADING_SCREEN CSprite2d *splash; +#ifdef DISABLE_LOADING_SCREEN + if (str1 && str2) + return; +#endif + #ifndef RANDOMSPLASH if(CGame::frenchGame || CGame::germanGame || !CGame::nastyGame) splashscreen = "mainsc2"; @@ -535,7 +538,6 @@ LoadingScreen(const char *str1, const char *str2, const char *splashscreen) CFont::DrawFonts(); DoRWStuffEndOfFrame(); } -#endif } void -- cgit v1.2.3 From 00bba630f6e070a94af498812bd555e2fd4d9ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Fri, 10 Jul 2020 12:28:00 +0300 Subject: enable island loading for now --- src/core/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/config.h b/src/core/config.h index b43fc90b..f2716783 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -199,7 +199,7 @@ enum Config { #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 DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time -#define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU +//#define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU //#define USE_TEXTURE_POOL // Particle -- cgit v1.2.3 From 6eb8f6ae5a87fe32c93388e67559da988f48fb7f Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Sat, 11 Jul 2020 12:03:56 +0300 Subject: Add cutscene borders switch to the menu --- src/core/Frontend.cpp | 10 ++++++++++ src/core/Frontend.h | 4 ++++ src/core/config.h | 1 + src/core/main.cpp | 12 ++++++++++-- src/core/re3.cpp | 14 ++++++++++++++ 5 files changed, 39 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index 841f6bbb..e67e939a 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -112,6 +112,10 @@ int8 CMenuManager::m_bFrontEnd_ReloadObrTxtGxt; int32 CMenuManager::m_PrefsMusicVolume = 102; int32 CMenuManager::m_PrefsSfxVolume = 102; +#ifdef CUTSCENE_BORDERS_SWITCH +bool CMenuManager::m_PrefsCutsceneBorders = true; +#endif + char CMenuManager::m_PrefsSkinFile[256] = DEFAULT_SKIN_NAME; int32 CMenuManager::m_KeyPressedCode = -1; @@ -3217,6 +3221,9 @@ CMenuManager::LoadSettings() CFileMgr::Read(fileHandle, (char*)&m_PrefsLanguage, 1); #ifdef FREE_CAM CFileMgr::Read(fileHandle, (char*)&TheCamera.bFreeCam, 1); +#endif +#ifdef CUTSCENE_BORDERS_SWITCH + CFileMgr::Read(fileHandle, (char *)&CMenuManager::m_PrefsCutsceneBorders, 1); #endif } } @@ -3310,6 +3317,9 @@ CMenuManager::SaveSettings() CFileMgr::Write(fileHandle, (char*)&m_PrefsLanguage, 1); #ifdef FREE_CAM CFileMgr::Write(fileHandle, (char*)&TheCamera.bFreeCam, 1); +#endif +#ifdef CUTSCENE_BORDERS_SWITCH + CFileMgr::Write(fileHandle, (char *)&CMenuManager::m_PrefsCutsceneBorders, 1); #endif } diff --git a/src/core/Frontend.h b/src/core/Frontend.h index b07f7260..758e29aa 100644 --- a/src/core/Frontend.h +++ b/src/core/Frontend.h @@ -582,6 +582,10 @@ public: static uint8 m_PrefsPlayerGreen; static uint8 m_PrefsPlayerBlue; +#ifdef CUTSCENE_BORDERS_SWITCH + static bool m_PrefsCutsceneBorders; +#endif + #ifndef MASTER static bool m_PrefsMarketing; static bool m_PrefsDisableTutorials; diff --git a/src/core/config.h b/src/core/config.h index f2716783..2ba7a021 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -201,6 +201,7 @@ enum Config { #define DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time //#define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU //#define USE_TEXTURE_POOL +#define CUTSCENE_BORDERS_SWITCH // Particle //#define PC_PARTICLE diff --git a/src/core/main.cpp b/src/core/main.cpp index f8a3bd0d..a1c64a6d 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -254,7 +254,11 @@ DoFade(void) fadeColor.a = alpha; } - if(TheCamera.m_WideScreenOn){ + if(TheCamera.m_WideScreenOn +#ifdef CUTSCENE_BORDERS_SWITCH + && CMenuManager::m_PrefsCutsceneBorders +#endif + ){ // what's this? float y = SCREEN_HEIGHT/2 * TheCamera.m_ScreenReductionPercentage/100.0f; rect.left = 0.0f; @@ -862,7 +866,11 @@ Render2dStuff(void) CReplay::Display(); CPickups::RenderPickUpText(); - if(TheCamera.m_WideScreenOn) + if(TheCamera.m_WideScreenOn +#ifdef CUTSCENE_BORDERS_SWITCH + && CMenuManager::m_PrefsCutsceneBorders +#endif + ) TheCamera.DrawBordersForWideScreen(); CPed *player = FindPlayerPed(); diff --git a/src/core/re3.cpp b/src/core/re3.cpp index 7aa6800e..d6319f3a 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -132,6 +132,14 @@ void ToggleFreeCam(int8 action) } #endif +#ifdef CUTSCENE_BORDERS_SWITCH +void BorderModeChange(int8 displayedValue) +{ + CMenuManager::m_PrefsCutsceneBorders = !!displayedValue; + FrontEndMenuManager.SaveSettings(); +} +#endif + // Reloaded on language change, so you can use hardcoded wchar* and TheText.Get with peace of mind void CustomFrontendOptionsPopulate(void) @@ -161,6 +169,12 @@ CustomFrontendOptionsPopulate(void) FrontendOptionSetPosition(MENUPAGE_CONTROLLER_PC, 1); FrontendOptionAddDynamic(text, nil, ToggleFreeCam, nil); #endif + +#ifdef CUTSCENE_BORDERS_SWITCH + static const wchar *off_on[] = { TheText.Get("FEM_OFF"), TheText.Get("FEM_ON") }; + FrontendOptionSetPosition(MENUPAGE_GRAPHICS_SETTINGS, 9); + FrontendOptionAddSelect((const wchar *)L"CUTSCENE BORDERS", off_on, 2, (int8 *)&CMenuManager::m_PrefsCutsceneBorders, false, BorderModeChange, nil); +#endif } #endif -- cgit v1.2.3 From 841fa5155c17b6edf4774deaa311a4e5935be4d6 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Mon, 13 Jul 2020 17:43:09 +0300 Subject: Rename LEVEL_NONE to LEVEL_GENERIC --- src/core/Collision.cpp | 32 ++++++++++++++++---------------- src/core/Game.cpp | 4 ++-- src/core/Game.h | 2 +- src/core/PlayerInfo.cpp | 2 +- src/core/TempColModels.cpp | 6 +++--- src/core/World.cpp | 2 +- src/core/Zones.cpp | 8 ++++---- 7 files changed, 28 insertions(+), 28 deletions(-) (limited to 'src/core') diff --git a/src/core/Collision.cpp b/src/core/Collision.cpp index cb8b4189..3244d0b9 100644 --- a/src/core/Collision.cpp +++ b/src/core/Collision.cpp @@ -38,7 +38,7 @@ void CCollision::Init(void) { ms_colModelCache.Init(NUMCOLCACHELINKS); - ms_collisionInMemory = LEVEL_NONE; + ms_collisionInMemory = LEVEL_GENERIC; } void @@ -59,7 +59,7 @@ CCollision::Update(void) return; // hardcode a level if there are no zones - if(level == LEVEL_NONE){ + if(level == LEVEL_GENERIC){ if(CGame::currLevel == LEVEL_INDUSTRIAL && playerCoors.x < 400.0f){ level = LEVEL_COMMERCIAL; @@ -78,7 +78,7 @@ CCollision::Update(void) } } } - if(level != LEVEL_NONE && level != CGame::currLevel) + if(level != LEVEL_GENERIC && level != CGame::currLevel) CGame::currLevel = level; if(ms_collisionInMemory != CGame::currLevel) LoadCollisionWhenINeedIt(forceLevelChange); @@ -95,10 +95,10 @@ GetCollisionInSectorList(CPtrList &list) for(node = list.first; node; node = node->next){ e = (CEntity*)node->item; level = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel()->level; - if(level != LEVEL_NONE) + if(level != LEVEL_GENERIC) return (eLevelName)level; } - return LEVEL_NONE; + return LEVEL_GENERIC; } // Get a level this sector is in based on collision models @@ -108,15 +108,15 @@ GetCollisionInSector(CSector §) int level; level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_BUILDINGS]); - if(level == LEVEL_NONE) + if(level == LEVEL_GENERIC) level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_BUILDINGS_OVERLAP]); - if(level == LEVEL_NONE) + if(level == LEVEL_GENERIC) level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_OBJECTS]); - if(level == LEVEL_NONE) + if(level == LEVEL_GENERIC) level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_OBJECTS_OVERLAP]); - if(level == LEVEL_NONE) + if(level == LEVEL_GENERIC) level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_DUMMIES]); - if(level == LEVEL_NONE) + if(level == LEVEL_GENERIC) level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_DUMMIES_OVERLAP]); return (eLevelName)level; } @@ -133,7 +133,7 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange) int xmin, xmax, ymin, ymax; int x, y; - level = LEVEL_NONE; + level = LEVEL_GENERIC; playerCoors = FindPlayerCoors(); sx = CWorld::GetSectorIndexX(playerCoors.x); @@ -161,8 +161,8 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange) for(x = xmin; x <= xmax; x++) for(y = ymin; y <= ymax; y++){ l = GetCollisionInSector(*CWorld::GetSector(x, y)); - if(l != LEVEL_NONE){ - if(level == LEVEL_NONE) + if(l != LEVEL_GENERIC){ + if(level == LEVEL_GENERIC) level = l; if(level != l) multipleLevels = true; @@ -173,7 +173,7 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange) if(multipleLevels && veh && veh->IsBoat()) for(ei = veh->m_entryInfoList.first; ei; ei = ei->next){ level = GetCollisionInSector(*ei->sector); - if(level != LEVEL_NONE) + if(level != LEVEL_GENERIC) break; } } @@ -205,7 +205,7 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange) ms_collisionInMemory = CGame::currLevel; CReplay::EmptyReplayBuffer(); #ifndef NO_ISLAND_LOADING - if(CGame::currLevel != LEVEL_NONE) + if(CGame::currLevel != LEVEL_GENERIC) LoadSplash(GetLevelSplashScreen(CGame::currLevel)); CStreaming::RemoveUnusedBigBuildings(CGame::currLevel); CStreaming::RemoveUnusedBuildings(CGame::currLevel); @@ -232,7 +232,7 @@ CCollision::SortOutCollisionAfterLoad(void) #ifndef NO_ISLAND_LOADING CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel); #endif - if (CGame::currLevel != LEVEL_NONE) { + if (CGame::currLevel != LEVEL_GENERIC) { #ifdef NO_ISLAND_LOADING static bool bAlreadyLoaded = false; if (bAlreadyLoaded) { diff --git a/src/core/Game.cpp b/src/core/Game.cpp index 4c8aaa72..fe073d29 100644 --- a/src/core/Game.cpp +++ b/src/core/Game.cpp @@ -357,7 +357,7 @@ bool CGame::Initialise(const char* datFile) CStreaming::Init(); CStreaming::LoadInitialVehicles(); CStreaming::LoadInitialPeds(); - CStreaming::RequestBigBuildings(LEVEL_NONE); + CStreaming::RequestBigBuildings(LEVEL_GENERIC); CStreaming::LoadAllRequestedModels(false); printf("Streaming uses %dK of its memory", CStreaming::ms_memoryUsed / 1024); LoadingScreen("Loading the Game", "Load animations", GetRandomSplashScreen()); @@ -511,7 +511,7 @@ void CGame::ReInitGameObjectVariables(void) CTimeCycle::Initialise(); CDraw::SetFOV(120.0f); CDraw::ms_fLODDistance = 500.0f; - CStreaming::RequestBigBuildings(LEVEL_NONE); + CStreaming::RequestBigBuildings(LEVEL_GENERIC); CStreaming::LoadAllRequestedModels(false); CPed::Initialise(); CEventList::Initialise(); diff --git a/src/core/Game.h b/src/core/Game.h index 48f31abc..46e8fc68 100644 --- a/src/core/Game.h +++ b/src/core/Game.h @@ -2,7 +2,7 @@ enum eLevelName { LEVEL_IGNORE = -1, // beware, this is only used in CPhysical's m_nZoneLevel - LEVEL_NONE = 0, + LEVEL_GENERIC = 0, LEVEL_INDUSTRIAL, LEVEL_COMMERCIAL, LEVEL_SUBURBAN diff --git a/src/core/PlayerInfo.cpp b/src/core/PlayerInfo.cpp index 69c1fe49..09b3a499 100644 --- a/src/core/PlayerInfo.cpp +++ b/src/core/PlayerInfo.cpp @@ -553,7 +553,7 @@ CPlayerInfo::Process(void) veh->m_nZoneLevel = LEVEL_IGNORE; for (int i = 0; i < ARRAY_SIZE(veh->pPassengers); i++) { if (veh->pPassengers[i]) - veh->pPassengers[i]->m_nZoneLevel = LEVEL_NONE; + veh->pPassengers[i]->m_nZoneLevel = LEVEL_GENERIC; } CStats::DistanceTravelledInVehicle += veh->m_fDistanceTravelled; } else { diff --git a/src/core/TempColModels.cpp b/src/core/TempColModels.cpp index 1252e2c7..ab73631d 100644 --- a/src/core/TempColModels.cpp +++ b/src/core/TempColModels.cpp @@ -36,19 +36,19 @@ CTempColModels::Initialise(void) #define SET_COLMODEL_SPHERES(colmodel, sphrs)\ colmodel.numSpheres = ARRAY_SIZE(sphrs);\ colmodel.spheres = sphrs;\ - colmodel.level = LEVEL_NONE;\ + colmodel.level = LEVEL_GENERIC;\ colmodel.ownsCollisionVolumes = false;\ int i; ms_colModelBBox.boundingSphere.Set(2.0f, CVector(0.0f, 0.0f, 0.0f), SURFACE_DEFAULT, 0); ms_colModelBBox.boundingBox.Set(CVector(-2.0f, -2.0f, -2.0f), CVector(2.0f, 2.0f, 2.0f), SURFACE_DEFAULT, 0); - ms_colModelBBox.level = LEVEL_NONE; + ms_colModelBBox.level = LEVEL_GENERIC; for (i = 0; i < ARRAY_SIZE(ms_colModelCutObj); i++) { ms_colModelCutObj[i].boundingSphere.Set(2.0f, CVector(0.0f, 0.0f, 0.0f), SURFACE_DEFAULT, 0); ms_colModelCutObj[i].boundingBox.Set(CVector(-2.0f, -2.0f, -2.0f), CVector(2.0f, 2.0f, 2.0f), SURFACE_DEFAULT, 0); - ms_colModelCutObj[i].level = LEVEL_NONE; + ms_colModelCutObj[i].level = LEVEL_GENERIC; } // Ped Spheres diff --git a/src/core/World.cpp b/src/core/World.cpp index 8bcce8e7..9f384048 100644 --- a/src/core/World.cpp +++ b/src/core/World.cpp @@ -1797,7 +1797,7 @@ CWorld::ClearForRestart(void) CWorld::Remove(pEntity); delete pEntity; } - for(CPtrNode *pNode = GetBigBuildingList(LEVEL_NONE).first; pNode; pNode = pNode->next) { + for(CPtrNode *pNode = GetBigBuildingList(LEVEL_GENERIC).first; pNode; pNode = pNode->next) { CVehicle *pVehicle = (CVehicle *)pNode->item; if(pVehicle && pVehicle->IsVehicle() && pVehicle->IsPlane()) { CWorld::Remove(pVehicle); diff --git a/src/core/Zones.cpp b/src/core/Zones.cpp index 4f491a49..1556731b 100644 --- a/src/core/Zones.cpp +++ b/src/core/Zones.cpp @@ -90,7 +90,7 @@ CTheZones::Init(void) TotalNumberOfZoneInfos = 1; // why 1? TotalNumberOfZones = 1; - m_CurrLevel = LEVEL_NONE; + m_CurrLevel = LEVEL_GENERIC; m_pPlayersZone = &ZoneArray[0]; strcpy(ZoneArray[0].name, "CITYZON"); @@ -100,7 +100,7 @@ CTheZones::Init(void) ZoneArray[0].maxx = 4000.0f; ZoneArray[0].maxy = 4000.0f; ZoneArray[0].maxz = 500.0f; - ZoneArray[0].level = LEVEL_NONE; + ZoneArray[0].level = LEVEL_GENERIC; for(i = 0; i < NUMMAPZONES; i++){ memset(&MapZoneArray[i], 0, sizeof(CZone)); @@ -116,7 +116,7 @@ CTheZones::Init(void) MapZoneArray[0].maxx = 4000.0f; MapZoneArray[0].maxy = 4000.0f; MapZoneArray[0].maxz = 500.0f; - MapZoneArray[0].level = LEVEL_NONE; + MapZoneArray[0].level = LEVEL_GENERIC; } void @@ -577,7 +577,7 @@ CTheZones::FindZoneForPoint(const CVector &pos) return LEVEL_COMMERCIAL; if(PointLiesWithinZone(&pos, GetZone(FindZoneByLabelAndReturnIndex("SUB_ZON")))) return LEVEL_SUBURBAN; - return LEVEL_NONE; + return LEVEL_GENERIC; } void -- cgit v1.2.3