diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/ColStore.cpp | 1 | ||||
-rw-r--r-- | src/core/Game.cpp | 5 | ||||
-rw-r--r-- | src/core/Pad.cpp | 10 | ||||
-rw-r--r-- | src/core/Stats.cpp | 4 | ||||
-rw-r--r-- | src/core/Streaming.cpp | 16 | ||||
-rw-r--r-- | src/core/SurfaceTable.cpp | 8 | ||||
-rw-r--r-- | src/core/SurfaceTable.h | 1 | ||||
-rw-r--r-- | src/core/config.h | 1 | ||||
-rw-r--r-- | src/core/main.cpp | 27 | ||||
-rw-r--r-- | src/core/re3.cpp | 12 |
10 files changed, 79 insertions, 6 deletions
diff --git a/src/core/ColStore.cpp b/src/core/ColStore.cpp index 070967e5..bca1e9b7 100644 --- a/src/core/ColStore.cpp +++ b/src/core/ColStore.cpp @@ -223,7 +223,6 @@ CColStore::EnsureCollisionIsInMemory(const CVector2D &pos) } } -//--MIAMI: done bool CColStore::HasCollisionLoaded(const CVector2D &pos) { diff --git a/src/core/Game.cpp b/src/core/Game.cpp index 172a77b5..dbb898bf 100644 --- a/src/core/Game.cpp +++ b/src/core/Game.cpp @@ -91,6 +91,7 @@ #include "Ropes.h" #include "WindModifiers.h" #include "postfx.h" +#include "custompipes.h" eLevelName CGame::currLevel; int32 CGame::currArea; @@ -356,6 +357,10 @@ bool CGame::Initialise(const char* datFile) CdStreamAddImage("MODELS\\GTA3.IMG"); CFileLoader::LoadLevel("DATA\\DEFAULT.DAT"); CFileLoader::LoadLevel(datFile); +#ifdef EXTENDED_PIPELINES + // for generic fallback + CustomPipes::SetTxdFindCallback(); +#endif CWorld::AddParticles(); CVehicleModelInfo::LoadVehicleColours(); CVehicleModelInfo::LoadEnvironmentMaps(); diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index 222fe349..eb2b1e31 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -42,6 +42,7 @@ #include "Gangs.h" #include "platform.h" #include "Stats.h" +#include "CarCtrl.h" #ifdef GTA_PS2 #include "eetypes.h" @@ -437,6 +438,12 @@ void PinkCarsCheat() gbPinkCars = true; } +void MadCarsCheat() +{ + CHud::SetHelpMessage(TheText.Get("CHEAT1"), true); + CCarCtrl::bMadDriversCheat = true; +} + void NoSeaBedCheat(void) { CHud::SetHelpMessage(TheText.Get("CHEAT1"), true); @@ -1228,6 +1235,7 @@ void CPad::AddToPCCheatString(char c) // "MIAMITRAFFIC" else if (!Cheat_strncmp(KeyBoardCheatString, "FNMGNmWPNLVU")) { KeyBoardCheatString[0] = ' '; + MadCarsCheat(); } // "AHAIRDRESSERSCAR" else if (!Cheat_strncmp(KeyBoardCheatString, "UFJT_`VZF]QZPaUG")) { @@ -3104,7 +3112,7 @@ void CPad::ResetCheats(void) CVehicle::bCheat8 = false; gbBlackCars = false; gbPinkCars = false; - + CCarCtrl::bMadDriversCheat = false; gbFastTime = false; CTimer::SetTimeScale(1.0f); } diff --git a/src/core/Stats.cpp b/src/core/Stats.cpp index d5c08e4f..1efcee01 100644 --- a/src/core/Stats.cpp +++ b/src/core/Stats.cpp @@ -143,7 +143,9 @@ void CStats::Init() DistanceTravelledByBoat = 0; DistanceTravelledByGolfCart = 0; DistanceTravelledByHelicoptor = 0; - DistanceTravelledByPlane = 0; // FIX: Wasn't initialized +#ifdef FIX_BUGS + DistanceTravelledByPlane = 0; +#endif LivesSavedWithAmbulance = 0; CriminalsCaught = 0; HighestLevelVigilanteMission = 0; diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp index 3c32b856..b6a4f735 100644 --- a/src/core/Streaming.cpp +++ b/src/core/Streaming.cpp @@ -199,11 +199,25 @@ CStreaming::Init2(void) ms_pStreamingBuffer[1] = ms_pStreamingBuffer[0] + ms_streamingBufferSize*CDSTREAM_SECTOR_SIZE; debug("Streaming buffer size is %d sectors", ms_streamingBufferSize); + // PC only, figure out how much memory we got +#ifdef GTA_PC #define MB (1024*1024) +#ifdef FIX_BUGS + // do what gta3 does + extern size_t _dwMemAvailPhys; + ms_memoryAvailable = (_dwMemAvailPhys - 10*MB)/2; + if(ms_memoryAvailable < 65*MB) + ms_memoryAvailable = 65*MB; + desiredNumVehiclesLoaded = (int32)((ms_memoryAvailable / MB - 65) / 3 + 12); + if(desiredNumVehiclesLoaded > MAXVEHICLESLOADED) + desiredNumVehiclesLoaded = MAXVEHICLESLOADED; +#else ms_memoryAvailable = 65 * MB; desiredNumVehiclesLoaded = 25; - debug("Memory allocated to Streaming is %dMB", ms_memoryAvailable / MB); + debug("Memory allocated to Streaming is %zuMB", ms_memoryAvailable/MB); // original modifier was %d +#endif #undef MB +#endif // find island LODs diff --git a/src/core/SurfaceTable.cpp b/src/core/SurfaceTable.cpp index 9076a9a6..56cea203 100644 --- a/src/core/SurfaceTable.cpp +++ b/src/core/SurfaceTable.cpp @@ -6,6 +6,8 @@ #include "Collision.h" #include "SurfaceTable.h" +//--MIAMI: file done + float CSurfaceTable::ms_aAdhesiveLimitTable[NUMADHESIVEGROUPS][NUMADHESIVEGROUPS]; void @@ -148,3 +150,9 @@ CSurfaceTable::GetAdhesiveLimit(CColPoint &colpoint) { return ms_aAdhesiveLimitTable[GetAdhesionGroup(colpoint.surfaceB)][GetAdhesionGroup(colpoint.surfaceA)]; } + +bool +CSurfaceTable::IsSoftLanding(uint8 surf) +{ + return surf == SURFACE_GRASS || surf == SURFACE_SAND || surf == SURFACE_SAND_BEACH; +} diff --git a/src/core/SurfaceTable.h b/src/core/SurfaceTable.h index 359ebd5c..cd08c843 100644 --- a/src/core/SurfaceTable.h +++ b/src/core/SurfaceTable.h @@ -96,4 +96,5 @@ public: static int GetAdhesionGroup(uint8 surfaceType); static float GetWetMultiplier(uint8 surfaceType); static float GetAdhesiveLimit(CColPoint &colpoint); + static bool IsSoftLanding(uint8 surf); }; diff --git a/src/core/config.h b/src/core/config.h index 6c6a28ec..efdb5c8c 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -226,6 +226,7 @@ enum Config { //#define USE_TEXTURE_POOL //#define CUTSCENE_BORDERS_SWITCH //#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur) +//#define EXTENDED_PIPELINES // custom render pipelines (includes Neo) //#define MULTISAMPLING // adds MSAA option TODO #ifdef LIBRW diff --git a/src/core/main.cpp b/src/core/main.cpp index 533ab446..27f6abd9 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -65,6 +65,7 @@ #include "Clock.h" #include "Occlusion.h" #include "Ropes.h" +#include "custompipes.h" GlobalScene Scene; @@ -383,6 +384,9 @@ PluginAttach(void) return FALSE; } +#ifdef EXTENDED_PIPELINES + CustomPipes::CustomPipeRegister(); +#endif return TRUE; } @@ -396,7 +400,11 @@ Initialise3D(void *param) DebugMenuInit(); DebugMenuPopulate(); #endif // !DEBUGMENU - return CGame::InitialiseRenderWare(); + bool ret = CGame::InitialiseRenderWare(); +#ifdef EXTENDED_PIPELINES + CustomPipes::CustomPipeInit(); // need Scene.world for this +#endif + return ret; } return (FALSE); @@ -405,6 +413,9 @@ Initialise3D(void *param) static void Terminate3D(void) { +#ifdef EXTENDED_PIPELINES + CustomPipes::CustomPipeShutdown(); +#endif CGame::ShutdownRenderWare(); #ifdef DEBUGMENU DebugMenuShutdown(); @@ -1103,6 +1114,12 @@ Idle(void *arg) tbEndTimer("PreRender"); #endif +#ifdef FIX_BUGS + // This has to be done BEFORE RwCameraBeginUpdate + RwCameraSetFarClipPlane(Scene.camera, CTimeCycle::GetFarClip()); + RwCameraSetFogDistance(Scene.camera, CTimeCycle::GetFogStart()); +#endif + if(CWeather::LightningFlash && !CCullZones::CamNoRain()){ if(!DoRWStuffStartOfFrame_Horizon(255, 255, 255, 255, 255, 255, 255)) return; @@ -1115,9 +1132,10 @@ Idle(void *arg) DefinedState(); - // BUG. This has to be done BEFORE RwCameraBeginUpdate +#ifndef FIX_BUGS RwCameraSetFarClipPlane(Scene.camera, CTimeCycle::GetFarClip()); RwCameraSetFogDistance(Scene.camera, CTimeCycle::GetFogStart()); +#endif #ifdef TIMEBARS tbStartTimer(0, "RenderScene"); @@ -1126,6 +1144,11 @@ Idle(void *arg) #ifdef TIMEBARS tbEndTimer("RenderScene"); #endif + +#ifdef EXTENDED_PIPELINES + CustomPipes::EnvMapRender(); +#endif + RenderDebugShit(); RenderEffects(); diff --git a/src/core/re3.cpp b/src/core/re3.cpp index 155dbcf4..6a305b4c 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -35,6 +35,7 @@ #include "Script.h" #include "MBlur.h" #include "postfx.h" +#include "custompipes.h" #ifndef _WIN32 #include "assert.h" @@ -423,6 +424,17 @@ DebugMenuPopulate(void) #endif DebugMenuAddVar("Render", "Drunkness", &CMBlur::Drunkness, nil, 0.05f, 0, 1.0f); DebugMenuAddVarBool8("Render", "Occlusion debug", &bDisplayOccDebugStuff, nil); +#ifdef EXTENDED_PIPELINES + static const char *vehpipenames[] = { "MatFX", "Neo" }; + e = DebugMenuAddVar("Render", "Vehicle Pipeline", &CustomPipes::VehiclePipeSwitch, nil, + 1, CustomPipes::VEHICLEPIPE_MATFX, CustomPipes::VEHICLEPIPE_NEO, vehpipenames); + DebugMenuEntrySetWrap(e, true); + DebugMenuAddVar("Render", "Neo Vehicle Shininess", &CustomPipes::VehicleShininess, nil, 0.1f, 0, 1.0f); + DebugMenuAddVar("Render", "Neo Vehicle Specularity", &CustomPipes::VehicleSpecularity, nil, 0.1f, 0, 1.0f); + DebugMenuAddVar("Render", "Neo Ped Rim light", &CustomPipes::RimlightMult, nil, 0.1f, 0, 1.0f); + DebugMenuAddVar("Render", "Neo World Lightmaps", &CustomPipes::LightmapMult, nil, 0.1f, 0, 1.0f); + DebugMenuAddVar("Render", "Neo Road Gloss", &CustomPipes::GlossMult, nil, 0.1f, 0, 1.0f); +#endif DebugMenuAddVarBool8("Render", "Show Ped Paths", &gbShowPedPaths, nil); DebugMenuAddVarBool8("Render", "Show Car Paths", &gbShowCarPaths, nil); DebugMenuAddVarBool8("Render", "Show Car Path Links", &gbShowCarPathsLinks, nil); |