Changeset View
Changeset View
Standalone View
Standalone View
source/ps/GameSetup/Config.cpp
/* Copyright (C) 2017 Wildfire Games. | /* Copyright (C) 2018 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 20 Lines | |||||
const wchar_t g_DefaultCursor[] = L"default-arrow"; | const wchar_t g_DefaultCursor[] = L"default-arrow"; | ||||
CStrW g_CursorName = g_DefaultCursor; | CStrW g_CursorName = g_DefaultCursor; | ||||
bool g_NoGLS3TC = false; | bool g_NoGLS3TC = false; | ||||
bool g_NoGLAutoMipmap = false; | bool g_NoGLAutoMipmap = false; | ||||
bool g_NoGLVBO = false; | bool g_NoGLVBO = false; | ||||
bool g_PauseOnFocusLoss = false; | bool g_PauseGameOnFocusLoss = false; | ||||
bool g_PauseRendererOnFocusLoss = false; | |||||
bool g_RenderActors = true; | bool g_RenderActors = true; | ||||
bool g_Shadows = false; | bool g_Shadows = false; | ||||
bool g_ShadowPCF = false; | bool g_ShadowPCF = false; | ||||
bool g_WaterEffects = true; | bool g_WaterEffects = true; | ||||
bool g_WaterFancyEffects = false; | bool g_WaterFancyEffects = false; | ||||
Show All 40 Lines | |||||
// Fill in the globals from the config files. | // Fill in the globals from the config files. | ||||
static void LoadGlobals() | static void LoadGlobals() | ||||
{ | { | ||||
CFG_GET_VAL("vsync", g_VSync); | CFG_GET_VAL("vsync", g_VSync); | ||||
CFG_GET_VAL("nos3tc", g_NoGLS3TC); | CFG_GET_VAL("nos3tc", g_NoGLS3TC); | ||||
CFG_GET_VAL("noautomipmap", g_NoGLAutoMipmap); | CFG_GET_VAL("noautomipmap", g_NoGLAutoMipmap); | ||||
CFG_GET_VAL("novbo", g_NoGLVBO); | CFG_GET_VAL("novbo", g_NoGLVBO); | ||||
CFG_GET_VAL("pauseonfocusloss", g_PauseOnFocusLoss); | |||||
CFG_GET_VAL("pausegameonfocusloss", g_PauseGameOnFocusLoss); | |||||
CFG_GET_VAL("pauserendereronfocusloss", g_PauseRendererOnFocusLoss); | |||||
CFG_GET_VAL("renderactors", g_RenderActors); | CFG_GET_VAL("renderactors", g_RenderActors); | ||||
CFG_GET_VAL("shadows", g_Shadows); | CFG_GET_VAL("shadows", g_Shadows); | ||||
CFG_GET_VAL("shadowpcf", g_ShadowPCF); | CFG_GET_VAL("shadowpcf", g_ShadowPCF); | ||||
CFG_GET_VAL("watereffects", g_WaterEffects); | CFG_GET_VAL("watereffects", g_WaterEffects); | ||||
CFG_GET_VAL("waterfancyeffects", g_WaterFancyEffects); | CFG_GET_VAL("waterfancyeffects", g_WaterFancyEffects); | ||||
CFG_GET_VAL("waterrealdepth", g_WaterRealDepth); | CFG_GET_VAL("waterrealdepth", g_WaterRealDepth); | ||||
CFG_GET_VAL("waterrefraction", g_WaterRefraction); | CFG_GET_VAL("waterrefraction", g_WaterRefraction); | ||||
Show All 9 Lines | static void LoadGlobals() | ||||
CFG_GET_VAL("postproc", g_PostProc); | CFG_GET_VAL("postproc", g_PostProc); | ||||
CFG_GET_VAL("smoothlos", g_SmoothLOS); | CFG_GET_VAL("smoothlos", g_SmoothLOS); | ||||
CFG_GET_VAL("gui.scale", g_GuiScale); | CFG_GET_VAL("gui.scale", g_GuiScale); | ||||
} | } | ||||
static void ProcessCommandLineArgs(const CmdLineArgs& args) | static void ProcessCommandLineArgs(const CmdLineArgs& args) | ||||
{ | { | ||||
// TODO: all these options (and the ones processed elsewhere) should | // TODO: all these options (and the ones processed elsewhere) should | ||||
elexis: no new function for only 2 of 20 settings.
JSInterface_Renderer.cpp is the path every other… | |||||
// be documented somewhere for users. | // be documented somewhere for users. | ||||
// Handle "-conf=key:value" (potentially multiple times) | // Handle "-conf=key:value" (potentially multiple times) | ||||
std::vector<CStr> conf = args.GetMultiple("conf"); | std::vector<CStr> conf = args.GetMultiple("conf"); | ||||
for (size_t i = 0; i < conf.size(); ++i) | for (size_t i = 0; i < conf.size(); ++i) | ||||
{ | { | ||||
CStr name_value = conf[i]; | CStr name_value = conf[i]; | ||||
if (name_value.Find(':') != -1) | if (name_value.Find(':') != -1) | ||||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
no new function for only 2 of 20 settings.
JSInterface_Renderer.cpp is the path every other renderer option takes