From f02cf7e067ba8e3da510d9a7e01a4ca287080c73 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 24 Oct 2020 20:33:33 +0200 Subject: [PATCH] - fixed issues with fog setup and added missing fog to Exhumed's red palette. Foggy lookups should not attempt to calculate a fade ramp, that does not work if the color gets brighter with distance. Fixes #143 --- source/core/palette.cpp | 1 + source/exhumed/src/light.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/source/core/palette.cpp b/source/core/palette.cpp index 18a4d0682..eb8ae9d7a 100644 --- a/source/core/palette.cpp +++ b/source/core/palette.cpp @@ -142,6 +142,7 @@ void LookupTableInfo::postLoadTables(void) // Try to detect fullbright translations. Unfortunately this cannot be used to detect fade strength because of loss of color precision in the palette map. for (int j = 0; j < MAXPALOOKUPS; j++) { + if (tables[j].FadeColor) continue; auto lookup = tables[j].Shades; if (lookup.Len() > 0) { diff --git a/source/exhumed/src/light.cpp b/source/exhumed/src/light.cpp index 5ebbe88bb..a45af0319 100644 --- a/source/exhumed/src/light.cpp +++ b/source/exhumed/src/light.cpp @@ -84,6 +84,7 @@ int LoadPaletteLookups() lookups.tables[kPalTorch].ShadeFactor = lookups.tables[kPalTorch2].ShadeFactor = (numshades - 2) / 20.f; lookups.tables[kPalNoTorch].ShadeFactor = lookups.tables[kPalNoTorch2].ShadeFactor = (numshades - 2) / 4.f; lookups.tables[kPalBrite].ShadeFactor = lookups.tables[kPalBrite].ShadeFactor = (numshades - 2) / 128.f; + lookups.setFadeColor(kPalRedBrite, 255, 0, 0); }