Ticket #3737: initRenderer.patch

File initRenderer.patch, 3.5 KB (added by mimo, 8 years ago)

including elexis's comment

  • source/ps/ConfigDB.cpp

     
    189189    it->second[0] = value;
    190190}
    191191
     192void CConfigDB::SetValueBool(EConfigNamespace ns, const CStr& name, const bool value)
     193{
     194    CStr valueString = value ? "true" : "false";
     195    SetValueString(ns, name, valueString);
     196}
     197
    192198void CConfigDB::SetConfigFile(EConfigNamespace ns, const VfsPath& path)
    193199{
    194200    CHECK_NS(;);
  • source/ps/ConfigDB.h

     
    9696     * existed the value is replaced.
    9797     */
    9898    void SetValueString(EConfigNamespace ns, const CStr& name, const CStr& value);
     99
     100    void SetValueBool(EConfigNamespace ns, const CStr& name, const bool value);
    99101   
    100102    /**
    101103     * Set the path to the config file used to populate the specified namespace
  • source/ps/GameSetup/GameSetup.cpp

     
    605605    new CRenderer;
    606606
    607607    // set renderer options from command line options - NOVBO must be set before opening the renderer
     608    // and init them in the ConfigDB when needed
    608609    g_Renderer.SetOptionBool(CRenderer::OPT_NOVBO, g_NoGLVBO);
    609610    g_Renderer.SetOptionBool(CRenderer::OPT_SHADOWS, g_Shadows);
     611    g_ConfigDB.SetValueBool(CFG_SYSTEM, "shadows", g_Shadows);
    610612
    611613    g_Renderer.SetOptionBool(CRenderer::OPT_WATERUGLY, g_WaterUgly);
     614    g_ConfigDB.SetValueBool(CFG_SYSTEM, "waterugly", g_WaterUgly);
    612615    g_Renderer.SetOptionBool(CRenderer::OPT_WATERFANCYEFFECTS, g_WaterFancyEffects);
     616    g_ConfigDB.SetValueBool(CFG_SYSTEM, "waterfancyeffects", g_WaterFancyEffects);
    613617    g_Renderer.SetOptionBool(CRenderer::OPT_WATERREALDEPTH, g_WaterRealDepth);
     618    g_ConfigDB.SetValueBool(CFG_SYSTEM, "waterrealdepth", g_WaterRealDepth);
    614619    g_Renderer.SetOptionBool(CRenderer::OPT_WATERREFLECTION, g_WaterReflection);
     620    g_ConfigDB.SetValueBool(CFG_SYSTEM, "waterreflection", g_WaterReflection);
    615621    g_Renderer.SetOptionBool(CRenderer::OPT_WATERREFRACTION, g_WaterRefraction);
     622    g_ConfigDB.SetValueBool(CFG_SYSTEM, "waterrefraction", g_WaterRefraction);
    616623    g_Renderer.SetOptionBool(CRenderer::OPT_SHADOWSONWATER, g_WaterShadows);
     624    g_ConfigDB.SetValueBool(CFG_SYSTEM, "watershadows", g_WaterShadows);
    617625   
    618626    g_Renderer.SetRenderPath(CRenderer::GetRenderPathByName(g_RenderPath));
    619627    g_Renderer.SetOptionBool(CRenderer::OPT_SHADOWPCF, g_ShadowPCF);
     628    g_ConfigDB.SetValueBool(CFG_SYSTEM, "shadowpcf", g_ShadowPCF);
    620629    g_Renderer.SetOptionBool(CRenderer::OPT_PARTICLES, g_Particles);
     630    g_ConfigDB.SetValueBool(CFG_SYSTEM, "particles", g_Particles);
    621631    g_Renderer.SetOptionBool(CRenderer::OPT_SILHOUETTES, g_Silhouettes);
     632    g_ConfigDB.SetValueBool(CFG_SYSTEM, "silhouettes", g_Silhouettes);
    622633    g_Renderer.SetOptionBool(CRenderer::OPT_SHOWSKY, g_ShowSky);
     634    g_ConfigDB.SetValueBool(CFG_SYSTEM, "showsky", g_ShowSky);
    623635    g_Renderer.SetOptionBool(CRenderer::OPT_PREFERGLSL, g_PreferGLSL);
     636    g_ConfigDB.SetValueBool(CFG_SYSTEM, "preferglsl", g_PreferGLSL);
    624637    g_Renderer.SetOptionBool(CRenderer::OPT_POSTPROC, g_PostProc);
     638    g_ConfigDB.SetValueBool(CFG_SYSTEM, "postproc", g_PostProc);
    625639    g_Renderer.SetOptionBool(CRenderer::OPT_SMOOTHLOS, g_SmoothLOS);
     640    g_ConfigDB.SetValueBool(CFG_SYSTEM, "smoothlos", g_SmoothLOS);
    626641
    627642    // create terrain related stuff
    628643    new CTerrainTextureManager;