# Simplified local configuration changes.

default.cfg shouldn't be edited by normal users; local.cfg can be used
for any local tweaks.
Removed old profile files, since they add clutter and aren't useful yet.

This was SVN commit r6919.
This commit is contained in:
Ykkrosh 2009-06-23 17:48:34 +00:00
parent cf17fe13ce
commit ea29b5fac2
8 changed files with 46 additions and 32 deletions

View File

@ -1,17 +1,25 @@
; Profile settings
; Global Configuration Settings
;
; **************************************************************
; * DO NOT EDIT THIS FILE if you want personal customisations: *
; * create a filed called "local.cfg" instead, and copy into *
; * it the lines from this file that you want to change. *
; **************************************************************
; profile = default
; Profile selection
profile = default
; System settings:
nos3tc=false
noautomipmap=false
novbo=false
noframebufferobject=false
nos3tc = false
noautomipmap = false
novbo = false
noframebufferobject = false
shadows=true
vsync=false
fancywater=true
shadows = true
vsync = false
fancywater = true
; Specify the render path. This can be one of:
; default Automatically select one of the below, depending on system capabilities
@ -19,7 +27,7 @@ fancywater=true
; vertexshader Use vertex shaders for transform and lighting where possible
; Using 'fixed' instead of 'default' may work around some graphics-related problems,
; but will reduce performance when a modern graphics card is available.
renderpath=vertexshader
renderpath = vertexshader
; Adjusts how OpenGL calculates mipmap level of detail. 0.0f is the default (blurry) value.
; Lower values sharpen/extend, and higher values blur/decrease. Clamped at -3.0 to 3.0.
@ -27,15 +35,15 @@ renderpath=vertexshader
lodbias = -0.5
; Language selection: (currently "english" or "pseudogreek")
language=english
language = english
; Enable/disable windowed mode.
windowed=false
windowed = true
; You can specify these as well, but the default (keeping the current resolution) is
; probably best for most people.
xres = 1152
yres = 864
xres = 1024
yres = 768
; Font mappings:

View File

@ -1,3 +0,0 @@
; Settings in a profile config are used instead of the equivalent settings in the system.cfg file,
; but note that not some settings are only allowed to be specified in system.cfg, for security reasons.

View File

@ -1,3 +0,0 @@
; Settings in a profile config are used instead of the equivalent settings in the system.cfg file,
; but note that not some settings are only allowed to be specified in system.cfg, for security reasons.

View File

@ -1,3 +0,0 @@
; Settings in a profile config are used instead of the equivalent settings in the system.cfg file,
; but note that not some settings are only allowed to be specified in system.cfg, for security reasons.

View File

@ -1,3 +0,0 @@
; Settings in a profile config are used instead of the equivalent settings in the system.cfg file,
; but note that not some settings are only allowed to be specified in system.cfg, for security reasons.

View File

@ -186,6 +186,7 @@ namespace ConfigDB_JS
ConfigNamespace_JS::SetNamespace(cx, nsobj, _enum); \
debug_assert(JS_DefineProperty(cx, newObj, _propname, OBJECT_TO_JSVAL(nsobj), NULL, NULL, flags)); )
cfg_ns("default", CFG_DEFAULT);
cfg_ns("system", CFG_SYSTEM);
cfg_ns("user", CFG_USER);
cfg_ns("mod", CFG_MOD);
@ -224,7 +225,7 @@ CConfigValueSet *CConfigDB::GetValues(EConfigNamespace ns, const CStr& name )
if( it != m_Map[CFG_COMMAND].end() )
return &( it->second );
for( int search_ns = ns; search_ns >= CFG_SYSTEM; search_ns-- )
for( int search_ns = ns; search_ns >= 0; search_ns-- )
{
TConfigMap::iterator it = m_Map[search_ns].find(name);
if (it != m_Map[search_ns].end())
@ -272,12 +273,21 @@ bool CConfigDB::Reload(EConfigNamespace ns)
// Open file with VFS
shared_ptr<u8> buffer; size_t buflen;
{
LibError ret = g_VFS->LoadFile(m_ConfigFile[ns], buffer, buflen);
if(ret != INFO::OK)
// Handle missing files quietly
if (g_VFS->GetFileInfo(m_ConfigFile[ns], NULL) == ERR::VFS_FILE_NOT_FOUND)
{
LOG(CLogger::Error, LOG_CATEGORY, "vfs_load for \"%s\" failed: return was %lld", m_ConfigFile[ns].c_str(), ret);
LOG(CLogger::Warning, LOG_CATEGORY, "Cannot find config file \"%s\" - ignoring", m_ConfigFile[ns].c_str());
return false;
}
else
{
LibError ret = g_VFS->LoadFile(m_ConfigFile[ns], buffer, buflen);
if (ret != INFO::OK)
{
LOG(CLogger::Error, LOG_CATEGORY, "vfs_load for \"%s\" failed: return was %lld", m_ConfigFile[ns].c_str(), ret);
return false;
}
}
}
TConfigMap newMap;

View File

@ -32,6 +32,7 @@
g_ConfigDB.GetValue(CFG_SYSTEM, "foo");
mod: Ditto, but linked to CFG_MOD
user: Ditto, but linked to CFG_USER
default: Ditto, but linked to CFG_DEFAULT
g_ConfigDB Functions: None so far
@ -59,6 +60,7 @@
enum EConfigNamespace
{
CFG_DEFAULT,
CFG_SYSTEM,
CFG_MOD,
CFG_USER,

View File

@ -196,8 +196,14 @@ void CONFIG_Init(const CmdLineArgs& args)
new CConfigDB;
g_ConfigDB.SetConfigFile(CFG_SYSTEM, false, "config/system.cfg");
g_ConfigDB.Reload(CFG_SYSTEM); // 216ms
// Load the global, default config file
g_ConfigDB.SetConfigFile(CFG_DEFAULT, false, "config/default.cfg");
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, false, "config/local.cfg");
g_ConfigDB.Reload(CFG_SYSTEM);
g_ConfigDB.SetConfigFile(CFG_MOD, true, "config/mod.cfg");
// No point in reloading mod.cfg here - we haven't mounted mods yet