From 3443793f79874e1c7e2d3c7aba8df5d4b0dd7cb6 Mon Sep 17 00:00:00 2001 From: nashmuhandes Date: Sun, 24 Sep 2023 19:51:02 +0800 Subject: [PATCH] Rename "static lights" to "lightmap lights" to accurately reflect its usage. --- README.md | 6 +++--- src/level/doomdata.h | 6 +++--- src/level/level_light.cpp | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 075bdc6..70ab956 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # ZDRay baking utility for GZDoom ZDRay is a node and lightmap generator for GZDoom. ZDRay is intended as a drop-in replacement for zdbsp, with the additional feature -that it can also bake lights. Once ZDRay has processed the level WAD it is ready to be used by GZDoom. +that it can also bake lightmap lights. Once ZDRay has processed the level WAD it is ready to be used by GZDoom. ZDRay is based on zdbsp for the node generation and originally used dlight for the lightmap generation. Special thanks to Randi Heit, Samuel Villarreal, Christoph Oelckers and anyone else involved in creating or maintaining those tools. @@ -55,12 +55,12 @@ thing // ZDRayInfo (ZDRay properties for the map) lm_sampledistance = <int> (default: 16, map units each lightmap texel covers, must be in powers of two) } -thing // Static point light (Light color and distance properties use the same args as dynamic lights) +thing // Lightmap point light (Light color and distance properties use the same args as dynamic lights) { type = 9876; } -thing // Static spotlight (Light color, distance and angle properties use the same args as dynamic lights) +thing // Lightmap spotlight (Light color, distance and angle properties use the same args as dynamic lights) { type = 9881; } diff --git a/src/level/doomdata.h b/src/level/doomdata.h index ef9c6a4..6a82bb3 100644 --- a/src/level/doomdata.h +++ b/src/level/doomdata.h @@ -356,9 +356,9 @@ struct FloatVertex float y; }; -#define THING_POINTLIGHT_STATIC 9876 -#define THING_SPOTLIGHT_STATIC 9881 -#define THING_ZDRAYINFO 9890 +#define THING_POINTLIGHT_LM 9876 +#define THING_SPOTLIGHT_LM 9881 +#define THING_ZDRAYINFO 9890 struct ThingLight { diff --git a/src/level/level_light.cpp b/src/level/level_light.cpp index 463b8e3..86e4a3c 100644 --- a/src/level/level_light.cpp +++ b/src/level/level_light.cpp @@ -221,7 +221,7 @@ void FLevel::CreateLights() IntThing *thing = &Things[i]; // skip things that aren't actually static point lights or static spotlights - if (thing->type != THING_POINTLIGHT_STATIC && thing->type != THING_SPOTLIGHT_STATIC) + if (thing->type != THING_POINTLIGHT_LM && thing->type != THING_SPOTLIGHT_LM) continue; vec3 lightColor(0, 0, 0); @@ -232,14 +232,14 @@ void FLevel::CreateLights() // need to process point lights and spot lights differently due to their // inconsistent arg usage... - if (thing->type == THING_POINTLIGHT_STATIC) + if (thing->type == THING_POINTLIGHT_LM) { int r = thing->args[0]; int g = thing->args[1]; int b = thing->args[2]; lightColor = vec3(r / 255.0, g / 255.0, b / 255.0); } - else if (thing->type == THING_SPOTLIGHT_STATIC) + else if (thing->type == THING_SPOTLIGHT_LM) { auto rgb = (uint32_t)thing->args[0]; @@ -264,7 +264,7 @@ void FLevel::CreateLights() // this is known as "intensity" on dynamic lights (and in UDB) lightDistance = thing->args[3]; - // static light intensity (not to be confused with dynamic lights' intensity, which is actually static light distance + // lightmap light intensity (not to be confused with dynamic lights' intensity, which is actually lightmap light distance lightIntensity = thing->alpha; if (lightDistance > 0.0f && lightIntensity > 0.0f && lightColor != vec3(0, 0, 0))