diff --git a/binaries/data/config/default.cfg b/binaries/data/config/default.cfg index 5cd11d94a5..93ed70e087 100644 --- a/binaries/data/config/default.cfg +++ b/binaries/data/config/default.cfg @@ -21,8 +21,7 @@ windowed = false ; 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) pauseonfocusloss = true @@ -172,29 +171,29 @@ hotkey.silhouettes = "Alt+S" ; Toggle unit silhouettes hotkey.showsky = "Alt+Z" ; Toggle sky ; > CAMERA SETTINGS -hotkey.camera.reset = "H" ; Reset camera rotation to default. -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.out = Minus, NumMinus ; Zoom camera out (continuous 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.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.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.reset = "H" ; Reset camera rotation to default. +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.out = Minus, NumMinus ; Zoom camera out (continuous 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.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.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.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.pan = MouseMiddle, ForwardSlash ; Enable scrolling by moving mouse -hotkey.camera.left = A, LeftArrow ; Scroll or rotate left -hotkey.camera.right = D, RightArrow ; Scroll or rotate right -hotkey.camera.up = W, UpArrow ; Scroll or rotate up/forwards -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.decrease = "Ctrl+Alt+S" ; Decrease scroll 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.zoom.speed.increase = "Ctrl+Shift+Z" ; Increase zoom speed -hotkey.camera.zoom.speed.decrease = "Ctrl+Alt+Z" ; Decrease zoom speed +hotkey.camera.pan = MouseMiddle, ForwardSlash ; Enable scrolling by moving mouse +hotkey.camera.left = A, LeftArrow ; Scroll or rotate left +hotkey.camera.right = D, RightArrow ; Scroll or rotate right +hotkey.camera.up = W, UpArrow ; Scroll or rotate up/forwards +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.decrease = "Ctrl+Alt+S" ; Decrease scroll 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.zoom.speed.increase = "Ctrl+Shift+Z" ; Increase zoom speed +hotkey.camera.zoom.speed.decrease = "Ctrl+Alt+Z" ; Decrease zoom speed ; > CONSOLE SETTINGS hotkey.console.toggle = BackQuote, F9 ; Open/close console diff --git a/binaries/data/mods/public/gui/gamesetup/gamesetup.js b/binaries/data/mods/public/gui/gamesetup/gamesetup.js index 4c9e078198..a73de46064 100644 --- a/binaries/data/mods/public/gui/gamesetup/gamesetup.js +++ b/binaries/data/mods/public/gui/gamesetup/gamesetup.js @@ -1202,12 +1202,15 @@ function updatePlayerList() var aiId = g_GameAttributes.settings.PlayerData[playerSlot].AI; 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; - } // Since no human is assigned, show the AI config button if (g_IsController) diff --git a/binaries/data/mods/public/maps/scenarios/Flight_demo.xml b/binaries/data/mods/public/maps/scenarios/Flight_demo.xml index 92403f2aed..bba6cbefcc 100644 --- a/binaries/data/mods/public/maps/scenarios/Flight_demo.xml +++ b/binaries/data/mods/public/maps/scenarios/Flight_demo.xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:132cd0d3ac1052b453a950a4827e46948e67d0f1a196b24dfc663db1c0ae0bda -size 3732 +oid sha256:2b16444f57a6577f48b706e58c31ba393ec04308d25663e3497c73fccbbd1c65 +size 3534 diff --git a/binaries/data/mods/public/maps/scenarios/Flight_demo_2.xml b/binaries/data/mods/public/maps/scenarios/Flight_demo_2.xml index 98e922f50b..b9da688e80 100644 --- a/binaries/data/mods/public/maps/scenarios/Flight_demo_2.xml +++ b/binaries/data/mods/public/maps/scenarios/Flight_demo_2.xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:27f9c44731caa6fae0d45f82de6c787651797ffb78f1e62b1dc41cfdc871cf50 -size 20297 +oid sha256:8bef4cea85100e776d01e735b5ee74d9e4c346e9e0939234ac3aaa72c9222e07 +size 20296 diff --git a/binaries/data/mods/public/maps/scenarios/Units_demo.xml b/binaries/data/mods/public/maps/scenarios/Units_demo.xml index b2213670b7..9d791c1896 100644 --- a/binaries/data/mods/public/maps/scenarios/Units_demo.xml +++ b/binaries/data/mods/public/maps/scenarios/Units_demo.xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4856ba8361bdf8da95fcb59e6d8740d5143f74d3bad9b091a404e557bf3c05cd -size 2539 +oid sha256:c7765239aa588569b9d82b18650152a670d952d62dc08d477000a20de25ce869 +size 2641 diff --git a/binaries/data/mods/public/maps/scenarios/Walls.xml b/binaries/data/mods/public/maps/scenarios/Walls.xml index 4d4d406ec0..2be97f0b83 100644 --- a/binaries/data/mods/public/maps/scenarios/Walls.xml +++ b/binaries/data/mods/public/maps/scenarios/Walls.xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9d57d3fb79670cfb359713d9cd41edf2a8cf31579fe09084a4ab94fea99c98a9 -size 218482 +oid sha256:d718eeee11f4e19b9f83972111fba31a9b18d69d2c18a6d96920a21e728d8c97 +size 218481 diff --git a/binaries/data/mods/public/simulation/components/UnitMotionFlying.js b/binaries/data/mods/public/simulation/components/UnitMotionFlying.js index b4743e6535..92551dcf1d 100644 --- a/binaries/data/mods/public/simulation/components/UnitMotionFlying.js +++ b/binaries/data/mods/public/simulation/components/UnitMotionFlying.js @@ -189,6 +189,11 @@ UnitMotionFlying.prototype.GetRunSpeed = function() return this.GetWalkSpeed(); }; +UnitMotionFlying.prototype.GetCurrentSpeed = function() +{ + return this.speed; +} + UnitMotionFlying.prototype.FaceTowardsPoint = function(x, z) { // Ignore this - angle is controlled by the target-seeking code instead diff --git a/source/graphics/GameView.cpp b/source/graphics/GameView.cpp index 41683ebe21..3790304b49 100644 --- a/source/graphics/GameView.cpp +++ b/source/graphics/GameView.cpp @@ -414,44 +414,44 @@ void CGameViewImpl::ScriptingInit() int CGameView::Initialize() { - CFG_GET_SYS_VAL("view.scroll.speed", Float, m->ViewScrollSpeed); - CFG_GET_SYS_VAL("view.scroll.speed.modifier", Float, m->ViewScrollSpeedModifier); - CFG_GET_SYS_VAL("view.rotate.x.speed", Float, m->ViewRotateXSpeed); - CFG_GET_SYS_VAL("view.rotate.x.min", Float, m->ViewRotateXMin); - CFG_GET_SYS_VAL("view.rotate.x.max", Float, m->ViewRotateXMax); - CFG_GET_SYS_VAL("view.rotate.x.default", Float, m->ViewRotateXDefault); - CFG_GET_SYS_VAL("view.rotate.y.speed", Float, m->ViewRotateYSpeed); - CFG_GET_SYS_VAL("view.rotate.y.speed.wheel", Float, m->ViewRotateYSpeedWheel); - CFG_GET_SYS_VAL("view.rotate.y.default", Float, m->ViewRotateYDefault); - CFG_GET_SYS_VAL("view.rotate.speed.modifier", Float, m->ViewRotateSpeedModifier); - CFG_GET_SYS_VAL("view.drag.speed", Float, m->ViewDragSpeed); - CFG_GET_SYS_VAL("view.zoom.speed", Float, m->ViewZoomSpeed); - CFG_GET_SYS_VAL("view.zoom.speed.wheel", Float, m->ViewZoomSpeedWheel); - CFG_GET_SYS_VAL("view.zoom.min", Float, m->ViewZoomMin); - CFG_GET_SYS_VAL("view.zoom.max", Float, m->ViewZoomMax); - CFG_GET_SYS_VAL("view.zoom.default", Float, m->ViewZoomDefault); - CFG_GET_SYS_VAL("view.zoom.speed.modifier", Float, m->ViewZoomSpeedModifier); + CFG_GET_VAL("view.scroll.speed", Float, m->ViewScrollSpeed); + CFG_GET_VAL("view.scroll.speed.modifier", Float, m->ViewScrollSpeedModifier); + CFG_GET_VAL("view.rotate.x.speed", Float, m->ViewRotateXSpeed); + CFG_GET_VAL("view.rotate.x.min", Float, m->ViewRotateXMin); + CFG_GET_VAL("view.rotate.x.max", Float, m->ViewRotateXMax); + CFG_GET_VAL("view.rotate.x.default", Float, m->ViewRotateXDefault); + CFG_GET_VAL("view.rotate.y.speed", Float, m->ViewRotateYSpeed); + CFG_GET_VAL("view.rotate.y.speed.wheel", Float, m->ViewRotateYSpeedWheel); + CFG_GET_VAL("view.rotate.y.default", Float, m->ViewRotateYDefault); + CFG_GET_VAL("view.rotate.speed.modifier", Float, m->ViewRotateSpeedModifier); + CFG_GET_VAL("view.drag.speed", Float, m->ViewDragSpeed); + CFG_GET_VAL("view.zoom.speed", Float, m->ViewZoomSpeed); + CFG_GET_VAL("view.zoom.speed.wheel", Float, m->ViewZoomSpeedWheel); + CFG_GET_VAL("view.zoom.min", Float, m->ViewZoomMin); + CFG_GET_VAL("view.zoom.max", Float, m->ViewZoomMax); + CFG_GET_VAL("view.zoom.default", Float, m->ViewZoomDefault); + CFG_GET_VAL("view.zoom.speed.modifier", Float, m->ViewZoomSpeedModifier); - CFG_GET_SYS_VAL("joystick.camera.pan.x", Int, m->JoystickPanX); - CFG_GET_SYS_VAL("joystick.camera.pan.y", Int, m->JoystickPanY); - CFG_GET_SYS_VAL("joystick.camera.rotate.x", Int, m->JoystickRotateX); - CFG_GET_SYS_VAL("joystick.camera.rotate.y", Int, m->JoystickRotateY); - CFG_GET_SYS_VAL("joystick.camera.zoom.in", Int, m->JoystickZoomIn); - CFG_GET_SYS_VAL("joystick.camera.zoom.out", Int, m->JoystickZoomOut); + CFG_GET_VAL("joystick.camera.pan.x", Int, m->JoystickPanX); + CFG_GET_VAL("joystick.camera.pan.y", Int, m->JoystickPanY); + CFG_GET_VAL("joystick.camera.rotate.x", Int, m->JoystickRotateX); + CFG_GET_VAL("joystick.camera.rotate.y", Int, m->JoystickRotateY); + CFG_GET_VAL("joystick.camera.zoom.in", Int, m->JoystickZoomIn); + CFG_GET_VAL("joystick.camera.zoom.out", Int, m->JoystickZoomOut); - CFG_GET_SYS_VAL("view.height.smoothness", Float, m->HeightSmoothness); - CFG_GET_SYS_VAL("view.height.min", Float, m->HeightMin); + CFG_GET_VAL("view.height.smoothness", Float, m->HeightSmoothness); + CFG_GET_VAL("view.height.min", Float, m->HeightMin); - CFG_GET_SYS_VAL("view.pos.smoothness", Float, m->PosX.m_Smoothness); - CFG_GET_SYS_VAL("view.pos.smoothness", Float, m->PosY.m_Smoothness); - CFG_GET_SYS_VAL("view.pos.smoothness", Float, m->PosZ.m_Smoothness); - CFG_GET_SYS_VAL("view.zoom.smoothness", Float, m->Zoom.m_Smoothness); - CFG_GET_SYS_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.pos.smoothness", Float, m->PosX.m_Smoothness); + CFG_GET_VAL("view.pos.smoothness", Float, m->PosY.m_Smoothness); + CFG_GET_VAL("view.pos.smoothness", Float, m->PosZ.m_Smoothness); + CFG_GET_VAL("view.zoom.smoothness", Float, m->Zoom.m_Smoothness); + CFG_GET_VAL("view.rotate.x.smoothness", Float, m->RotateX.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_SYS_VAL("view.far", Float, m->ViewFar); - CFG_GET_SYS_VAL("view.fov", Float, m->ViewFOV); + CFG_GET_VAL("view.near", Float, m->ViewNear); + CFG_GET_VAL("view.far", Float, m->ViewFar); + CFG_GET_VAL("view.fov", Float, m->ViewFOV); // Convert to radians m->RotateX.SetValue(DEGTORAD(m->ViewRotateXDefault)); diff --git a/source/graphics/MaterialManager.cpp b/source/graphics/MaterialManager.cpp index 21222987f9..5cebd6ce5c 100644 --- a/source/graphics/MaterialManager.cpp +++ b/source/graphics/MaterialManager.cpp @@ -33,7 +33,7 @@ CMaterialManager::CMaterialManager() { 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); } @@ -133,8 +133,8 @@ CMaterial CMaterialManager::LoadMaterial(const VfsPath& pathname) CStr conf = attrs.GetNamedItem(at_conf); if (!conf.empty()) { - CFG_GET_USER_VAL("materialmgr." + conf + ".min", Float, valmin); - CFG_GET_USER_VAL("materialmgr." + conf + ".max", Float, valmax); + CFG_GET_VAL("materialmgr." + conf + ".min", Float, valmin); + CFG_GET_VAL("materialmgr." + conf + ".max", Float, valmax); } else { diff --git a/source/gui/scripting/ScriptFunctions.cpp b/source/gui/scripting/ScriptFunctions.cpp index a7f96f8cff..29a3b65f6e 100644 --- a/source/gui/scripting/ScriptFunctions.cpp +++ b/source/gui/scripting/ScriptFunctions.cpp @@ -171,7 +171,7 @@ int GetPlayerID(void* UNUSED(cbdata)) std::wstring GetDefaultPlayerName(void* UNUSED(cbdata)) { CStr playername; - CFG_GET_USER_VAL("playername", String, playername); + CFG_GET_VAL("playername", String, playername); std::wstring name = playername.FromUTF8(); if (!name.empty()) return name; @@ -186,7 +186,7 @@ std::wstring GetDefaultPlayerName(void* UNUSED(cbdata)) std::wstring GetDefaultMPServer(void* UNUSED(cbdata)) { CStr server; - CFG_GET_USER_VAL("multiplayerserver", String, server); + CFG_GET_VAL("multiplayerserver", String, server); return server.FromUTF8(); } @@ -492,7 +492,7 @@ bool IsUserReportEnabled(void* UNUSED(cbdata)) bool IsSplashScreenEnabled(void* UNUSED(cbdata)) { bool splashScreenEnable = true; - CFG_GET_USER_VAL("splashscreenenable", Bool, splashScreenEnable); + CFG_GET_VAL("splashscreenenable", Bool, splashScreenEnable); return splashScreenEnable; } diff --git a/source/lib/debug.h b/source/lib/debug.h index aad2a1b171..9459da4375 100644 --- a/source/lib/debug.h +++ b/source/lib/debug.h @@ -122,7 +122,7 @@ typedef volatile intptr_t atomic_bool; * debugging the symbol engine. * 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 diff --git a/source/ps/CLogger.cpp b/source/ps/CLogger.cpp index ccedf75c6e..77a360639d 100644 --- a/source/ps/CLogger.cpp +++ b/source/ps/CLogger.cpp @@ -19,7 +19,6 @@ #include "CLogger.h" #include "CConsole.h" -#include "ConfigDB.h" #include "graphics/ShaderManager.h" #include "graphics/TextRenderer.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; -extern int g_xres, g_yres; - // Set up a default logger that throws everything away, because that's // better than crashing. (This is particularly useful for unit tests which // don't care about any log output.) diff --git a/source/ps/ConfigDB.h b/source/ps/ConfigDB.h index c98e6e29db..6d7cd8c4b6 100644 --- a/source/ps/ConfigDB.h +++ b/source/ps/ConfigDB.h @@ -169,13 +169,7 @@ public: // stores the value of the given key into . this quasi-template // convenience wrapper on top of CConfigValue::Get* simplifies user code and // avoids "assignment within condition expression" warnings. -#define CFG_GET_SYS_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)\ +#define CFG_GET_VAL(name, type, destination)\ STMT(\ CConfigValue* val = g_ConfigDB.GetValue(CFG_USER, name);\ if(val)\ diff --git a/source/ps/DllLoader.cpp b/source/ps/DllLoader.cpp index 280e2d89f3..4a68cc900f 100644 --- a/source/ps/DllLoader.cpp +++ b/source/ps/DllLoader.cpp @@ -23,7 +23,6 @@ #include "lib/posix/posix_dlfcn.h" #include "ps/CStr.h" #include "ps/CLogger.h" -#include "ps/GameSetup/Config.h" #if OS_MACOSX # include "lib/sysdep/os/osx/osx_bundle.h" diff --git a/source/ps/Font.cpp b/source/ps/Font.cpp index 4cc366823d..46f2130ee8 100644 --- a/source/ps/Font.cpp +++ b/source/ps/Font.cpp @@ -20,7 +20,6 @@ #include "lib/res/graphics/unifont.h" -#include "ps/ConfigDB.h" #include "ps/Filesystem.h" #include "ps/CLogger.h" diff --git a/source/ps/GameSetup/Config.cpp b/source/ps/GameSetup/Config.cpp index fb8f0df0c0..6d520db715 100644 --- a/source/ps/GameSetup/Config.cpp +++ b/source/ps/GameSetup/Config.cpp @@ -78,29 +78,29 @@ CStr g_AutostartMap = ""; // Fill in the globals from the config files. 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_USER_VAL("noautomipmap", Bool, g_NoGLAutoMipmap); - CFG_GET_USER_VAL("novbo", Bool, g_NoGLVBO); - CFG_GET_USER_VAL("pauseonfocusloss", Bool, g_PauseOnFocusLoss); - CFG_GET_USER_VAL("shadows", Bool, g_Shadows); - CFG_GET_USER_VAL("shadowpcf", Bool, g_ShadowPCF); + CFG_GET_VAL("nos3tc", Bool, g_NoGLS3TC); + CFG_GET_VAL("noautomipmap", Bool, g_NoGLAutoMipmap); + CFG_GET_VAL("novbo", Bool, g_NoGLVBO); + CFG_GET_VAL("pauseonfocusloss", Bool, g_PauseOnFocusLoss); + CFG_GET_VAL("shadows", Bool, g_Shadows); + CFG_GET_VAL("shadowpcf", Bool, g_ShadowPCF); - CFG_GET_USER_VAL("waternormals",Bool, g_WaterNormal); - CFG_GET_USER_VAL("waterrealdepth",Bool, g_WaterRealDepth); - CFG_GET_USER_VAL("waterfoam",Bool, g_WaterFoam); - CFG_GET_USER_VAL("watercoastalwaves",Bool, g_WaterCoastalWaves); + CFG_GET_VAL("waternormals",Bool, g_WaterNormal); + CFG_GET_VAL("waterrealdepth",Bool, g_WaterRealDepth); + CFG_GET_VAL("waterfoam",Bool, g_WaterFoam); + CFG_GET_VAL("watercoastalwaves",Bool, g_WaterCoastalWaves); if (g_WaterCoastalWaves && !g_WaterNormal) g_WaterCoastalWaves = false; - CFG_GET_USER_VAL("waterrefraction",Bool, g_WaterRefraction); - CFG_GET_USER_VAL("waterreflection",Bool, g_WaterReflection); - CFG_GET_USER_VAL("watershadows",Bool, g_WaterShadows); - - CFG_GET_USER_VAL("renderpath", String, g_RenderPath); - CFG_GET_USER_VAL("particles", Bool, g_Particles); - CFG_GET_USER_VAL("silhouettes", Bool, g_Silhouettes); - CFG_GET_USER_VAL("showsky", Bool, g_ShowSky); + CFG_GET_VAL("waterrefraction",Bool, g_WaterRefraction); + CFG_GET_VAL("waterreflection",Bool, g_WaterReflection); + CFG_GET_VAL("watershadows",Bool, g_WaterShadows); + + CFG_GET_VAL("renderpath", String, g_RenderPath); + CFG_GET_VAL("particles", Bool, g_Particles); + CFG_GET_VAL("silhouettes", Bool, g_Silhouettes); + CFG_GET_VAL("showsky", Bool, g_ShowSky); #if CONFIG2_AUDIO float gain = 0.5f; @@ -110,13 +110,13 @@ static void LoadGlobals() int bufferCount = 50; unsigned long bufferSize = 65536; - CFG_GET_USER_VAL("sound.mastergain", Float, gain); - CFG_GET_USER_VAL("sound.musicgain", Float, musicGain); - CFG_GET_USER_VAL("sound.ambientgain", Float, ambientGain); - CFG_GET_USER_VAL("sound.actiongain", Float, actionGain); + CFG_GET_VAL("sound.mastergain", Float, gain); + CFG_GET_VAL("sound.musicgain", Float, musicGain); + CFG_GET_VAL("sound.ambientgain", Float, ambientGain); + CFG_GET_VAL("sound.actiongain", Float, actionGain); - CFG_GET_USER_VAL("sound.bufferCount", Int, bufferCount); - CFG_GET_USER_VAL("sound.bufferSize", UnsignedLong, bufferSize); + CFG_GET_VAL("sound.bufferCount", Int, bufferCount); + CFG_GET_VAL("sound.bufferSize", UnsignedLong, bufferSize); if (g_SoundManager) { g_SoundManager->SetMasterGain(gain); @@ -223,7 +223,7 @@ void CONFIG_Init(const CmdLineArgs& args) // Initialise console history file 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); // Collect information from system.cfg, the profile file, diff --git a/source/ps/GameSetup/GameSetup.cpp b/source/ps/GameSetup/GameSetup.cpp index f803a6d4db..ec59442b82 100644 --- a/source/ps/GameSetup/GameSetup.cpp +++ b/source/ps/GameSetup/GameSetup.cpp @@ -202,7 +202,7 @@ void Render() ogl_WarnIfError(); CStr skystring = "255 0 255"; - CFG_GET_USER_VAL("skycolor", String, skystring); + CFG_GET_VAL("skycolor", String, skystring); CColor skycol; GUI::ParseString(skystring.FromUTF8(), skycol); g_Renderer.SetClearColor(skycol.AsSColor4ub()); @@ -269,7 +269,7 @@ void Render() else { bool forceGL = false; - CFG_GET_USER_VAL("nohwcursor", Bool, forceGL); + CFG_GET_VAL("nohwcursor", Bool, forceGL); #if CONFIG2_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 // (By default it's only enabled by a hotkey, for security/performance) bool profilerHTTPEnable = false; - CFG_GET_USER_VAL("profiler2.http.autoenable", Bool, profilerHTTPEnable); + CFG_GET_VAL("profiler2.http.autoenable", Bool, profilerHTTPEnable); if (profilerHTTPEnable) g_Profiler2.EnableHTTP(); @@ -930,7 +930,7 @@ void InitGraphics(const CmdLineArgs& args, int flags) // Optionally start profiler GPU timings automatically // (By default it's only enabled by a hotkey, for performance/compatibility) bool profilerGPUEnable = false; - CFG_GET_USER_VAL("profiler2.gpu.autoenable", Bool, profilerGPUEnable); + CFG_GET_VAL("profiler2.gpu.autoenable", Bool, profilerGPUEnable); if (profilerGPUEnable) g_Profiler2.EnableGPU(); diff --git a/source/ps/Joystick.cpp b/source/ps/Joystick.cpp index 62e3463385..1300d7d758 100644 --- a/source/ps/Joystick.cpp +++ b/source/ps/Joystick.cpp @@ -33,11 +33,11 @@ CJoystick::CJoystick() : void CJoystick::Initialise() { bool joystickEnable = false; - CFG_GET_USER_VAL("joystick.enable", Bool, joystickEnable); + CFG_GET_VAL("joystick.enable", Bool, joystickEnable); if (!joystickEnable) 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) { diff --git a/source/ps/Profiler2GPU.cpp b/source/ps/Profiler2GPU.cpp index 22d6379449..05a257ef40 100644 --- a/source/ps/Profiler2GPU.cpp +++ b/source/ps/Profiler2GPU.cpp @@ -776,9 +776,9 @@ CProfiler2GPU::CProfiler2GPU(CProfiler2& profiler) : bool enabledARB = false; bool enabledEXT = false; bool enabledINTEL = false; - CFG_GET_USER_VAL("profiler2.gpu.arb.enable", Bool, enabledARB); - CFG_GET_USER_VAL("profiler2.gpu.ext.enable", Bool, enabledEXT); - CFG_GET_USER_VAL("profiler2.gpu.intel.enable", Bool, enabledINTEL); + CFG_GET_VAL("profiler2.gpu.arb.enable", Bool, enabledARB); + CFG_GET_VAL("profiler2.gpu.ext.enable", Bool, enabledEXT); + CFG_GET_VAL("profiler2.gpu.intel.enable", Bool, enabledINTEL); // Only enable either ARB or EXT, not both, because they are redundant // (EXT is only needed for compatibility with older systems), and because diff --git a/source/ps/UserReport.cpp b/source/ps/UserReport.cpp index 06b0933938..960ad1134c 100644 --- a/source/ps/UserReport.cpp +++ b/source/ps/UserReport.cpp @@ -520,7 +520,7 @@ std::string CUserReporter::LoadUserID() std::string userID; // 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 (userID.length() != 16) @@ -547,7 +547,7 @@ std::string CUserReporter::LoadUserID() bool CUserReporter::IsReportingEnabled() { int version = -1; - CFG_GET_USER_VAL("userreport.enabledversion", Int, version); + CFG_GET_VAL("userreport.enabledversion", Int, version); return (version >= REPORTER_VERSION); } @@ -576,7 +576,7 @@ void CUserReporter::Initialize() std::string userID = LoadUserID(); 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 // system already inits those) diff --git a/source/ps/VideoMode.cpp b/source/ps/VideoMode.cpp index 4e8b336323..e8d7f6fe52 100644 --- a/source/ps/VideoMode.cpp +++ b/source/ps/VideoMode.cpp @@ -54,13 +54,13 @@ CVideoMode::CVideoMode() : void CVideoMode::ReadConfig() { bool windowed = !m_ConfigFullscreen; - CFG_GET_USER_VAL("windowed", Bool, windowed); + CFG_GET_VAL("windowed", Bool, windowed); m_ConfigFullscreen = !windowed; - CFG_GET_USER_VAL("xres", Int, m_ConfigW); - CFG_GET_USER_VAL("yres", Int, m_ConfigH); - CFG_GET_USER_VAL("bpp", Int, m_ConfigBPP); - CFG_GET_USER_VAL("force_s3tc_enable", Bool, m_ConfigForceS3TCEnable); + CFG_GET_VAL("xres", Int, m_ConfigW); + CFG_GET_VAL("yres", Int, m_ConfigH); + CFG_GET_VAL("bpp", Int, m_ConfigBPP); + CFG_GET_VAL("force_s3tc_enable", Bool, m_ConfigForceS3TCEnable); } bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen) diff --git a/source/renderer/Renderer.cpp b/source/renderer/Renderer.cpp index f732fa1eed..ea5bc99d30 100644 --- a/source/renderer/Renderer.cpp +++ b/source/renderer/Renderer.cpp @@ -444,12 +444,12 @@ CRenderer::CRenderer() m_Options.m_ShowSky = false; // TODO: be more consistent in use of the config system - CFG_GET_USER_VAL("preferglsl", Bool, m_Options.m_PreferGLSL); - CFG_GET_USER_VAL("forcealphatest", Bool, m_Options.m_ForceAlphaTest); - CFG_GET_USER_VAL("gpuskinning", Bool, m_Options.m_GPUSkinning); - CFG_GET_USER_VAL("gentangents", Bool, m_Options.m_GenTangents); - CFG_GET_USER_VAL("smoothlos", Bool, m_Options.m_SmoothLOS); - CFG_GET_USER_VAL("postproc", Bool, m_Options.m_Postproc); + CFG_GET_VAL("preferglsl", Bool, m_Options.m_PreferGLSL); + CFG_GET_VAL("forcealphatest", Bool, m_Options.m_ForceAlphaTest); + CFG_GET_VAL("gpuskinning", Bool, m_Options.m_GPUSkinning); + CFG_GET_VAL("gentangents", Bool, m_Options.m_GenTangents); + CFG_GET_VAL("smoothlos", Bool, m_Options.m_SmoothLOS); + CFG_GET_VAL("postproc", Bool, m_Options.m_Postproc); #if CONFIG2_GLES // Override config option since GLES only supports GLSL diff --git a/source/simulation2/Simulation2.cpp b/source/simulation2/Simulation2.cpp index 34ec4fd037..6efe4b0492 100644 --- a/source/simulation2/Simulation2.cpp +++ b/source/simulation2/Simulation2.cpp @@ -72,8 +72,8 @@ public: // Tests won't have config initialised if (CConfigDB::IsInitialised()) { - CFG_GET_USER_VAL("ooslog", Bool, m_EnableOOSLog); - CFG_GET_USER_VAL("serializationtest", Bool, m_EnableSerializationTest); + CFG_GET_VAL("ooslog", Bool, m_EnableOOSLog); + CFG_GET_VAL("serializationtest", Bool, m_EnableSerializationTest); } }