Wasn't even using MAX so changed to just a simple BOOST variable that can become a config.

This commit is contained in:
Zed A. Shaw 2025-02-25 01:29:14 -05:00
parent 5179709e3c
commit 9d49c6a30b
2 changed files with 4 additions and 3 deletions

View file

@ -37,12 +37,12 @@ namespace lighting {
} }
int LightRender::light_level(int strength, float distance, size_t x, size_t y) { int LightRender::light_level(int strength, float distance, size_t x, size_t y) {
int new_level = distance <= 1.0f ? strength : strength / sqrt(distance); int boosted = strength + BOOST;
int new_level = distance <= 1.0f ? boosted : boosted / sqrt(distance);
int cur_level = $lightmap[y][x]; int cur_level = $lightmap[y][x];
return cur_level < new_level ? new_level : cur_level; return cur_level < new_level ? new_level : cur_level;
} }
void LightRender::reset_light() { void LightRender::reset_light() {
matrix::assign($lightmap, lighting::MIN); matrix::assign($lightmap, lighting::MIN);
} }

View file

@ -10,8 +10,9 @@
namespace lighting { namespace lighting {
using components::LightSource; using components::LightSource;
// THESE ARE PERCENTAGES!
const int MIN = 20; const int MIN = 20;
const int MAX = 135; const int BOOST = 10;
class LightRender { class LightRender {
public: public: