diff --git a/.vscode/settings.json b/.vscode/settings.json index 10cb5627..fee80960 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,7 +13,7 @@ "src/modelinfo", "src/objects", "src/peds", - "src/render", + "src/renderer", "src/rw", "src/save", "src/skel", diff --git a/codewarrior/reVC.mcp.xml b/codewarrior/reVC.mcp.xml index 92638894..750fb675 100644 --- a/codewarrior/reVC.mcp.xml +++ b/codewarrior/reVC.mcp.xml @@ -187,7 +187,7 @@ SearchPath - Path..\src\render + Path..\src\renderer PathFormatWindows PathRootProject @@ -6712,7 +6712,7 @@ SearchPath - Path..\src\render + Path..\src\renderer PathFormatWindows PathRootProject @@ -14909,7 +14909,7 @@ Windows - render + renderer Debug Name diff --git a/premake5.lua b/premake5.lua index f6c31675..a899d5d5 100644 --- a/premake5.lua +++ b/premake5.lua @@ -86,7 +86,7 @@ workspace "reLCS" linkoptions { "-fsanitize=address" } end - filter { "system:windows" } + filter { "system:windows" } configurations { "Vanilla" } platforms { "win-x86-RW34_d3d8-mss", @@ -273,7 +273,7 @@ project "reLCS" files { addSrcFiles("src/modelinfo") } files { addSrcFiles("src/objects") } files { addSrcFiles("src/peds") } - files { addSrcFiles("src/render") } + files { addSrcFiles("src/renderer") } files { addSrcFiles("src/rw") } files { addSrcFiles("src/save") } files { addSrcFiles("src/skel") } @@ -304,7 +304,7 @@ project "reLCS" includedirs { "src/modelinfo" } includedirs { "src/objects" } includedirs { "src/peds" } - includedirs { "src/render" } + includedirs { "src/renderer" } includedirs { "src/rw" } includedirs { "src/save/" } includedirs { "src/skel/" } @@ -322,9 +322,9 @@ project "reLCS" includedirs { "vendor/ogg/include" } includedirs { "vendor/opus/include" } includedirs { "vendor/opusfile/include" } - end - - filter "configurations:Vanilla" + end + + filter "configurations:Vanilla" defines { "VANILLA_DEFINES" } filter "platforms:*mss" diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index 2d8cebc2..2e2b7e1f 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -2965,7 +2965,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params) CPed *pPed = params.m_pVehicle->pDriver; if(!pPed) break; - if(!pPed->HasWeaponSlot(WEAPONSLOT_SUBMACHINEGUN)) { + if(!pPed->HasWeaponSlot(WEAPONSLOT_SUBMACHINEGUN) || (params.m_pVehicle->GetModelIndex() == MI_PREDATOR && !pPed->IsPedDoingDriveByShooting())) { sampleIndex = SFX_UZI_LEFT; frequency = SampleManager.GetSampleBaseFrequency(sampleIndex); frequency += RandomDisplacement(frequency / 32); diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp index cbf17be9..2c0bf8f2 100644 --- a/src/control/Garages.cpp +++ b/src/control/Garages.cpp @@ -2618,6 +2618,9 @@ void CGarages::Save(uint8 * buf, uint32 * size) //INITSAVEBUF *size = 10692; // for some reason it's not actual size again //*size = (6 * sizeof(uint32) + TOTAL_COLLECTCARS_GARAGES * sizeof(*CarTypesCollected) + sizeof(uint32) + TOTAL_HIDEOUT_GARAGES * NUM_GARAGE_STORED_CARS * sizeof(CStoredCar) + NUM_GARAGES * sizeof(CGarage)); +#if !defined THIS_IS_STUPID && defined COMPATIBLE_SAVES + memset(buf + 7340, 0, *size - 7340); // garbage data is written otherwise +#endif CloseHideOutGaragesBeforeSave(); WriteSaveBuf(buf, NumGarages); WriteSaveBuf(buf, (uint32)BombsAreFree); diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index 9d261010..c0b1af23 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -2362,12 +2362,12 @@ CPed::ProcessControl(void) } else { obstacleForFlyingOtherDirZ = 501.0f; } - uint8 flyDir = 0; + int16 flyDir = 0; float feetZ = GetPosition().z - FEET_OFFSET; #ifdef FIX_BUGS - if (obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ < 501.0f) + if (obstacleForFlyingZ > feetZ && obstacleForFlyingZ < 500.0f) flyDir = 1; - else if (obstacleForFlyingOtherDirZ > feetZ && obstacleForFlyingZ < 500.0f) + else if (obstacleForFlyingOtherDirZ > feetZ && obstacleForFlyingOtherDirZ < 501.0f) flyDir = 2; #else if ((obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ < 500.0f) || (obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ > feetZ)) @@ -2376,8 +2376,8 @@ CPed::ProcessControl(void) flyDir = 2; #endif - if (flyDir != 0 && !bHeadStuckInCollision) { - SetPosition((flyDir == 2 ? obstacleForFlyingOtherDir.point : obstacleForFlying.point)); + if (flyDir > 0 && !bHeadStuckInCollision) { + GetMatrix().SetTranslateOnly(flyDir == 2 ? obstacleForFlyingOtherDir.point : obstacleForFlying.point); GetMatrix().GetPosition().z += FEET_OFFSET; GetMatrix().UpdateRW(); SetLanding(); @@ -3009,7 +3009,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints) lowerSpeedLimit *= 1.5f; } CAnimBlendAssociation *fallAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_STD_FALL); - if (!bWasStanding && speed > upperSpeedLimit && (!bPushedAlongByCar || m_vecMoveSpeed.z < lowerSpeedLimit) + if (!bWasStanding && ((speed > upperSpeedLimit && !bPushedAlongByCar) || (m_vecMoveSpeed.z < lowerSpeedLimit)) && m_pCollidingEntity != collidingEnt) { float damage = 100.0f * Max(speed - 0.25f, 0.0f); diff --git a/src/render/2dEffect.h b/src/renderer/2dEffect.h similarity index 100% rename from src/render/2dEffect.h rename to src/renderer/2dEffect.h diff --git a/src/render/Antennas.cpp b/src/renderer/Antennas.cpp similarity index 100% rename from src/render/Antennas.cpp rename to src/renderer/Antennas.cpp diff --git a/src/render/Antennas.h b/src/renderer/Antennas.h similarity index 100% rename from src/render/Antennas.h rename to src/renderer/Antennas.h diff --git a/src/render/Clouds.cpp b/src/renderer/Clouds.cpp similarity index 100% rename from src/render/Clouds.cpp rename to src/renderer/Clouds.cpp diff --git a/src/render/Clouds.h b/src/renderer/Clouds.h similarity index 100% rename from src/render/Clouds.h rename to src/renderer/Clouds.h diff --git a/src/render/Console.cpp b/src/renderer/Console.cpp similarity index 100% rename from src/render/Console.cpp rename to src/renderer/Console.cpp diff --git a/src/render/Console.h b/src/renderer/Console.h similarity index 100% rename from src/render/Console.h rename to src/renderer/Console.h diff --git a/src/render/Coronas.cpp b/src/renderer/Coronas.cpp similarity index 100% rename from src/render/Coronas.cpp rename to src/renderer/Coronas.cpp diff --git a/src/render/Coronas.h b/src/renderer/Coronas.h similarity index 100% rename from src/render/Coronas.h rename to src/renderer/Coronas.h diff --git a/src/render/Credits.cpp b/src/renderer/Credits.cpp similarity index 100% rename from src/render/Credits.cpp rename to src/renderer/Credits.cpp diff --git a/src/render/Credits.h b/src/renderer/Credits.h similarity index 100% rename from src/render/Credits.h rename to src/renderer/Credits.h diff --git a/src/render/CutsceneShadow.cpp b/src/renderer/CutsceneShadow.cpp similarity index 100% rename from src/render/CutsceneShadow.cpp rename to src/renderer/CutsceneShadow.cpp diff --git a/src/render/CutsceneShadow.h b/src/renderer/CutsceneShadow.h similarity index 100% rename from src/render/CutsceneShadow.h rename to src/renderer/CutsceneShadow.h diff --git a/src/render/Draw.cpp b/src/renderer/Draw.cpp similarity index 100% rename from src/render/Draw.cpp rename to src/renderer/Draw.cpp diff --git a/src/render/Draw.h b/src/renderer/Draw.h similarity index 100% rename from src/render/Draw.h rename to src/renderer/Draw.h diff --git a/src/render/Fluff.cpp b/src/renderer/Fluff.cpp similarity index 100% rename from src/render/Fluff.cpp rename to src/renderer/Fluff.cpp diff --git a/src/render/Fluff.h b/src/renderer/Fluff.h similarity index 100% rename from src/render/Fluff.h rename to src/renderer/Fluff.h diff --git a/src/render/Font.cpp b/src/renderer/Font.cpp similarity index 100% rename from src/render/Font.cpp rename to src/renderer/Font.cpp diff --git a/src/render/Font.h b/src/renderer/Font.h similarity index 100% rename from src/render/Font.h rename to src/renderer/Font.h diff --git a/src/render/Glass.cpp b/src/renderer/Glass.cpp similarity index 100% rename from src/render/Glass.cpp rename to src/renderer/Glass.cpp diff --git a/src/render/Glass.h b/src/renderer/Glass.h similarity index 100% rename from src/render/Glass.h rename to src/renderer/Glass.h diff --git a/src/render/Hud.cpp b/src/renderer/Hud.cpp similarity index 100% rename from src/render/Hud.cpp rename to src/renderer/Hud.cpp diff --git a/src/render/Hud.h b/src/renderer/Hud.h similarity index 100% rename from src/render/Hud.h rename to src/renderer/Hud.h diff --git a/src/render/Instance.cpp b/src/renderer/Instance.cpp similarity index 100% rename from src/render/Instance.cpp rename to src/renderer/Instance.cpp diff --git a/src/render/Instance.h b/src/renderer/Instance.h similarity index 100% rename from src/render/Instance.h rename to src/renderer/Instance.h diff --git a/src/render/Lines.cpp b/src/renderer/Lines.cpp similarity index 100% rename from src/render/Lines.cpp rename to src/renderer/Lines.cpp diff --git a/src/render/Lines.h b/src/renderer/Lines.h similarity index 100% rename from src/render/Lines.h rename to src/renderer/Lines.h diff --git a/src/render/MBlur.cpp b/src/renderer/MBlur.cpp similarity index 100% rename from src/render/MBlur.cpp rename to src/renderer/MBlur.cpp diff --git a/src/render/MBlur.h b/src/renderer/MBlur.h similarity index 100% rename from src/render/MBlur.h rename to src/renderer/MBlur.h diff --git a/src/render/Occlusion.cpp b/src/renderer/Occlusion.cpp similarity index 100% rename from src/render/Occlusion.cpp rename to src/renderer/Occlusion.cpp diff --git a/src/render/Occlusion.h b/src/renderer/Occlusion.h similarity index 100% rename from src/render/Occlusion.h rename to src/renderer/Occlusion.h diff --git a/src/render/Particle.cpp b/src/renderer/Particle.cpp similarity index 100% rename from src/render/Particle.cpp rename to src/renderer/Particle.cpp diff --git a/src/render/Particle.h b/src/renderer/Particle.h similarity index 100% rename from src/render/Particle.h rename to src/renderer/Particle.h diff --git a/src/render/ParticleMgr.cpp b/src/renderer/ParticleMgr.cpp similarity index 100% rename from src/render/ParticleMgr.cpp rename to src/renderer/ParticleMgr.cpp diff --git a/src/render/ParticleMgr.h b/src/renderer/ParticleMgr.h similarity index 100% rename from src/render/ParticleMgr.h rename to src/renderer/ParticleMgr.h diff --git a/src/render/ParticleType.h b/src/renderer/ParticleType.h similarity index 100% rename from src/render/ParticleType.h rename to src/renderer/ParticleType.h diff --git a/src/render/PlayerSkin.cpp b/src/renderer/PlayerSkin.cpp similarity index 100% rename from src/render/PlayerSkin.cpp rename to src/renderer/PlayerSkin.cpp diff --git a/src/render/PlayerSkin.h b/src/renderer/PlayerSkin.h similarity index 100% rename from src/render/PlayerSkin.h rename to src/renderer/PlayerSkin.h diff --git a/src/render/PointLights.cpp b/src/renderer/PointLights.cpp similarity index 100% rename from src/render/PointLights.cpp rename to src/renderer/PointLights.cpp diff --git a/src/render/PointLights.h b/src/renderer/PointLights.h similarity index 100% rename from src/render/PointLights.h rename to src/renderer/PointLights.h diff --git a/src/render/RenderBuffer.cpp b/src/renderer/RenderBuffer.cpp similarity index 100% rename from src/render/RenderBuffer.cpp rename to src/renderer/RenderBuffer.cpp diff --git a/src/render/RenderBuffer.h b/src/renderer/RenderBuffer.h similarity index 100% rename from src/render/RenderBuffer.h rename to src/renderer/RenderBuffer.h diff --git a/src/render/Renderer.cpp b/src/renderer/Renderer.cpp similarity index 100% rename from src/render/Renderer.cpp rename to src/renderer/Renderer.cpp diff --git a/src/render/Renderer.h b/src/renderer/Renderer.h similarity index 100% rename from src/render/Renderer.h rename to src/renderer/Renderer.h diff --git a/src/render/Rubbish.cpp b/src/renderer/Rubbish.cpp similarity index 100% rename from src/render/Rubbish.cpp rename to src/renderer/Rubbish.cpp diff --git a/src/render/Rubbish.h b/src/renderer/Rubbish.h similarity index 100% rename from src/render/Rubbish.h rename to src/renderer/Rubbish.h diff --git a/src/render/ShadowCamera.cpp b/src/renderer/ShadowCamera.cpp similarity index 100% rename from src/render/ShadowCamera.cpp rename to src/renderer/ShadowCamera.cpp diff --git a/src/render/ShadowCamera.h b/src/renderer/ShadowCamera.h similarity index 100% rename from src/render/ShadowCamera.h rename to src/renderer/ShadowCamera.h diff --git a/src/render/Shadows.cpp b/src/renderer/Shadows.cpp similarity index 100% rename from src/render/Shadows.cpp rename to src/renderer/Shadows.cpp diff --git a/src/render/Shadows.h b/src/renderer/Shadows.h similarity index 100% rename from src/render/Shadows.h rename to src/renderer/Shadows.h diff --git a/src/render/Skidmarks.cpp b/src/renderer/Skidmarks.cpp similarity index 100% rename from src/render/Skidmarks.cpp rename to src/renderer/Skidmarks.cpp diff --git a/src/render/Skidmarks.h b/src/renderer/Skidmarks.h similarity index 100% rename from src/render/Skidmarks.h rename to src/renderer/Skidmarks.h diff --git a/src/render/SpecialFX.cpp b/src/renderer/SpecialFX.cpp similarity index 100% rename from src/render/SpecialFX.cpp rename to src/renderer/SpecialFX.cpp diff --git a/src/render/SpecialFX.h b/src/renderer/SpecialFX.h similarity index 100% rename from src/render/SpecialFX.h rename to src/renderer/SpecialFX.h diff --git a/src/render/Sprite.cpp b/src/renderer/Sprite.cpp similarity index 100% rename from src/render/Sprite.cpp rename to src/renderer/Sprite.cpp diff --git a/src/render/Sprite.h b/src/renderer/Sprite.h similarity index 100% rename from src/render/Sprite.h rename to src/renderer/Sprite.h diff --git a/src/render/Sprite2d.cpp b/src/renderer/Sprite2d.cpp similarity index 100% rename from src/render/Sprite2d.cpp rename to src/renderer/Sprite2d.cpp diff --git a/src/render/Sprite2d.h b/src/renderer/Sprite2d.h similarity index 100% rename from src/render/Sprite2d.h rename to src/renderer/Sprite2d.h diff --git a/src/render/TexList.cpp b/src/renderer/TexList.cpp similarity index 100% rename from src/render/TexList.cpp rename to src/renderer/TexList.cpp diff --git a/src/render/TexList.h b/src/renderer/TexList.h similarity index 100% rename from src/render/TexList.h rename to src/renderer/TexList.h diff --git a/src/render/Timecycle.cpp b/src/renderer/Timecycle.cpp similarity index 100% rename from src/render/Timecycle.cpp rename to src/renderer/Timecycle.cpp diff --git a/src/render/Timecycle.h b/src/renderer/Timecycle.h similarity index 100% rename from src/render/Timecycle.h rename to src/renderer/Timecycle.h diff --git a/src/render/VarConsole.cpp b/src/renderer/VarConsole.cpp similarity index 100% rename from src/render/VarConsole.cpp rename to src/renderer/VarConsole.cpp diff --git a/src/render/VarConsole.h b/src/renderer/VarConsole.h similarity index 100% rename from src/render/VarConsole.h rename to src/renderer/VarConsole.h diff --git a/src/render/WaterCannon.cpp b/src/renderer/WaterCannon.cpp similarity index 100% rename from src/render/WaterCannon.cpp rename to src/renderer/WaterCannon.cpp diff --git a/src/render/WaterCannon.h b/src/renderer/WaterCannon.h similarity index 100% rename from src/render/WaterCannon.h rename to src/renderer/WaterCannon.h diff --git a/src/render/WaterCreatures.cpp b/src/renderer/WaterCreatures.cpp similarity index 100% rename from src/render/WaterCreatures.cpp rename to src/renderer/WaterCreatures.cpp diff --git a/src/render/WaterCreatures.h b/src/renderer/WaterCreatures.h similarity index 100% rename from src/render/WaterCreatures.h rename to src/renderer/WaterCreatures.h diff --git a/src/render/WaterLevel.cpp b/src/renderer/WaterLevel.cpp similarity index 100% rename from src/render/WaterLevel.cpp rename to src/renderer/WaterLevel.cpp diff --git a/src/render/WaterLevel.h b/src/renderer/WaterLevel.h similarity index 100% rename from src/render/WaterLevel.h rename to src/renderer/WaterLevel.h diff --git a/src/render/Weather.cpp b/src/renderer/Weather.cpp similarity index 100% rename from src/render/Weather.cpp rename to src/renderer/Weather.cpp diff --git a/src/render/Weather.h b/src/renderer/Weather.h similarity index 100% rename from src/render/Weather.h rename to src/renderer/Weather.h diff --git a/src/render/WindModifiers.cpp b/src/renderer/WindModifiers.cpp similarity index 100% rename from src/render/WindModifiers.cpp rename to src/renderer/WindModifiers.cpp diff --git a/src/render/WindModifiers.h b/src/renderer/WindModifiers.h similarity index 100% rename from src/render/WindModifiers.h rename to src/renderer/WindModifiers.h diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp index e546eb05..bac82588 100644 --- a/src/weapons/Weapon.cpp +++ b/src/weapons/Weapon.cpp @@ -3182,7 +3182,7 @@ bool CPed::IsPedDoingDriveByShooting(void) { #ifdef FIX_BUGS - if (FindPlayerPed() == this && CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_nWeaponSlot == 5) { + if (FindPlayerPed() == this && CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_nWeaponSlot == WEAPONSLOT_SUBMACHINEGUN) { #else if (FindPlayerPed() == this && GetWeapon()->m_eWeaponType == WEAPONTYPE_UZI) { #endif