summaryrefslogtreecommitdiffstats
path: root/src/render/Renderer.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-11-20 00:18:37 +0100
committerSergeanur <s.anureev@yandex.ua>2020-11-20 00:18:37 +0100
commitfe40f65703052e4fb4f54fd8a2eec08b26e4313a (patch)
treee64f666fa49a815012cbb1f9facc465d7131a64e /src/render/Renderer.cpp
parentFix mouse lock/high-dpi (diff)
downloadre3-fe40f65703052e4fb4f54fd8a2eec08b26e4313a.tar
re3-fe40f65703052e4fb4f54fd8a2eec08b26e4313a.tar.gz
re3-fe40f65703052e4fb4f54fd8a2eec08b26e4313a.tar.bz2
re3-fe40f65703052e4fb4f54fd8a2eec08b26e4313a.tar.lz
re3-fe40f65703052e4fb4f54fd8a2eec08b26e4313a.tar.xz
re3-fe40f65703052e4fb4f54fd8a2eec08b26e4313a.tar.zst
re3-fe40f65703052e4fb4f54fd8a2eec08b26e4313a.zip
Diffstat (limited to 'src/render/Renderer.cpp')
-rw-r--r--src/render/Renderer.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index c2982d6d..fa01c61a 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -1492,6 +1492,45 @@ CRenderer::RequestObjectsInFrustum(void)
}
}
+// --MIAMI: Done
+bool
+CPed::SetupLighting(void)
+{
+ ActivateDirectional();
+ SetAmbientColoursForPedsCarsAndObjects();
+
+#ifndef MASTER
+ // Originally this was being called through iteration of Sectors, but putting it here is better.
+ if (GetDebugDisplay() != 0 && !IsPlayer())
+ DebugRenderOnePedText();
+#endif
+
+ if (bRenderScorched) {
+ WorldReplaceNormalLightsWithScorched(Scene.world, 0.1f);
+ } else {
+ // Note that this lightMult is only affected by LIGHT_DARKEN. If there's no LIGHT_DARKEN, it will be 1.0.
+ float lightMult = CPointLights::GenerateLightsAffectingObject(&GetPosition());
+ if (lightMult != 1.0f) {
+ SetAmbientAndDirectionalColours(lightMult);
+ return true;
+ }
+ }
+ return false;
+}
+
+// --MIAMI: Done
+void
+CPed::RemoveLighting(bool reset)
+{
+ if (!bRenderScorched) {
+ CRenderer::RemoveVehiclePedLights(this, reset);
+ if (reset)
+ ReSetAmbientAndDirectionalColours();
+ }
+ SetAmbientColours();
+ DeActivateDirectional();
+}
+
float
CalcNewDelta(RwV2d *a, RwV2d *b)
{