light: fix for -dirt not implying -minlight_dirt, -sunlight_dirt, -sunlight2_dirt
This commit is contained in:
parent
f4287e07e9
commit
18797f81c0
|
|
@ -388,6 +388,7 @@ extern char mapfilename[1024];
|
|||
|
||||
lockable_setting_t *FindSetting(std::string name);
|
||||
void SetGlobalSetting(std::string name, std::string value, bool cmdline);
|
||||
void FixupGlobalSettings(void);
|
||||
void GetFileSpace(byte **lightdata, byte **colordata, byte **deluxdata, int size);
|
||||
const modelinfo_t *ModelInfoForFace(const bsp2_t *bsp, int facenum);
|
||||
const vec_t *GetSurfaceVertexNormal(const bsp2_t *bsp, const bsp2_dface_t *f, const int v);
|
||||
|
|
|
|||
|
|
@ -864,6 +864,8 @@ LoadEntities(const globalconfig_t &cfg, const bsp2_t *bsp)
|
|||
for (const auto &epair : WorldEnt()) {
|
||||
SetGlobalSetting(epair.first, epair.second, false);
|
||||
}
|
||||
/* apply side effects of settings (in particular "dirt") */
|
||||
FixupGlobalSettings();
|
||||
|
||||
assert(all_lights.size() == 0);
|
||||
if (nolights) {
|
||||
|
|
|
|||
|
|
@ -110,6 +110,31 @@ void SetGlobalSetting(std::string name, std::string value, bool cmdline) {
|
|||
sd.setSetting(name, value, cmdline);
|
||||
}
|
||||
|
||||
void FixupGlobalSettings() {
|
||||
static bool once = false;
|
||||
assert(!once);
|
||||
once = true;
|
||||
|
||||
// NOTE: This is confusing.. Setting "dirt" "1" implies "minlight_dirt" "1"
|
||||
// (and sunlight_dir/sunlight2_dirt as well), unless those variables were
|
||||
// set by the user to "0".
|
||||
//
|
||||
// We can't just default "minlight_dirt" to "1" because that would enable
|
||||
// dirtmapping by default.
|
||||
|
||||
if (cfg_static.globalDirt.boolValue()) {
|
||||
if (!cfg_static.minlightDirt.isChanged()) {
|
||||
cfg_static.minlightDirt.setBoolValue(true);
|
||||
}
|
||||
if (!cfg_static.sunlight_dirt.isChanged()) {
|
||||
cfg_static.sunlight_dirt.setFloatValue(1);
|
||||
}
|
||||
if (!cfg_static.sunlight2_dirt.isChanged()) {
|
||||
cfg_static.sunlight2_dirt.setFloatValue(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
PrintOptionsSummary(void)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue