summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-11-19 20:12:20 +0100
committerSergeanur <s.anureev@yandex.ua>2020-11-19 20:12:20 +0100
commit9e45feb4fa0a841b1d059bcab8507fd80708d6e7 (patch)
tree4a26483c7755ef8dd41b4215efb62a27384fd5fd /src/render
parentMerge pull request #822 from aap/master (diff)
downloadre3-9e45feb4fa0a841b1d059bcab8507fd80708d6e7.tar
re3-9e45feb4fa0a841b1d059bcab8507fd80708d6e7.tar.gz
re3-9e45feb4fa0a841b1d059bcab8507fd80708d6e7.tar.bz2
re3-9e45feb4fa0a841b1d059bcab8507fd80708d6e7.tar.lz
re3-9e45feb4fa0a841b1d059bcab8507fd80708d6e7.tar.xz
re3-9e45feb4fa0a841b1d059bcab8507fd80708d6e7.tar.zst
re3-9e45feb4fa0a841b1d059bcab8507fd80708d6e7.zip
Diffstat (limited to 'src/render')
-rw-r--r--src/render/Renderer.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 92bbdd45..949f8c54 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -848,6 +848,37 @@ CRenderer::RequestObjectsInFrustum(void)
}
}
+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 (!bHasBlip && lightMult != 1.0f) {
+ SetAmbientAndDirectionalColours(lightMult);
+ return true;
+ }
+ }
+ return false;
+}
+
+void
+CPed::RemoveLighting(bool reset)
+{
+ CRenderer::RemoveVehiclePedLights(this, reset);
+}
+
float
CalcNewDelta(RwV2d *a, RwV2d *b)
{