diff --git a/resource/dist/ModelExtras.ini b/resource/dist/ModelExtras.ini index 5f68a6ef..29af86ed 100755 --- a/resource/dist/ModelExtras.ini +++ b/resource/dist/ModelExtras.ini @@ -50,6 +50,7 @@ CoronaDistanceMul = 0.1 # Scales coronas at distance CoronaNearClip = 0.45 # Minimum camera clipping distance for coronas LightShadowDistance = 120.0 # Maximum draw distance for vehicle ground light shadows HighBeamPointLightMul = 2.0 # Multiplier for high beam point light reach (1.0 matches low beam, up to 4.0) +SirenPointLightMul = 1.0 # Multiplier for siren point light reach (up to 4.0) LightHeightLimit = 1.4 # Light height limit (0.0 to disable) MaterialAmbientMul = 1.0 # Multiplier for illuminated light material ambient brightness LightCoronaSize = 0.3 # Standard base of coronas size for turn and other lights diff --git a/src/ModelExtrasAPI.cpp b/src/ModelExtrasAPI.cpp index c56242ec..7a0efc9e 100755 --- a/src/ModelExtrasAPI.cpp +++ b/src/ModelExtrasAPI.cpp @@ -427,5 +427,10 @@ int ME_GetPedVariationCount(int modelIndex) { return 0; } +// Visual & Render Configuration +float ME_GetSirenPointLightMul() { + return LightsConfig::Get().fSirenPointLightMul; +} + } // extern "C" diff --git a/src/ModelExtrasAPI.h b/src/ModelExtrasAPI.h index 530d20ca..6fc005cf 100755 --- a/src/ModelExtrasAPI.h +++ b/src/ModelExtrasAPI.h @@ -214,6 +214,9 @@ extern "C" // Ped Colors ME_WRAPPER int ME_GetPedVariationCount(int modelIndex); + // Visual & Render Configuration + ME_WRAPPER float ME_GetSirenPointLightMul(); + #ifdef __cplusplus } #endif \ No newline at end of file diff --git a/src/features/lights/data.h b/src/features/lights/data.h index 18bffe86..51fd7070 100644 --- a/src/features/lights/data.h +++ b/src/features/lights/data.h @@ -51,6 +51,7 @@ struct LightsConfig { bool bFoglightTiedToHeadlight = false; bool bPlayerIdleBrakeLights = false; float fHighBeamPointLightMul = 2.0f; + float fSirenPointLightMul = 1.0f; void InitConfig() { gbGlobalIndicatorLights = gConfig.ReadBoolean("LIGHTS", "StandardLights_GlobalIndicatorLights", gConfig.ReadBoolean("FEATURES", "StandardLights_GlobalIndicatorLights", false)); @@ -84,6 +85,9 @@ struct LightsConfig { float rawMul = gConfig.ReadFloat("LIGHTS", "HighBeamPointLightMul", gConfig.ReadFloat("TWEAKS", "HighBeamPointLightMul", 2.0f)); fHighBeamPointLightMul = (rawMul < 1.0f) ? 1.0f : ((rawMul > 4.0f) ? 4.0f : rawMul); + + float rawSirenMul = gConfig.ReadFloat("LIGHTS", "SirenPointLightMul", gConfig.ReadFloat("TWEAKS", "SirenPointLightMul", 1.0f)); + fSirenPointLightMul = (rawSirenMul < 0.1f) ? 0.1f : ((rawSirenMul > 4.0f) ? 4.0f : rawSirenMul); } private: diff --git a/src/features/sirens.cpp b/src/features/sirens.cpp index 1ed7dd8c..6b6c9627 100755 --- a/src/features/sirens.cpp +++ b/src/features/sirens.cpp @@ -1292,7 +1292,7 @@ void Sirens::ProcessPointLights(CVehicle *pVeh) } else if (mat.second->Size > 0.0f) { sirenRadius = mat.second->Size * 3.0f; } - sirenRadius = std::clamp(sirenRadius, 5.0f, 15.0f); + sirenRadius = std::clamp(sirenRadius, 5.0f, 15.0f) * LightsConfig::Get().fSirenPointLightMul; float r = std::clamp(activeColor.r / 255.0f, 0.0f, 1.0f); float g = std::clamp(activeColor.g / 255.0f, 0.0f, 1.0f); @@ -1369,13 +1369,14 @@ void Sirens::ProcessPointLights(CVehicle *pVeh) { uint32_t step = (CTimer::m_snTimeInMilliseconds / 120) % 4; CMatrix vehMat = pVeh->GetMatrix(); + float bikeSirenRadius = 8.5f * LightsConfig::Get().fSirenPointLightMul; if (step == 0 || step == 1) { CVector localLeft(-0.35f, 0.70f, 0.45f); CVector plightPos = pVeh->TransformFromObjectSpace(localLeft); CVector worldDir = vehMat.up - vehMat.at * 0.25f; worldDir.Normalize(); - CPointLights::AddLight(PLTYPE_SPOTLIGHT, plightPos, worldDir, 8.5f, 1.0f, 0.1f, 0.1f, 0, false, nullptr); + CPointLights::AddLight(PLTYPE_SPOTLIGHT, plightPos, worldDir, bikeSirenRadius, 1.0f, 0.1f, 0.1f, 0, false, nullptr); } else if (step == 2 || step == 3) { @@ -1383,7 +1384,7 @@ void Sirens::ProcessPointLights(CVehicle *pVeh) CVector plightPos = pVeh->TransformFromObjectSpace(localRight); CVector worldDir = vehMat.up - vehMat.at * 0.25f; worldDir.Normalize(); - CPointLights::AddLight(PLTYPE_SPOTLIGHT, plightPos, worldDir, 8.5f, 0.1f, 0.1f, 1.0f, 0, false, nullptr); + CPointLights::AddLight(PLTYPE_SPOTLIGHT, plightPos, worldDir, bikeSirenRadius, 0.1f, 0.1f, 1.0f, 0, false, nullptr); } } }