Skip to content

Commit

Permalink
configuration.cpp: Store / load new shadow settings
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Jul 15, 2023
1 parent 62ee485 commit 738bacc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,11 @@ bool loadConfig()
debug(LOG_WARNING, "Unsupported / invalid terrainShaderQuality value: %d; defaulting to: %d", intValue, static_cast<int>(getTerrainShaderQuality()));
}
}
war_setShadowFilterSize(iniGetInteger("shadowFilterSize", (int)war_getShadowFilterSize()).value());
if (auto value = iniGetIntegerOpt("shadowMapResolution"))
{
war_setShadowMapResolution(value.value());
}
ActivityManager::instance().endLoadingSettings();
return true;
}
Expand Down Expand Up @@ -774,6 +779,8 @@ bool saveConfig()
iniSetInteger("fogEnd", war_getFogEnd());
iniSetInteger("fogStart", war_getFogStart());
iniSetInteger("terrainShaderQuality", getTerrainShaderQuality());
iniSetInteger("shadowFilterSize", (int)war_getShadowFilterSize());
iniSetInteger("shadowMapResolution", (int)war_getShadowMapResolution());
iniSetInteger("configVersion", CURRCONFVERSION);

// write out ini file changes
Expand Down
2 changes: 1 addition & 1 deletion src/warzoneconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ void war_setShadowMapResolution(uint32_t resolution)
debug(LOG_ERROR, "Shadow map resolution %" PRIu32 " is unsupported: must be a power of 2", resolution);
return;
}
if (resolution < 2048 || resolution > 4096)
if (resolution > 0 && (resolution < 2048 || resolution > 4096)) // 0 is a special case that maps to "figure out a decent default for this system"
{
debug(LOG_INFO, "Shadow map resolution %" PRIu32 " may not have the desired effect", resolution);
}
Expand Down

0 comments on commit 738bacc

Please sign in to comment.