Changeset View
Standalone View
source/ps/GameSetup/Config.cpp
Show All 25 Lines | |||||
#include "ps/GameSetup/CmdLineArgs.h" | #include "ps/GameSetup/CmdLineArgs.h" | ||||
// (these variables are documented in the header.) | // (these variables are documented in the header.) | ||||
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_NoGLAutoMipmap = false; | |||||
bool g_NoGLVBO = false; | |||||
bool g_PauseOnFocusLoss = false; | bool g_PauseOnFocusLoss = false; | ||||
bool g_Shadows = false; | |||||
bool g_ShadowPCF = false; | |||||
bool g_WaterEffects = true; | |||||
bool g_WaterFancyEffects = false; | |||||
bool g_WaterRealDepth = false; | |||||
bool g_WaterRefraction = false; | |||||
bool g_WaterReflection = false; | |||||
bool g_WaterShadows = false; | |||||
bool g_Particles = false; | |||||
bool g_Fog = true; | |||||
bool g_Silhouettes = false; | |||||
bool g_ShowSky = false; | |||||
bool g_PreferGLSL = false; | |||||
bool g_PostProc = false; | |||||
bool g_SmoothLOS = false; | |||||
float g_Gamma = 1.0f; | float g_Gamma = 1.0f; | ||||
CStr g_RenderPath = "default"; | |||||
int g_xres, g_yres; | int g_xres, g_yres; | ||||
float g_GuiScale = 1.0f; | float g_GuiScale = 1.0f; | ||||
bool g_VSync = false; | bool g_VSync = false; | ||||
bool g_Quickstart = false; | bool g_Quickstart = false; | ||||
bool g_DisableAudio = false; | bool g_DisableAudio = false; | ||||
// flag to switch on drawing terrain overlays | // flag to switch on drawing terrain overlays | ||||
Show All 11 Lines | |||||
// config | // config | ||||
//---------------------------------------------------------------------------- | //---------------------------------------------------------------------------- | ||||
// 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("noautomipmap", g_NoGLAutoMipmap); | |||||
CFG_GET_VAL("novbo", g_NoGLVBO); | |||||
CFG_GET_VAL("pauseonfocusloss", g_PauseOnFocusLoss); | CFG_GET_VAL("pauseonfocusloss", g_PauseOnFocusLoss); | ||||
CFG_GET_VAL("shadows", g_Shadows); | |||||
CFG_GET_VAL("shadowpcf", g_ShadowPCF); | |||||
CFG_GET_VAL("watereffects", g_WaterEffects); | |||||
CFG_GET_VAL("waterfancyeffects", g_WaterFancyEffects); | |||||
CFG_GET_VAL("waterrealdepth", g_WaterRealDepth); | |||||
CFG_GET_VAL("waterrefraction", g_WaterRefraction); | |||||
CFG_GET_VAL("waterreflection", g_WaterReflection); | |||||
CFG_GET_VAL("watershadows", g_WaterShadows); | |||||
CFG_GET_VAL("renderpath", g_RenderPath); | |||||
CFG_GET_VAL("particles", g_Particles); | |||||
CFG_GET_VAL("fog", g_Fog); | |||||
CFG_GET_VAL("silhouettes", g_Silhouettes); | |||||
CFG_GET_VAL("showsky", g_ShowSky); | |||||
CFG_GET_VAL("preferglsl", g_PreferGLSL); | |||||
CFG_GET_VAL("postproc", g_PostProc); | |||||
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 | ||||
// be documented somewhere for users. | // be documented somewhere for users. | ||||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
TIMER(L"CONFIG_Init"); | TIMER(L"CONFIG_Init"); | ||||
new CConfigDB; | new CConfigDB; | ||||
// Load the global, default config file | // Load the global, default config file | ||||
g_ConfigDB.SetConfigFile(CFG_DEFAULT, L"config/default.cfg"); | g_ConfigDB.SetConfigFile(CFG_DEFAULT, L"config/default.cfg"); | ||||
g_ConfigDB.Reload(CFG_DEFAULT); // 216ms | g_ConfigDB.Reload(CFG_DEFAULT); // 216ms | ||||
// Try loading the local system config file (which doesn't exist by | |||||
// default) - this is designed as a way of letting developers edit the | |||||
// system config without accidentally committing their changes back to SVN. | |||||
g_ConfigDB.SetConfigFile(CFG_SYSTEM, L"config/local.cfg"); | |||||
g_ConfigDB.Reload(CFG_SYSTEM); | |||||
elexis: and here | |||||
Done Inline ActionsFor the record you validated the concept On Sep 2 2019, assuming that local.cfg is deemed "purposeless". I do think it's purposeless, though I do believe you're using it extensively. 'Voice ye' concern here, heterodox config user, or forever remain silent' I guess wraitii: For the record you validated the concept On Sep 2 2019, assuming that local.cfg is deemed… | |||||
Not Done Inline Actions(http://irclogs.wildfiregames.com/2019-09/2019-09-02-QuakeNet-%230ad-dev.log) I didn't say "purposeless", but I tried to discover the reasons (use cases) why it was added, and the unreported use cases which might have ocurred and then the implications on the code if one was to consider use cases. I guess most features are features that one user uses, you mean I'm the only one? I don't know, perhaps, I didn't survey. If there is a valid use case for the file then perhaps more people use it. Perhaps (actually certainly) it's advertized to the general user to use local.cfg and that's one part that should be changed if the file is removed. (Hint ^) Now where I look at my local.cfg and user.cfg, I remember one of the technical differences which are an unconsidered but perhaps considerable use case: code comments. local.cfg allows them, but user.cfg doesnt really support them because each time the game saves a config it overwrites the file without comments. I mentioned that one too on IRC, and I guess that 'feature' may still be dropped, if one wanted to, but one would have to drop it consciously and then under balance of pros and cons. Another difference is that user.cfg is written in alphabetic order, local.cfg is written in the order specified by the text editor. So it means the use case of saving per-user config values is covered by both local.cfg and user.cfg, therefore that use case does not grant reason for local.cfg's existence. And the other difference between user.cfg and local.cfg is allowing the user to store user config options with a text editor with code comments and arbitrary sorting order, which may be dropped if the author, reviewer and the users agree. Deleting local.cfg will make it impossible to keep config options commented and semantically grouped. Then again the part of grouping config options semantically is probably better fixed by providing categories to the options, for example renaming shadowquality to graphics.shadowquality would mean that its grouped with the other graphic options if sorted alphabetically. So it's probably ok to delete it and probably ok to keep it and also ok to create a multi-user config system and also probably ok to support comments etc. My actual questions are actually not answered, then again asking questions is not wanted by the community because it's time consuming (unfortunately it's necessary if one doesn't want to break stuff unintentionally). elexis: (http://irclogs.wildfiregames.com/2019-09/2019-09-02-QuakeNet-%230ad-dev.log)
I didn't say… | |||||
Done Inline Actions
Indeed, but as I said on IRC back then I doubt the usefulness of this "feature". I'm curious what "documentation" brings you here too, since the options are already documented. Keeping different user-cfg for different profiles, first is a feature we don't have (yet), and second can be done by just having several files and renaming appropriately. With that being said, I don't care much about CFG_SYSTEM, and I'm okay with keeping a CFG_LOCAL if you would prefer it so. My default stance is to delete what I see as a relic of the past. But I haven't done a survey either (and nor will I because honestly if we start doing surveys of people for these kind of changes we're never committing anything again), so I will rely on rather unique events of people saying "this breaks my flow, can you keep it in?" So yeah basically I'm asking you (and anybody else that cares to read this) if you want me to keep CFG_LOCAL (renamed from CFG_SYSTEM) or if I should proceed with deletion. wraitii: > Deleting local.cfg will make it impossible to keep config options commented and semantically… | |||||
Not Done Inline ActionsI wonder only about which parts of the code were accepted. elexis: I wonder only about which parts of the code were accepted.
I can adapt to a removed local.cfg. | |||||
Done Inline Actions
It doesn't because the feature has nothing that cannot be replaced via other means, and thus its usefulness is dictated only be the number of users. Oh, yes, I got that hint and then forgot about it, thanks for the reminder. In both cases this comes from years back, and we now have a much better settings page which imo makes local.cfg rather redundant.
Not much to wonder, is there? link mauve only accepted the "idea" and the general refactoring of the code. wraitii: > It requires a survey to make a statement about the number of users of a given feature, but it… | |||||
g_ConfigDB.SetConfigFile(CFG_USER, L"config/user.cfg"); | g_ConfigDB.SetConfigFile(CFG_USER, L"config/user.cfg"); | ||||
g_ConfigDB.Reload(CFG_USER); | g_ConfigDB.Reload(CFG_USER); | ||||
g_ConfigDB.SetConfigFile(CFG_MOD, L"config/mod.cfg"); | g_ConfigDB.SetConfigFile(CFG_MOD, L"config/mod.cfg"); | ||||
// No point in reloading mod.cfg here - we haven't mounted mods yet | // No point in reloading mod.cfg here - we haven't mounted mods yet | ||||
ProcessCommandLineArgs(args); | ProcessCommandLineArgs(args); | ||||
Show All 10 Lines |
and here