From b44e54743b4023a59db38c35ca1c2228433f15b7 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Thu, 6 Apr 2023 15:55:06 +0200 Subject: [PATCH] Add sun direction and color to the lightmap lump --- src/lightmap/levelmesh.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lightmap/levelmesh.cpp b/src/lightmap/levelmesh.cpp index 7372f63..93d2e15 100644 --- a/src/lightmap/levelmesh.cpp +++ b/src/lightmap/levelmesh.cpp @@ -1176,7 +1176,7 @@ void LevelMesh::AddLightmapLump(FWadWriter& wadFile) } } - int version = 0; + int version = 1; int headerSize = 5 * sizeof(uint32_t) + 2 * sizeof(uint16_t); int surfacesSize = surfaces.size() * 5 * sizeof(uint32_t); int texCoordsSize = numTexCoords * 2 * sizeof(float); @@ -1194,8 +1194,13 @@ void LevelMesh::AddLightmapLump(FWadWriter& wadFile) lumpFile.Write16(textures.size()); lumpFile.Write32(numSurfaces); lumpFile.Write32(numTexCoords); - lumpFile.Write32(0); // old light probes list lumpFile.Write32(map->NumGLSubsectors); + lumpFile.WriteFloat(map->GetSunDirection().x); + lumpFile.WriteFloat(map->GetSunDirection().y); + lumpFile.WriteFloat(map->GetSunDirection().z); + lumpFile.WriteFloat(map->GetSunColor().r); + lumpFile.WriteFloat(map->GetSunColor().g); + lumpFile.WriteFloat(map->GetSunColor().b); // Write surfaces int coordOffsets = 0;