summaryrefslogtreecommitdiffstats
path: root/src/renderer/PointLights.h
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-07-17 23:03:57 +0200
committerSergeanur <s.anureev@yandex.ua>2021-07-17 23:03:57 +0200
commitc937bdbfea8f522d14d7a41f24372bddf5bdafcc (patch)
treeeb8f97f6cf9fac31d7ab90388af232d51cc9c137 /src/renderer/PointLights.h
parentMerge pull request #1219 from withmorten/miami-ini (diff)
downloadre3-c937bdbfea8f522d14d7a41f24372bddf5bdafcc.tar
re3-c937bdbfea8f522d14d7a41f24372bddf5bdafcc.tar.gz
re3-c937bdbfea8f522d14d7a41f24372bddf5bdafcc.tar.bz2
re3-c937bdbfea8f522d14d7a41f24372bddf5bdafcc.tar.lz
re3-c937bdbfea8f522d14d7a41f24372bddf5bdafcc.tar.xz
re3-c937bdbfea8f522d14d7a41f24372bddf5bdafcc.tar.zst
re3-c937bdbfea8f522d14d7a41f24372bddf5bdafcc.zip
Diffstat (limited to 'src/renderer/PointLights.h')
-rw-r--r--src/renderer/PointLights.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/renderer/PointLights.h b/src/renderer/PointLights.h
new file mode 100644
index 00000000..827200b9
--- /dev/null
+++ b/src/renderer/PointLights.h
@@ -0,0 +1,50 @@
+#pragma once
+
+class CRegisteredPointLight
+{
+public:
+ CVector coors;
+ CVector dir;
+ float radius;
+ float red;
+ float green;
+ float blue;
+ int8 type;
+ int8 fogType;
+ bool castExtraShadows;
+};
+VALIDATE_SIZE(CRegisteredPointLight, 0x2C);
+
+class CPointLights
+{
+public:
+ static int16 NumLights;
+ static CRegisteredPointLight aLights[NUMPOINTLIGHTS];
+ static CVector aCachedMapReads[32];
+ static float aCachedMapReadResults[32];
+ static int32 NextCachedValue;
+
+ enum {
+ LIGHT_POINT,
+ LIGHT_DIRECTIONAL,
+ LIGHT_DARKEN, // no effects at all
+ // these have only fog, otherwise no difference?
+ // only used by CEntity::ProcessLightsForEntity it seems
+ // and there used together with fog type
+ LIGHT_FOGONLY_ALWAYS,
+ LIGHT_FOGONLY,
+ };
+ enum {
+ FOG_NONE,
+ FOG_NORMAL, // taken from Foggyness
+ FOG_ALWAYS
+ };
+
+ static void Init(void);
+ static void InitPerFrame(void);
+ static void AddLight(uint8 type, CVector coors, CVector dir, float radius, float red, float green, float blue, uint8 fogType, bool castExtraShadows);
+ static float GenerateLightsAffectingObject(Const CVector *objCoors);
+ static void RemoveLightsAffectingObject(void);
+ static void RenderFogEffect(void);
+ static bool ProcessVerticalLineUsingCache(CVector coors, float *groundZ);
+};