1
0
forked from 0ad/0ad

init configDB with renderer initial values, refs #3737

This was SVN commit r17737.
This commit is contained in:
mimo 2016-02-07 11:24:09 +00:00
parent a2f7d4d82a
commit 26f7a3df96
3 changed files with 23 additions and 0 deletions

View File

@ -189,6 +189,12 @@ void CConfigDB::SetValueString(EConfigNamespace ns, const CStr& name, const CStr
it->second[0] = value; it->second[0] = value;
} }
void CConfigDB::SetValueBool(EConfigNamespace ns, const CStr& name, const bool value)
{
CStr valueString = value ? "true" : "false";
SetValueString(ns, name, valueString);
}
void CConfigDB::SetConfigFile(EConfigNamespace ns, const VfsPath& path) void CConfigDB::SetConfigFile(EConfigNamespace ns, const VfsPath& path)
{ {
CHECK_NS(;); CHECK_NS(;);

View File

@ -96,6 +96,8 @@ public:
* existed the value is replaced. * existed the value is replaced.
*/ */
void SetValueString(EConfigNamespace ns, const CStr& name, const CStr& value); void SetValueString(EConfigNamespace ns, const CStr& name, const CStr& value);
void SetValueBool(EConfigNamespace ns, const CStr& name, const bool value);
/** /**
* Set the path to the config file used to populate the specified namespace * Set the path to the config file used to populate the specified namespace

View File

@ -605,24 +605,39 @@ static void InitRenderer()
new CRenderer; new CRenderer;
// set renderer options from command line options - NOVBO must be set before opening the renderer // set renderer options from command line options - NOVBO must be set before opening the renderer
// and init them in the ConfigDB when needed
g_Renderer.SetOptionBool(CRenderer::OPT_NOVBO, g_NoGLVBO); g_Renderer.SetOptionBool(CRenderer::OPT_NOVBO, g_NoGLVBO);
g_Renderer.SetOptionBool(CRenderer::OPT_SHADOWS, g_Shadows); g_Renderer.SetOptionBool(CRenderer::OPT_SHADOWS, g_Shadows);
g_ConfigDB.SetValueBool(CFG_SYSTEM, "shadows", g_Shadows);
g_Renderer.SetOptionBool(CRenderer::OPT_WATERUGLY, g_WaterUgly); g_Renderer.SetOptionBool(CRenderer::OPT_WATERUGLY, g_WaterUgly);
g_ConfigDB.SetValueBool(CFG_SYSTEM, "waterugly", g_WaterUgly);
g_Renderer.SetOptionBool(CRenderer::OPT_WATERFANCYEFFECTS, g_WaterFancyEffects); g_Renderer.SetOptionBool(CRenderer::OPT_WATERFANCYEFFECTS, g_WaterFancyEffects);
g_ConfigDB.SetValueBool(CFG_SYSTEM, "waterfancyeffects", g_WaterFancyEffects);
g_Renderer.SetOptionBool(CRenderer::OPT_WATERREALDEPTH, g_WaterRealDepth); g_Renderer.SetOptionBool(CRenderer::OPT_WATERREALDEPTH, g_WaterRealDepth);
g_ConfigDB.SetValueBool(CFG_SYSTEM, "waterrealdepth", g_WaterRealDepth);
g_Renderer.SetOptionBool(CRenderer::OPT_WATERREFLECTION, g_WaterReflection); g_Renderer.SetOptionBool(CRenderer::OPT_WATERREFLECTION, g_WaterReflection);
g_ConfigDB.SetValueBool(CFG_SYSTEM, "waterreflection", g_WaterReflection);
g_Renderer.SetOptionBool(CRenderer::OPT_WATERREFRACTION, g_WaterRefraction); g_Renderer.SetOptionBool(CRenderer::OPT_WATERREFRACTION, g_WaterRefraction);
g_ConfigDB.SetValueBool(CFG_SYSTEM, "waterrefraction", g_WaterRefraction);
g_Renderer.SetOptionBool(CRenderer::OPT_SHADOWSONWATER, g_WaterShadows); g_Renderer.SetOptionBool(CRenderer::OPT_SHADOWSONWATER, g_WaterShadows);
g_ConfigDB.SetValueBool(CFG_SYSTEM, "watershadows", g_WaterShadows);
g_Renderer.SetRenderPath(CRenderer::GetRenderPathByName(g_RenderPath)); g_Renderer.SetRenderPath(CRenderer::GetRenderPathByName(g_RenderPath));
g_Renderer.SetOptionBool(CRenderer::OPT_SHADOWPCF, g_ShadowPCF); g_Renderer.SetOptionBool(CRenderer::OPT_SHADOWPCF, g_ShadowPCF);
g_ConfigDB.SetValueBool(CFG_SYSTEM, "shadowpcf", g_ShadowPCF);
g_Renderer.SetOptionBool(CRenderer::OPT_PARTICLES, g_Particles); g_Renderer.SetOptionBool(CRenderer::OPT_PARTICLES, g_Particles);
g_ConfigDB.SetValueBool(CFG_SYSTEM, "particles", g_Particles);
g_Renderer.SetOptionBool(CRenderer::OPT_SILHOUETTES, g_Silhouettes); g_Renderer.SetOptionBool(CRenderer::OPT_SILHOUETTES, g_Silhouettes);
g_ConfigDB.SetValueBool(CFG_SYSTEM, "silhouettes", g_Silhouettes);
g_Renderer.SetOptionBool(CRenderer::OPT_SHOWSKY, g_ShowSky); g_Renderer.SetOptionBool(CRenderer::OPT_SHOWSKY, g_ShowSky);
g_ConfigDB.SetValueBool(CFG_SYSTEM, "showsky", g_ShowSky);
g_Renderer.SetOptionBool(CRenderer::OPT_PREFERGLSL, g_PreferGLSL); g_Renderer.SetOptionBool(CRenderer::OPT_PREFERGLSL, g_PreferGLSL);
g_ConfigDB.SetValueBool(CFG_SYSTEM, "preferglsl", g_PreferGLSL);
g_Renderer.SetOptionBool(CRenderer::OPT_POSTPROC, g_PostProc); g_Renderer.SetOptionBool(CRenderer::OPT_POSTPROC, g_PostProc);
g_ConfigDB.SetValueBool(CFG_SYSTEM, "postproc", g_PostProc);
g_Renderer.SetOptionBool(CRenderer::OPT_SMOOTHLOS, g_SmoothLOS); g_Renderer.SetOptionBool(CRenderer::OPT_SMOOTHLOS, g_SmoothLOS);
g_ConfigDB.SetValueBool(CFG_SYSTEM, "smoothlos", g_SmoothLOS);
// create terrain related stuff // create terrain related stuff
new CTerrainTextureManager; new CTerrainTextureManager;