From b36709666b1c6cedb46c8ed79a0b80f6d3c09026 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 20 Apr 2023 21:39:35 +0200 Subject: [PATCH] Clean up Nest and Crypt modifications to the light table --- Source/lighting.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Source/lighting.cpp b/Source/lighting.cpp index a3e968a6f..26b3dd6d0 100644 --- a/Source/lighting.cpp +++ b/Source/lighting.cpp @@ -6,6 +6,7 @@ #include "lighting.h" #include +#include #include "automap.h" #include "diablo.h" @@ -438,19 +439,13 @@ void MakeLightTable() *tbl++ = 1; } tbl += 224; - } - if (IsAnyOf(leveltype, DTYPE_NEST, DTYPE_CRYPT)) { - tbl = LightTables[0].data(); - for (int i = 0; i < lights; i++) { - *tbl++ = 0; - for (int j = 1; j < 16; j++) - *tbl++ = j; - tbl += 240; } - *tbl++ = 0; - for (int j = 1; j < 16; j++) - *tbl++ = 1; - tbl += 240; + } else if (IsAnyOf(leveltype, DTYPE_NEST, DTYPE_CRYPT)) { + // Make the lava fully bright + for (auto &lightTable : LightTables) + std::iota(lightTable.begin(), lightTable.begin() + 16, 0); + LightTables[15][0] = 0; + std::fill_n(LightTables[15].begin() + 1, 15, 1); } LoadFileInMem("plrgfx\\infra.trn", InfravisionTable);