1
0
forked from 0ad/0ad

New Year's clean-up.

Throw a warning if a invalid (not present) AI is specified in a map.
Replace the last occurences of jubot with qbot.
Exclude the common siege templates from the Units Demo map.
Fix an error with flying units.
Replace CFG_GET_SYS_VAL with CFG_GET_USER_VAL and rename it to
CFG_GET_VAL to reflect its behaviour better.
Fix linker error with clang 3.2. Refs 1588.
Remove some useless includes.

This was SVN commit r13031.
This commit is contained in:
leper 2013-01-01 18:33:53 +00:00
parent 4764af695a
commit 276f0a41a0
23 changed files with 135 additions and 139 deletions

View File

@ -21,8 +21,7 @@
windowed = false windowed = false
; Enable/disable the splashscreen ; Enable/disable the splashscreen
; Currently commented out in default.cfg because of a bug with writing configuration files splashscreenenable = true
;splashscreenenable = true
; Pause the game on window focus loss (Only applicable to single player mode) ; Pause the game on window focus loss (Only applicable to single player mode)
pauseonfocusloss = true pauseonfocusloss = true
@ -172,29 +171,29 @@ hotkey.silhouettes = "Alt+S" ; Toggle unit silhouettes
hotkey.showsky = "Alt+Z" ; Toggle sky hotkey.showsky = "Alt+Z" ; Toggle sky
; > CAMERA SETTINGS ; > CAMERA SETTINGS
hotkey.camera.reset = "H" ; Reset camera rotation to default. hotkey.camera.reset = "H" ; Reset camera rotation to default.
hotkey.camera.follow = "F" ; Follow the first unit in the selection hotkey.camera.follow = "F" ; Follow the first unit in the selection
hotkey.camera.zoom.in = Plus, Equals, NumPlus ; Zoom camera in (continuous control) hotkey.camera.zoom.in = Plus, Equals, NumPlus ; Zoom camera in (continuous control)
hotkey.camera.zoom.out = Minus, NumMinus ; Zoom camera out (continuous control) hotkey.camera.zoom.out = Minus, NumMinus ; Zoom camera out (continuous control)
hotkey.camera.zoom.wheel.in = WheelUp ; Zoom camera in (stepped control) hotkey.camera.zoom.wheel.in = WheelUp ; Zoom camera in (stepped control)
hotkey.camera.zoom.wheel.out = WheelDown ; Zoom camera out (stepped control) hotkey.camera.zoom.wheel.out = WheelDown ; Zoom camera out (stepped control)
hotkey.camera.rotate.up = "Ctrl+UpArrow", "Ctrl+W" ; Rotate camera to look upwards hotkey.camera.rotate.up = "Ctrl+UpArrow", "Ctrl+W" ; Rotate camera to look upwards
hotkey.camera.rotate.down = "Ctrl+DownArrow", "Ctrl+S" ; Rotate camera to look downwards hotkey.camera.rotate.down = "Ctrl+DownArrow", "Ctrl+S" ; Rotate camera to look downwards
hotkey.camera.rotate.cw = "Ctrl+LeftArrow", "Ctrl+A", Q ; Rotate camera clockwise around terrain hotkey.camera.rotate.cw = "Ctrl+LeftArrow", "Ctrl+A", Q ; Rotate camera clockwise around terrain
hotkey.camera.rotate.ccw = "Ctrl+RightArrow", "Ctrl+D", E ; Rotate camera anticlockwise around terrain hotkey.camera.rotate.ccw = "Ctrl+RightArrow", "Ctrl+D", E ; Rotate camera anticlockwise around terrain
hotkey.camera.rotate.wheel.cw = "Shift+WheelUp", MouseX1 ; Rotate camera clockwise around terrain (stepped control) hotkey.camera.rotate.wheel.cw = "Shift+WheelUp", MouseX1 ; Rotate camera clockwise around terrain (stepped control)
hotkey.camera.rotate.wheel.ccw = "Shift+WheelDown", MouseX2 ; Rotate camera anticlockwise around terrain (stepped control) hotkey.camera.rotate.wheel.ccw = "Shift+WheelDown", MouseX2 ; Rotate camera anticlockwise around terrain (stepped control)
hotkey.camera.pan = MouseMiddle, ForwardSlash ; Enable scrolling by moving mouse hotkey.camera.pan = MouseMiddle, ForwardSlash ; Enable scrolling by moving mouse
hotkey.camera.left = A, LeftArrow ; Scroll or rotate left hotkey.camera.left = A, LeftArrow ; Scroll or rotate left
hotkey.camera.right = D, RightArrow ; Scroll or rotate right hotkey.camera.right = D, RightArrow ; Scroll or rotate right
hotkey.camera.up = W, UpArrow ; Scroll or rotate up/forwards hotkey.camera.up = W, UpArrow ; Scroll or rotate up/forwards
hotkey.camera.down = S, DownArrow ; Scroll or rotate down/backwards hotkey.camera.down = S, DownArrow ; Scroll or rotate down/backwards
hotkey.camera.scroll.speed.increase = "Ctrl+Shift+S" ; Increase scroll speed hotkey.camera.scroll.speed.increase = "Ctrl+Shift+S" ; Increase scroll speed
hotkey.camera.scroll.speed.decrease = "Ctrl+Alt+S" ; Decrease scroll speed hotkey.camera.scroll.speed.decrease = "Ctrl+Alt+S" ; Decrease scroll speed
hotkey.camera.rotate.speed.increase = "Ctrl+Shift+R" ; Increase rotation speed hotkey.camera.rotate.speed.increase = "Ctrl+Shift+R" ; Increase rotation speed
hotkey.camera.rotate.speed.decrease = "Ctrl+Alt+R" ; Decrease rotation speed hotkey.camera.rotate.speed.decrease = "Ctrl+Alt+R" ; Decrease rotation speed
hotkey.camera.zoom.speed.increase = "Ctrl+Shift+Z" ; Increase zoom speed hotkey.camera.zoom.speed.increase = "Ctrl+Shift+Z" ; Increase zoom speed
hotkey.camera.zoom.speed.decrease = "Ctrl+Alt+Z" ; Decrease zoom speed hotkey.camera.zoom.speed.decrease = "Ctrl+Alt+Z" ; Decrease zoom speed
; > CONSOLE SETTINGS ; > CONSOLE SETTINGS
hotkey.console.toggle = BackQuote, F9 ; Open/close console hotkey.console.toggle = BackQuote, F9 ; Open/close console

View File

@ -1202,12 +1202,15 @@ function updatePlayerList()
var aiId = g_GameAttributes.settings.PlayerData[playerSlot].AI; var aiId = g_GameAttributes.settings.PlayerData[playerSlot].AI;
if (aiId) if (aiId)
{ {
selection = aiAssignments[aiId]; // Check for a valid AI
if (aiId in aiAssignments)
selection = aiAssignments[aiId];
else
warn("AI \""+aiId+"\" not present. Defaulting to unassigned.");
} }
else
{ if (!selection)
selection = noAssignment; selection = noAssignment;
}
// Since no human is assigned, show the AI config button // Since no human is assigned, show the AI config button
if (g_IsController) if (g_IsController)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -189,6 +189,11 @@ UnitMotionFlying.prototype.GetRunSpeed = function()
return this.GetWalkSpeed(); return this.GetWalkSpeed();
}; };
UnitMotionFlying.prototype.GetCurrentSpeed = function()
{
return this.speed;
}
UnitMotionFlying.prototype.FaceTowardsPoint = function(x, z) UnitMotionFlying.prototype.FaceTowardsPoint = function(x, z)
{ {
// Ignore this - angle is controlled by the target-seeking code instead // Ignore this - angle is controlled by the target-seeking code instead

View File

@ -414,44 +414,44 @@ void CGameViewImpl::ScriptingInit()
int CGameView::Initialize() int CGameView::Initialize()
{ {
CFG_GET_SYS_VAL("view.scroll.speed", Float, m->ViewScrollSpeed); CFG_GET_VAL("view.scroll.speed", Float, m->ViewScrollSpeed);
CFG_GET_SYS_VAL("view.scroll.speed.modifier", Float, m->ViewScrollSpeedModifier); CFG_GET_VAL("view.scroll.speed.modifier", Float, m->ViewScrollSpeedModifier);
CFG_GET_SYS_VAL("view.rotate.x.speed", Float, m->ViewRotateXSpeed); CFG_GET_VAL("view.rotate.x.speed", Float, m->ViewRotateXSpeed);
CFG_GET_SYS_VAL("view.rotate.x.min", Float, m->ViewRotateXMin); CFG_GET_VAL("view.rotate.x.min", Float, m->ViewRotateXMin);
CFG_GET_SYS_VAL("view.rotate.x.max", Float, m->ViewRotateXMax); CFG_GET_VAL("view.rotate.x.max", Float, m->ViewRotateXMax);
CFG_GET_SYS_VAL("view.rotate.x.default", Float, m->ViewRotateXDefault); CFG_GET_VAL("view.rotate.x.default", Float, m->ViewRotateXDefault);
CFG_GET_SYS_VAL("view.rotate.y.speed", Float, m->ViewRotateYSpeed); CFG_GET_VAL("view.rotate.y.speed", Float, m->ViewRotateYSpeed);
CFG_GET_SYS_VAL("view.rotate.y.speed.wheel", Float, m->ViewRotateYSpeedWheel); CFG_GET_VAL("view.rotate.y.speed.wheel", Float, m->ViewRotateYSpeedWheel);
CFG_GET_SYS_VAL("view.rotate.y.default", Float, m->ViewRotateYDefault); CFG_GET_VAL("view.rotate.y.default", Float, m->ViewRotateYDefault);
CFG_GET_SYS_VAL("view.rotate.speed.modifier", Float, m->ViewRotateSpeedModifier); CFG_GET_VAL("view.rotate.speed.modifier", Float, m->ViewRotateSpeedModifier);
CFG_GET_SYS_VAL("view.drag.speed", Float, m->ViewDragSpeed); CFG_GET_VAL("view.drag.speed", Float, m->ViewDragSpeed);
CFG_GET_SYS_VAL("view.zoom.speed", Float, m->ViewZoomSpeed); CFG_GET_VAL("view.zoom.speed", Float, m->ViewZoomSpeed);
CFG_GET_SYS_VAL("view.zoom.speed.wheel", Float, m->ViewZoomSpeedWheel); CFG_GET_VAL("view.zoom.speed.wheel", Float, m->ViewZoomSpeedWheel);
CFG_GET_SYS_VAL("view.zoom.min", Float, m->ViewZoomMin); CFG_GET_VAL("view.zoom.min", Float, m->ViewZoomMin);
CFG_GET_SYS_VAL("view.zoom.max", Float, m->ViewZoomMax); CFG_GET_VAL("view.zoom.max", Float, m->ViewZoomMax);
CFG_GET_SYS_VAL("view.zoom.default", Float, m->ViewZoomDefault); CFG_GET_VAL("view.zoom.default", Float, m->ViewZoomDefault);
CFG_GET_SYS_VAL("view.zoom.speed.modifier", Float, m->ViewZoomSpeedModifier); CFG_GET_VAL("view.zoom.speed.modifier", Float, m->ViewZoomSpeedModifier);
CFG_GET_SYS_VAL("joystick.camera.pan.x", Int, m->JoystickPanX); CFG_GET_VAL("joystick.camera.pan.x", Int, m->JoystickPanX);
CFG_GET_SYS_VAL("joystick.camera.pan.y", Int, m->JoystickPanY); CFG_GET_VAL("joystick.camera.pan.y", Int, m->JoystickPanY);
CFG_GET_SYS_VAL("joystick.camera.rotate.x", Int, m->JoystickRotateX); CFG_GET_VAL("joystick.camera.rotate.x", Int, m->JoystickRotateX);
CFG_GET_SYS_VAL("joystick.camera.rotate.y", Int, m->JoystickRotateY); CFG_GET_VAL("joystick.camera.rotate.y", Int, m->JoystickRotateY);
CFG_GET_SYS_VAL("joystick.camera.zoom.in", Int, m->JoystickZoomIn); CFG_GET_VAL("joystick.camera.zoom.in", Int, m->JoystickZoomIn);
CFG_GET_SYS_VAL("joystick.camera.zoom.out", Int, m->JoystickZoomOut); CFG_GET_VAL("joystick.camera.zoom.out", Int, m->JoystickZoomOut);
CFG_GET_SYS_VAL("view.height.smoothness", Float, m->HeightSmoothness); CFG_GET_VAL("view.height.smoothness", Float, m->HeightSmoothness);
CFG_GET_SYS_VAL("view.height.min", Float, m->HeightMin); CFG_GET_VAL("view.height.min", Float, m->HeightMin);
CFG_GET_SYS_VAL("view.pos.smoothness", Float, m->PosX.m_Smoothness); CFG_GET_VAL("view.pos.smoothness", Float, m->PosX.m_Smoothness);
CFG_GET_SYS_VAL("view.pos.smoothness", Float, m->PosY.m_Smoothness); CFG_GET_VAL("view.pos.smoothness", Float, m->PosY.m_Smoothness);
CFG_GET_SYS_VAL("view.pos.smoothness", Float, m->PosZ.m_Smoothness); CFG_GET_VAL("view.pos.smoothness", Float, m->PosZ.m_Smoothness);
CFG_GET_SYS_VAL("view.zoom.smoothness", Float, m->Zoom.m_Smoothness); CFG_GET_VAL("view.zoom.smoothness", Float, m->Zoom.m_Smoothness);
CFG_GET_SYS_VAL("view.rotate.x.smoothness", Float, m->RotateX.m_Smoothness); CFG_GET_VAL("view.rotate.x.smoothness", Float, m->RotateX.m_Smoothness);
CFG_GET_SYS_VAL("view.rotate.y.smoothness", Float, m->RotateY.m_Smoothness); CFG_GET_VAL("view.rotate.y.smoothness", Float, m->RotateY.m_Smoothness);
CFG_GET_SYS_VAL("view.near", Float, m->ViewNear); CFG_GET_VAL("view.near", Float, m->ViewNear);
CFG_GET_SYS_VAL("view.far", Float, m->ViewFar); CFG_GET_VAL("view.far", Float, m->ViewFar);
CFG_GET_SYS_VAL("view.fov", Float, m->ViewFOV); CFG_GET_VAL("view.fov", Float, m->ViewFOV);
// Convert to radians // Convert to radians
m->RotateX.SetValue(DEGTORAD(m->ViewRotateXDefault)); m->RotateX.SetValue(DEGTORAD(m->ViewRotateXDefault));

View File

@ -33,7 +33,7 @@
CMaterialManager::CMaterialManager() CMaterialManager::CMaterialManager()
{ {
qualityLevel = 5.0; qualityLevel = 5.0;
CFG_GET_USER_VAL("materialmgr.quality", Float, qualityLevel); CFG_GET_VAL("materialmgr.quality", Float, qualityLevel);
qualityLevel = clamp(qualityLevel, 0.0f, 10.0f); qualityLevel = clamp(qualityLevel, 0.0f, 10.0f);
} }
@ -133,8 +133,8 @@ CMaterial CMaterialManager::LoadMaterial(const VfsPath& pathname)
CStr conf = attrs.GetNamedItem(at_conf); CStr conf = attrs.GetNamedItem(at_conf);
if (!conf.empty()) if (!conf.empty())
{ {
CFG_GET_USER_VAL("materialmgr." + conf + ".min", Float, valmin); CFG_GET_VAL("materialmgr." + conf + ".min", Float, valmin);
CFG_GET_USER_VAL("materialmgr." + conf + ".max", Float, valmax); CFG_GET_VAL("materialmgr." + conf + ".max", Float, valmax);
} }
else else
{ {

View File

@ -171,7 +171,7 @@ int GetPlayerID(void* UNUSED(cbdata))
std::wstring GetDefaultPlayerName(void* UNUSED(cbdata)) std::wstring GetDefaultPlayerName(void* UNUSED(cbdata))
{ {
CStr playername; CStr playername;
CFG_GET_USER_VAL("playername", String, playername); CFG_GET_VAL("playername", String, playername);
std::wstring name = playername.FromUTF8(); std::wstring name = playername.FromUTF8();
if (!name.empty()) if (!name.empty())
return name; return name;
@ -186,7 +186,7 @@ std::wstring GetDefaultPlayerName(void* UNUSED(cbdata))
std::wstring GetDefaultMPServer(void* UNUSED(cbdata)) std::wstring GetDefaultMPServer(void* UNUSED(cbdata))
{ {
CStr server; CStr server;
CFG_GET_USER_VAL("multiplayerserver", String, server); CFG_GET_VAL("multiplayerserver", String, server);
return server.FromUTF8(); return server.FromUTF8();
} }
@ -492,7 +492,7 @@ bool IsUserReportEnabled(void* UNUSED(cbdata))
bool IsSplashScreenEnabled(void* UNUSED(cbdata)) bool IsSplashScreenEnabled(void* UNUSED(cbdata))
{ {
bool splashScreenEnable = true; bool splashScreenEnable = true;
CFG_GET_USER_VAL("splashscreenenable", Bool, splashScreenEnable); CFG_GET_VAL("splashscreenenable", Bool, splashScreenEnable);
return splashScreenEnable; return splashScreenEnable;
} }

View File

@ -122,7 +122,7 @@ typedef volatile intptr_t atomic_bool;
* debugging the symbol engine. * debugging the symbol engine.
* use 0 as the initial value to avoid allocating .rdata space. * use 0 as the initial value to avoid allocating .rdata space.
**/ **/
const atomic_bool DEBUG_SUPPRESS = 0xAB; static const atomic_bool DEBUG_SUPPRESS = 0xAB;
/** /**
* choices offered by the error dialog that are returned * choices offered by the error dialog that are returned

View File

@ -19,7 +19,6 @@
#include "CLogger.h" #include "CLogger.h"
#include "CConsole.h" #include "CConsole.h"
#include "ConfigDB.h"
#include "graphics/ShaderManager.h" #include "graphics/ShaderManager.h"
#include "graphics/TextRenderer.h" #include "graphics/TextRenderer.h"
#include "lib/ogl.h" #include "lib/ogl.h"
@ -48,8 +47,6 @@ static const size_t RENDER_LIMIT = 20; // maximum messages on screen at once
static const size_t BUFFER_SIZE = 1024; static const size_t BUFFER_SIZE = 1024;
extern int g_xres, g_yres;
// Set up a default logger that throws everything away, because that's // Set up a default logger that throws everything away, because that's
// better than crashing. (This is particularly useful for unit tests which // better than crashing. (This is particularly useful for unit tests which
// don't care about any log output.) // don't care about any log output.)

View File

@ -169,13 +169,7 @@ public:
// stores the value of the given key into <destination>. this quasi-template // stores the value of the given key into <destination>. this quasi-template
// convenience wrapper on top of CConfigValue::Get* simplifies user code and // convenience wrapper on top of CConfigValue::Get* simplifies user code and
// avoids "assignment within condition expression" warnings. // avoids "assignment within condition expression" warnings.
#define CFG_GET_SYS_VAL(name, type, destination)\ #define CFG_GET_VAL(name, type, destination)\
STMT(\
CConfigValue* val = g_ConfigDB.GetValue(CFG_SYSTEM, name);\
if(val)\
val->Get##type(destination);\
)
#define CFG_GET_USER_VAL(name, type, destination)\
STMT(\ STMT(\
CConfigValue* val = g_ConfigDB.GetValue(CFG_USER, name);\ CConfigValue* val = g_ConfigDB.GetValue(CFG_USER, name);\
if(val)\ if(val)\

View File

@ -23,7 +23,6 @@
#include "lib/posix/posix_dlfcn.h" #include "lib/posix/posix_dlfcn.h"
#include "ps/CStr.h" #include "ps/CStr.h"
#include "ps/CLogger.h" #include "ps/CLogger.h"
#include "ps/GameSetup/Config.h"
#if OS_MACOSX #if OS_MACOSX
# include "lib/sysdep/os/osx/osx_bundle.h" # include "lib/sysdep/os/osx/osx_bundle.h"

View File

@ -20,7 +20,6 @@
#include "lib/res/graphics/unifont.h" #include "lib/res/graphics/unifont.h"
#include "ps/ConfigDB.h"
#include "ps/Filesystem.h" #include "ps/Filesystem.h"
#include "ps/CLogger.h" #include "ps/CLogger.h"

View File

@ -78,29 +78,29 @@ CStr g_AutostartMap = "";
// Fill in the globals from the config files. // Fill in the globals from the config files.
static void LoadGlobals() static void LoadGlobals()
{ {
CFG_GET_USER_VAL("vsync", Bool, g_VSync); CFG_GET_VAL("vsync", Bool, g_VSync);
CFG_GET_USER_VAL("nos3tc", Bool, g_NoGLS3TC); CFG_GET_VAL("nos3tc", Bool, g_NoGLS3TC);
CFG_GET_USER_VAL("noautomipmap", Bool, g_NoGLAutoMipmap); CFG_GET_VAL("noautomipmap", Bool, g_NoGLAutoMipmap);
CFG_GET_USER_VAL("novbo", Bool, g_NoGLVBO); CFG_GET_VAL("novbo", Bool, g_NoGLVBO);
CFG_GET_USER_VAL("pauseonfocusloss", Bool, g_PauseOnFocusLoss); CFG_GET_VAL("pauseonfocusloss", Bool, g_PauseOnFocusLoss);
CFG_GET_USER_VAL("shadows", Bool, g_Shadows); CFG_GET_VAL("shadows", Bool, g_Shadows);
CFG_GET_USER_VAL("shadowpcf", Bool, g_ShadowPCF); CFG_GET_VAL("shadowpcf", Bool, g_ShadowPCF);
CFG_GET_USER_VAL("waternormals",Bool, g_WaterNormal); CFG_GET_VAL("waternormals",Bool, g_WaterNormal);
CFG_GET_USER_VAL("waterrealdepth",Bool, g_WaterRealDepth); CFG_GET_VAL("waterrealdepth",Bool, g_WaterRealDepth);
CFG_GET_USER_VAL("waterfoam",Bool, g_WaterFoam); CFG_GET_VAL("waterfoam",Bool, g_WaterFoam);
CFG_GET_USER_VAL("watercoastalwaves",Bool, g_WaterCoastalWaves); CFG_GET_VAL("watercoastalwaves",Bool, g_WaterCoastalWaves);
if (g_WaterCoastalWaves && !g_WaterNormal) if (g_WaterCoastalWaves && !g_WaterNormal)
g_WaterCoastalWaves = false; g_WaterCoastalWaves = false;
CFG_GET_USER_VAL("waterrefraction",Bool, g_WaterRefraction); CFG_GET_VAL("waterrefraction",Bool, g_WaterRefraction);
CFG_GET_USER_VAL("waterreflection",Bool, g_WaterReflection); CFG_GET_VAL("waterreflection",Bool, g_WaterReflection);
CFG_GET_USER_VAL("watershadows",Bool, g_WaterShadows); CFG_GET_VAL("watershadows",Bool, g_WaterShadows);
CFG_GET_USER_VAL("renderpath", String, g_RenderPath); CFG_GET_VAL("renderpath", String, g_RenderPath);
CFG_GET_USER_VAL("particles", Bool, g_Particles); CFG_GET_VAL("particles", Bool, g_Particles);
CFG_GET_USER_VAL("silhouettes", Bool, g_Silhouettes); CFG_GET_VAL("silhouettes", Bool, g_Silhouettes);
CFG_GET_USER_VAL("showsky", Bool, g_ShowSky); CFG_GET_VAL("showsky", Bool, g_ShowSky);
#if CONFIG2_AUDIO #if CONFIG2_AUDIO
float gain = 0.5f; float gain = 0.5f;
@ -110,13 +110,13 @@ static void LoadGlobals()
int bufferCount = 50; int bufferCount = 50;
unsigned long bufferSize = 65536; unsigned long bufferSize = 65536;
CFG_GET_USER_VAL("sound.mastergain", Float, gain); CFG_GET_VAL("sound.mastergain", Float, gain);
CFG_GET_USER_VAL("sound.musicgain", Float, musicGain); CFG_GET_VAL("sound.musicgain", Float, musicGain);
CFG_GET_USER_VAL("sound.ambientgain", Float, ambientGain); CFG_GET_VAL("sound.ambientgain", Float, ambientGain);
CFG_GET_USER_VAL("sound.actiongain", Float, actionGain); CFG_GET_VAL("sound.actiongain", Float, actionGain);
CFG_GET_USER_VAL("sound.bufferCount", Int, bufferCount); CFG_GET_VAL("sound.bufferCount", Int, bufferCount);
CFG_GET_USER_VAL("sound.bufferSize", UnsignedLong, bufferSize); CFG_GET_VAL("sound.bufferSize", UnsignedLong, bufferSize);
if (g_SoundManager) { if (g_SoundManager) {
g_SoundManager->SetMasterGain(gain); g_SoundManager->SetMasterGain(gain);
@ -223,7 +223,7 @@ void CONFIG_Init(const CmdLineArgs& args)
// Initialise console history file // Initialise console history file
int max_history_lines = 200; int max_history_lines = 200;
CFG_GET_USER_VAL("console.history.size", Int, max_history_lines); CFG_GET_VAL("console.history.size", Int, max_history_lines);
g_Console->UseHistoryFile(L"config/console.txt", max_history_lines); g_Console->UseHistoryFile(L"config/console.txt", max_history_lines);
// Collect information from system.cfg, the profile file, // Collect information from system.cfg, the profile file,

View File

@ -202,7 +202,7 @@ void Render()
ogl_WarnIfError(); ogl_WarnIfError();
CStr skystring = "255 0 255"; CStr skystring = "255 0 255";
CFG_GET_USER_VAL("skycolor", String, skystring); CFG_GET_VAL("skycolor", String, skystring);
CColor skycol; CColor skycol;
GUI<CColor>::ParseString(skystring.FromUTF8(), skycol); GUI<CColor>::ParseString(skystring.FromUTF8(), skycol);
g_Renderer.SetClearColor(skycol.AsSColor4ub()); g_Renderer.SetClearColor(skycol.AsSColor4ub());
@ -269,7 +269,7 @@ void Render()
else else
{ {
bool forceGL = false; bool forceGL = false;
CFG_GET_USER_VAL("nohwcursor", Bool, forceGL); CFG_GET_VAL("nohwcursor", Bool, forceGL);
#if CONFIG2_GLES #if CONFIG2_GLES
#warning TODO: implement cursors for GLES #warning TODO: implement cursors for GLES
@ -892,7 +892,7 @@ void Init(const CmdLineArgs& args, int UNUSED(flags))
// Optionally start profiler HTTP output automatically // Optionally start profiler HTTP output automatically
// (By default it's only enabled by a hotkey, for security/performance) // (By default it's only enabled by a hotkey, for security/performance)
bool profilerHTTPEnable = false; bool profilerHTTPEnable = false;
CFG_GET_USER_VAL("profiler2.http.autoenable", Bool, profilerHTTPEnable); CFG_GET_VAL("profiler2.http.autoenable", Bool, profilerHTTPEnable);
if (profilerHTTPEnable) if (profilerHTTPEnable)
g_Profiler2.EnableHTTP(); g_Profiler2.EnableHTTP();
@ -930,7 +930,7 @@ void InitGraphics(const CmdLineArgs& args, int flags)
// Optionally start profiler GPU timings automatically // Optionally start profiler GPU timings automatically
// (By default it's only enabled by a hotkey, for performance/compatibility) // (By default it's only enabled by a hotkey, for performance/compatibility)
bool profilerGPUEnable = false; bool profilerGPUEnable = false;
CFG_GET_USER_VAL("profiler2.gpu.autoenable", Bool, profilerGPUEnable); CFG_GET_VAL("profiler2.gpu.autoenable", Bool, profilerGPUEnable);
if (profilerGPUEnable) if (profilerGPUEnable)
g_Profiler2.EnableGPU(); g_Profiler2.EnableGPU();

View File

@ -33,11 +33,11 @@ CJoystick::CJoystick() :
void CJoystick::Initialise() void CJoystick::Initialise()
{ {
bool joystickEnable = false; bool joystickEnable = false;
CFG_GET_USER_VAL("joystick.enable", Bool, joystickEnable); CFG_GET_VAL("joystick.enable", Bool, joystickEnable);
if (!joystickEnable) if (!joystickEnable)
return; return;
CFG_GET_USER_VAL("joystick.deadzone", Int, m_Deadzone); CFG_GET_VAL("joystick.deadzone", Int, m_Deadzone);
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0) if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0)
{ {

View File

@ -776,9 +776,9 @@ CProfiler2GPU::CProfiler2GPU(CProfiler2& profiler) :
bool enabledARB = false; bool enabledARB = false;
bool enabledEXT = false; bool enabledEXT = false;
bool enabledINTEL = false; bool enabledINTEL = false;
CFG_GET_USER_VAL("profiler2.gpu.arb.enable", Bool, enabledARB); CFG_GET_VAL("profiler2.gpu.arb.enable", Bool, enabledARB);
CFG_GET_USER_VAL("profiler2.gpu.ext.enable", Bool, enabledEXT); CFG_GET_VAL("profiler2.gpu.ext.enable", Bool, enabledEXT);
CFG_GET_USER_VAL("profiler2.gpu.intel.enable", Bool, enabledINTEL); CFG_GET_VAL("profiler2.gpu.intel.enable", Bool, enabledINTEL);
// Only enable either ARB or EXT, not both, because they are redundant // Only enable either ARB or EXT, not both, because they are redundant
// (EXT is only needed for compatibility with older systems), and because // (EXT is only needed for compatibility with older systems), and because

View File

@ -520,7 +520,7 @@ std::string CUserReporter::LoadUserID()
std::string userID; std::string userID;
// Read the user ID from user.cfg (if there is one) // Read the user ID from user.cfg (if there is one)
CFG_GET_USER_VAL("userreport.id", String, userID); CFG_GET_VAL("userreport.id", String, userID);
// If we don't have a validly-formatted user ID, generate a new one // If we don't have a validly-formatted user ID, generate a new one
if (userID.length() != 16) if (userID.length() != 16)
@ -547,7 +547,7 @@ std::string CUserReporter::LoadUserID()
bool CUserReporter::IsReportingEnabled() bool CUserReporter::IsReportingEnabled()
{ {
int version = -1; int version = -1;
CFG_GET_USER_VAL("userreport.enabledversion", Int, version); CFG_GET_VAL("userreport.enabledversion", Int, version);
return (version >= REPORTER_VERSION); return (version >= REPORTER_VERSION);
} }
@ -576,7 +576,7 @@ void CUserReporter::Initialize()
std::string userID = LoadUserID(); std::string userID = LoadUserID();
std::string url; std::string url;
CFG_GET_SYS_VAL("userreport.url", String, url); CFG_GET_VAL("userreport.url", String, url);
// Initialise everything except Win32 sockets (because our networking // Initialise everything except Win32 sockets (because our networking
// system already inits those) // system already inits those)

View File

@ -54,13 +54,13 @@ CVideoMode::CVideoMode() :
void CVideoMode::ReadConfig() void CVideoMode::ReadConfig()
{ {
bool windowed = !m_ConfigFullscreen; bool windowed = !m_ConfigFullscreen;
CFG_GET_USER_VAL("windowed", Bool, windowed); CFG_GET_VAL("windowed", Bool, windowed);
m_ConfigFullscreen = !windowed; m_ConfigFullscreen = !windowed;
CFG_GET_USER_VAL("xres", Int, m_ConfigW); CFG_GET_VAL("xres", Int, m_ConfigW);
CFG_GET_USER_VAL("yres", Int, m_ConfigH); CFG_GET_VAL("yres", Int, m_ConfigH);
CFG_GET_USER_VAL("bpp", Int, m_ConfigBPP); CFG_GET_VAL("bpp", Int, m_ConfigBPP);
CFG_GET_USER_VAL("force_s3tc_enable", Bool, m_ConfigForceS3TCEnable); CFG_GET_VAL("force_s3tc_enable", Bool, m_ConfigForceS3TCEnable);
} }
bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen) bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)

View File

@ -444,12 +444,12 @@ CRenderer::CRenderer()
m_Options.m_ShowSky = false; m_Options.m_ShowSky = false;
// TODO: be more consistent in use of the config system // TODO: be more consistent in use of the config system
CFG_GET_USER_VAL("preferglsl", Bool, m_Options.m_PreferGLSL); CFG_GET_VAL("preferglsl", Bool, m_Options.m_PreferGLSL);
CFG_GET_USER_VAL("forcealphatest", Bool, m_Options.m_ForceAlphaTest); CFG_GET_VAL("forcealphatest", Bool, m_Options.m_ForceAlphaTest);
CFG_GET_USER_VAL("gpuskinning", Bool, m_Options.m_GPUSkinning); CFG_GET_VAL("gpuskinning", Bool, m_Options.m_GPUSkinning);
CFG_GET_USER_VAL("gentangents", Bool, m_Options.m_GenTangents); CFG_GET_VAL("gentangents", Bool, m_Options.m_GenTangents);
CFG_GET_USER_VAL("smoothlos", Bool, m_Options.m_SmoothLOS); CFG_GET_VAL("smoothlos", Bool, m_Options.m_SmoothLOS);
CFG_GET_USER_VAL("postproc", Bool, m_Options.m_Postproc); CFG_GET_VAL("postproc", Bool, m_Options.m_Postproc);
#if CONFIG2_GLES #if CONFIG2_GLES
// Override config option since GLES only supports GLSL // Override config option since GLES only supports GLSL

View File

@ -72,8 +72,8 @@ public:
// Tests won't have config initialised // Tests won't have config initialised
if (CConfigDB::IsInitialised()) if (CConfigDB::IsInitialised())
{ {
CFG_GET_USER_VAL("ooslog", Bool, m_EnableOOSLog); CFG_GET_VAL("ooslog", Bool, m_EnableOOSLog);
CFG_GET_USER_VAL("serializationtest", Bool, m_EnableSerializationTest); CFG_GET_VAL("serializationtest", Bool, m_EnableSerializationTest);
} }
} }