Files
Gleb Mazovetskiy 54e30ff210 light_render: Use an std::span for light tables
1. There is no need to store the light table width as it is always 256.
2. Use a fixed-extent `std::span` rather than a pointer for readability.
   This should optimize to the exact same code.
2025-07-08 18:19:36 +01:00

20 lines
432 B
C++

#pragma once
#include <cstddef>
namespace devilution {
#define MAXLIGHTS 32
#define MAXVISION 4
#define NO_LIGHT -1
constexpr char LightsMax = 15;
/** @brief A light table maps palette indices, so its size is the same as the palette size. */
constexpr size_t LightTableSize = 256;
/** @brief Number of supported light levels */
constexpr size_t NumLightingLevels = LightsMax + 1;
} // namespace devilution