diff --git a/include/light/light.hh b/include/light/light.hh index a79ac8c5..abe4f7e5 100644 --- a/include/light/light.hh +++ b/include/light/light.hh @@ -270,6 +270,8 @@ public: setting_bool spotlightautofalloff{this, "spotlightautofalloff", false, &worldspawn_group}; // mxd setting_int32 compilerstyle_start{ this, "compilerstyle_start", 32, &worldspawn_group}; // start index for switchable light styles, default 32 + setting_int32 compilerstyle_max{ + this, "compilerstyle_max", 64, &worldspawn_group}; // max index for switchable light styles, default 64 /* dirt */ setting_bool globalDirt{this, {"dirt", "dirty"}, false, diff --git a/light/entities.cc b/light/entities.cc index 01f26086..f4e62b0a 100644 --- a/light/entities.cc +++ b/light/entities.cc @@ -63,8 +63,6 @@ const char *light_t::classname() const static std::vector> lightstyleForTargetname; -#define MAX_SWITCHABLE_STYLES 64 - static entdict_t &WorldEnt() { if (entdicts.size() == 0 || entdicts.at(0).get("classname") != "worldspawn") { @@ -101,8 +99,8 @@ static int LightStyleForTargetname(const settings::worldspawn_keys &cfg, const s const int newStylenum = cfg.compilerstyle_start.value() + lightstyleForTargetname.size(); // check if full - if (newStylenum >= MAX_SWITCHABLE_STYLES) { - FError("Too many unique light targetnames (max={})\n", MAX_SWITCHABLE_STYLES); + if (newStylenum >= cfg.compilerstyle_max.value()) { + FError("Too many unique light targetnames (max={})\n", cfg.compilerstyle_max.value()); } lightstyleForTargetname.emplace_back(targetname, newStylenum); @@ -1197,7 +1195,7 @@ void WriteEntitiesToString(const settings::worldspawn_keys &cfg, mbsp_t *bsp) /* FIXME - why are we printing this here? */ logging::print("{} switchable light styles ({} max)\n", lightstyleForTargetname.size(), - MAX_SWITCHABLE_STYLES - cfg.compilerstyle_start.value()); + cfg.compilerstyle_max.value() - cfg.compilerstyle_start.value()); } /*