Index: ps/trunk/binaries/data/config/default.cfg
===================================================================
--- ps/trunk/binaries/data/config/default.cfg (revision 23746)
+++ ps/trunk/binaries/data/config/default.cfg (revision 23747)
@@ -1,530 +1,523 @@
; Global Configuration Settings
;
; **************************************************************
; * DO NOT EDIT THIS FILE if you want personal customisations: *
; * create a text file called "local.cfg" instead, and copy *
; * the lines from this file that you want to change. *
; * *
; * If a setting is part of a section (for instance [hotkey]) *
; * you need to append the section name at the beginning of *
; * your custom line (for instance you need to write *
; * "hotkey.pause = Space" if you want to change the pausing *
; * hotkey to the spacebar). *
; * *
; * On Linux, create: *
; * $XDG_CONFIG_HOME/0ad/config/local.cfg *
; * (Note: $XDG_CONFIG_HOME defaults to ~/.config) *
; * *
; * On OS X, create: *
; * ~/Library/Application\ Support/0ad/config/local.cfg *
; * *
; * On Windows, create: *
; * %appdata%\0ad\config\local.cfg *
; * *
; **************************************************************
; Enable/disable windowed mode by default. (Use Alt+Enter to toggle in the game.)
windowed = false
; Show detailed tooltips (Unit stats)
showdetailedtooltips = false
; Pause the game on window focus loss (Only applicable to single player mode)
pauseonfocusloss = true
; Persist settings after leaving the game setup screen
persistmatchsettings = true
; Default player name to use in multiplayer
; playername = "anonymous"
; Default server name or IP to use in multiplayer
multiplayerserver = "127.0.0.1"
; Force a particular resolution. (If these are 0, the default is
; to keep the current desktop resolution in fullscreen mode or to
; use 1024x768 in windowed mode.)
xres = 0
yres = 0
; Force a non-standard bit depth (if 0 then use the current desktop bit depth)
bpp = 0
; Preferred display (for multidisplay setups, only works with SDL 2.0)
display = 0
; Emulate right-click with Ctrl+Click on Mac mice
macmouse = false
; System settings:
; if false, actors won't be rendered but anything entity will be.
renderactors = true
watereffects=true ; When disabled, force usage of the fixed pipeline water. This is faster, but really, really ugly.
waterfancyeffects = false
waterrealdepth = true
waterrefraction = true
waterreflection = true
shadowsonwater = false
shadows = true
shadowquality = 0 ; Shadow map resolution. (-2 - Very Low, -1 - Low, 0 - Medium, 1 - High, 2 - Very High)
; High values can crash the game when using a graphics card with low memory!
shadowpcf = true
shadowsfixed = false ; When enabled shadows are rendered only on the
shadowsfixeddistance = 300.0 ; fixed distance and without swimming effect.
vsync = false
particles = true
fog = true
silhouettes = true
showsky = true
-nos3tc = false
-noautomipmap = true
novbo = false
-noframebufferobject = false
; Disable hardware cursors
nohwcursor = false
-; Linux only: Set the driconf force_s3tc_enable option at startup,
-; for compressed texture support
-force_s3tc_enable = true
-
; Specify the render path. This can be one of:
; default Automatically select one of the below, depending on system capabilities
; fixed Only use OpenGL fixed function pipeline
; shader Use vertex/fragment shaders for transform and lighting where possible
; Using 'fixed' instead of 'default' may work around some graphics-related problems,
; but will reduce performance and features when a modern graphics card is available.
renderpath = default
;;;;; EXPERIMENTAL ;;;;;
; Prefer GLSL shaders over ARB shaders. Allows fancier graphical effects.
preferglsl = false
; Experimental probably-non-working GPU skinning support; requires preferglsl; use at own risk
gpuskinning = false
; Use smooth LOS interpolation
smoothlos = false
; Use screen-space postprocessing filters (HDR, bloom, DOF, etc). Incompatible with fixed renderpath.
postproc = false
; Use anti-aliasing techniques.
antialiasing = "disabled"
; Quality level of shader effects (set to 10 to display all effects)
materialmgr.quality = 2.0
; Maximum distance to display parallax effect. Set to 0 to disable parallax.
materialmgr.PARALLAX_DIST.max = 150
; Maximum distance to display high quality parallax effect.
materialmgr.PARALLAX_HQ_DIST.max = 75
; Maximum distance to display very high quality parallax effect. Set to 30 to enable.
materialmgr.PARALLAX_VHQ_DIST.max = 0
;;;;;;;;;;;;;;;;;;;;;;;;
; Replace alpha-blending with alpha-testing, for performance experiments
forcealphatest = false
; Color of the sky (in "r g b" format)
skycolor = "0 0 0"
[adaptivefps]
session = 60 ; Throttle FPS in running games (prevents 100% CPU workload).
menu = 60 ; Throttle FPS in menus only.
[hotkey]
; Each one of the specified keys will trigger the action on the left
; for multiple-key combinations, separate keys with '+'.
; See keys.txt for the list of key names.
; > SYSTEM SETTINGS
exit = "Ctrl+Break", "Super+Q" ; Exit to desktop
cancel = Escape ; Close or cancel the current dialog box/popup
confirm = Return ; Confirm the current command
pause = Pause ; Pause/unpause game
screenshot = F2 ; Take PNG screenshot
bigscreenshot = "Shift+F2" ; Take large BMP screenshot
togglefullscreen = "Alt+Return" ; Toggle fullscreen/windowed mode
screenshot.watermark = "Alt+K" ; Toggle product/company watermark for official screenshots
wireframe = "Alt+Shift+W" ; Toggle wireframe mode
silhouettes = "Alt+Shift+S" ; Toggle unit silhouettes
showsky = "Alt+Z" ; Toggle sky
; > DIALOG HOTKEYS
summary = "Ctrl+Tab" ; Toggle in-game summary
lobby = "Alt+L" ; Show the multiplayer lobby in a dialog window.
structree = "Alt+Shift+T" ; Show structure tree
civinfo = "Alt+Shift+H" ; Show civilization info
; > CLIPBOARD CONTROLS
copy = "Ctrl+C" ; Copy to clipboard
paste = "Ctrl+V" ; Paste from clipboard
cut = "Ctrl+X" ; Cut selected text and copy to the clipboard
; > CONSOLE SETTINGS
console.toggle = BackQuote, F9 ; Open/close console
; > OVERLAY KEYS
fps.toggle = "Alt+F" ; Toggle frame counter
realtime.toggle = "Alt+T" ; Toggle current display of computer time
timeelapsedcounter.toggle = "F12" ; Toggle time elapsed counter
ceasefirecounter.toggle = unused ; Toggle ceasefire counter
; > HOTKEYS ONLY
chat = Return ; Toggle chat window
teamchat = "T" ; Toggle chat window in team chat mode
privatechat = "L" ; Toggle chat window and select the previous private chat partner
; > QUICKSAVE
quicksave = "Shift+F5"
quickload = "Shift+F8"
[hotkey.camera]
reset = "R" ; Reset camera rotation to default.
follow = "F" ; Follow the first unit in the selection
rallypointfocus = unused ; Focus the camera on the rally point of the selected building
zoom.in = Plus, Equals, NumPlus ; Zoom camera in (continuous control)
zoom.out = Minus, NumMinus ; Zoom camera out (continuous control)
zoom.wheel.in = WheelUp ; Zoom camera in (stepped control)
zoom.wheel.out = WheelDown ; Zoom camera out (stepped control)
rotate.up = "Ctrl+UpArrow", "Ctrl+W" ; Rotate camera to look upwards
rotate.down = "Ctrl+DownArrow", "Ctrl+S" ; Rotate camera to look downwards
rotate.cw = "Ctrl+LeftArrow", "Ctrl+A", Q ; Rotate camera clockwise around terrain
rotate.ccw = "Ctrl+RightArrow", "Ctrl+D", E ; Rotate camera anticlockwise around terrain
rotate.wheel.cw = "Shift+WheelUp", MouseX1 ; Rotate camera clockwise around terrain (stepped control)
rotate.wheel.ccw = "Shift+WheelDown", MouseX2 ; Rotate camera anticlockwise around terrain (stepped control)
pan = MouseMiddle ; Enable scrolling by moving mouse
left = A, LeftArrow ; Scroll or rotate left
right = D, RightArrow ; Scroll or rotate right
up = W, UpArrow ; Scroll or rotate up/forwards
down = S, DownArrow ; Scroll or rotate down/backwards
scroll.speed.increase = "Ctrl+Shift+S" ; Increase scroll speed
scroll.speed.decrease = "Ctrl+Alt+S" ; Decrease scroll speed
rotate.speed.increase = "Ctrl+Shift+R" ; Increase rotation speed
rotate.speed.decrease = "Ctrl+Alt+R" ; Decrease rotation speed
zoom.speed.increase = "Ctrl+Shift+Z" ; Increase zoom speed
zoom.speed.decrease = "Ctrl+Alt+Z" ; Decrease zoom speed
[hotkey.camera.jump]
1 = F5 ; Jump to position N
2 = F6
3 = F7
4 = F8
;5 =
;6 =
;7 =
;8 =
;9 =
;10 =
[hotkey.camera.jump.set]
1 = "Ctrl+F5" ; Set jump position N
2 = "Ctrl+F6"
3 = "Ctrl+F7"
4 = "Ctrl+F8"
;5 =
;6 =
;7 =
;8 =
;9 =
;10 =
[hotkey.profile]
toggle = "F11" ; Enable/disable real-time profiler
save = "Shift+F11" ; Save current profiler data to logs/profile.txt
[hotkey.profile2]
toggle = "Ctrl+F11" ; Enable/disable HTTP/GPU modes for new profiler
[hotkey.selection]
add = Shift ; Add units to selection
militaryonly = Alt ; Add only military units to the selection
nonmilitaryonly = "Alt+Y" ; Add only non-military units to the selection
idleonly = "I" ; Select only idle units
woundedonly = "O" ; Select only wounded units
remove = Ctrl ; Remove units from selection
cancel = Esc ; Un-select all units and cancel building placement
idleworker = Period ; Select next idle worker
idlewarrior = ForwardSlash ; Select next idle warrior
idleunit = BackSlash ; Select next idle unit
offscreen = Alt ; Include offscreen units in selection
[hotkey.selection.group.add]
0 = "Shift+0"
1 = "Shift+1"
2 = "Shift+2"
3 = "Shift+3"
4 = "Shift+4"
5 = "Shift+5"
6 = "Shift+6"
7 = "Shift+7"
8 = "Shift+8"
9 = "Shift+9"
[hotkey.selection.group.save]
0 = "Ctrl+0"
1 = "Ctrl+1"
2 = "Ctrl+2"
3 = "Ctrl+3"
4 = "Ctrl+4"
5 = "Ctrl+5"
6 = "Ctrl+6"
7 = "Ctrl+7"
8 = "Ctrl+8"
9 = "Ctrl+9"
[hotkey.selection.group.select]
0 = 0
1 = 1
2 = 2
3 = 3
4 = 4
5 = 5
6 = 6
7 = 7
8 = 8
9 = 9
[hotkey.session]
kill = Delete ; Destroy selected units
stop = "H" ; Stop the current action
backtowork = "Y" ; The unit will go back to work
unload = "U" ; Unload garrisoned units when a building/mechanical unit is selected
move = unused ; Modifier to move to a point instead of another action (e.g. gather)
attack = Ctrl ; Modifier to attack instead of another action (e.g. capture)
attackmove = Ctrl ; Modifier to attackmove when clicking on a point
attackmoveUnit = "Ctrl+Q" ; Modifier to attackmove targeting only units when clicking on a point (should contain the attackmove keys)
garrison = Ctrl ; Modifier to garrison when clicking on building
autorallypoint = Ctrl ; Modifier to set the rally point on the building itself
guard = "G" ; Modifier to escort/guard when clicking on unit/building
patrol = "P" ; Modifier to patrol a unit
repair = "J" ; Modifier to repair when clicking on building/mechanical unit
queue = Shift ; Modifier to queue unit orders instead of replacing
orderone = Alt ; Modifier to order only one entity in selection.
batchtrain = Shift ; Modifier to train units in batches
massbarter = Shift ; Modifier to barter bunch of resources
masstribute = Shift ; Modifier to tribute bunch of resources
noconfirmation = Shift ; Do not ask confirmation when deleting a building/unit
fulltradeswap = Shift ; Modifier to put the desired trade resource to 100%
unloadtype = Shift ; Modifier to unload all units of type
deselectgroup = Ctrl ; Modifier to deselect units when clicking group icon, instead of selecting
rotate.cw = RightBracket ; Rotate building placement preview clockwise
rotate.ccw = LeftBracket ; Rotate building placement preview anticlockwise
snaptoedges = Ctrl ; Modifier to align new structures with nearby existing structure
; Overlays
showstatusbars = Tab ; Toggle display of status bars
devcommands.toggle = "Alt+D" ; Toggle developer commands panel
highlightguarding = PgDn ; Toggle highlight of guarding units
highlightguarded = PgUp ; Toggle highlight of guarded units
diplomacycolors = "Alt+X" ; Toggle diplomacy colors
toggleattackrange = "Alt+C" ; Toggle display of attack range overlays of selected defensive structures
toggleaurasrange = "Alt+V" ; Toggle display of aura range overlays of selected units and structures
togglehealrange = "Alt+B" ; Toggle display of heal range overlays of selected units
[hotkey.session.gui]
toggle = "Alt+G" ; Toggle visibility of session GUI
menu.toggle = "F10" ; Toggle in-game menu
diplomacy.toggle = "Ctrl+H" ; Toggle in-game diplomacy page
barter.toggle = "Ctrl+B" ; Toggle in-game barter/trade page
objectives.toggle = "Ctrl+O" ; Toggle in-game objectives page
tutorial.toggle = "Ctrl+P" ; Toggle in-game tutorial panel
[hotkey.session.savedgames]
delete = Delete ; Delete the selected saved game asking confirmation
noconfirmation = Shift ; Do not ask confirmation when deleting a game
[hotkey.session.queueunit] ; > UNIT TRAINING
1 = "Z" ; add first unit type to queue
2 = "X" ; add second unit type to queue
3 = "C" ; add third unit type to queue
4 = "V" ; add fourth unit type to queue
5 = "B" ; add fivth unit type to queue
6 = "N" ; add sixth unit type to queue
7 = "M" ; add seventh unit type to queue
8 = Comma ; add eighth unit type to queue
[hotkey.session.timewarp]
fastforward = Space ; If timewarp mode enabled, speed up the game
rewind = Backspace ; If timewarp mode enabled, go back to earlier point in the game
[hotkey.tab]
next = "Tab", "Alt+S" ; Show the next tab
prev = "Shift+Tab", "Alt+W" ; Show the previous tab
[hotkey.text] ; > GUI TEXTBOX HOTKEYS
delete.left = "Ctrl+Backspace" ; Delete word to the left of cursor
delete.right = "Ctrl+Del" ; Delete word to the right of cursor
move.left = "Ctrl+LeftArrow" ; Move cursor to start of word to the left of cursor
move.right = "Ctrl+RightArrow" ; Move cursor to start of word to the right of cursor
[gui]
cursorblinkrate = 0.5 ; Cursor blink rate in seconds (0.0 to disable blinking)
scale = 1.0 ; GUI scaling factor, for improved compatibility with 4K displays
[gui.gamesetup]
enabletips = true ; Enable/Disable tips during gamesetup (for newcomers)
assignplayers = everyone ; Whether to assign joining clients to free playerslots. Possible values: everyone, buddies, disabled.
aidifficulty = 3 ; Difficulty level, from 0 (easiest) to 5 (hardest)
aibehavior = "random" ; Default behavior of the AI (random, balanced, aggressive or defensive)
settingsslide = true ; Enable/Disable settings panel slide
[gui.loadingscreen]
progressdescription = false ; Whether to display the progress percent or a textual description
[gui.session]
camerajump.threshold = 40 ; How close do we have to be to the actual location in order to jump back to the previous one?
timeelapsedcounter = false ; Show the game duration in the top right corner
ceasefirecounter = false ; Show the remaining ceasefire time in the top right corner
batchtrainingsize = 5 ; Number of units to be trained per batch by default (when pressing the hotkey)
scrollbatchratio = 1 ; Number of times you have to scroll to increase/decrease the batchsize by 1
woundedunithotkeythreshold = 33 ; The wounded unit hotkey considers the selected units as wounded if their health percentage falls below this number
attackrange = true ; Display attack range overlays of selected defensive structures
aurasrange = true ; Display aura range overlays of selected units and structures
healrange = true ; Display heal range overlays of selected units
rankabovestatusbar = true ; Show rank icons above status bars
experiencestatusbar = true ; Show an experience status bar above each selected unit
respoptooltipsort = 0 ; Sorting players in the resources and population tooltip by value (0 - no sort, -1 - ascending, 1 - descending)
snaptoedges = "disabled" ; Possible values: disabled, enabled.
snaptoedgesdistancethreshold = 15 ; On which distance we don't snap to edges
disjointcontrolgroups = "true" ; Whether control groups are disjoint sets or entities can be in multiple control groups at the same time.
[gui.session.minimap]
blinkduration = 1.7 ; The blink duration while pinging
pingduration = 50.0 ; The duration for which an entity will be pinged after an attack notification
[gui.session.notifications]
attack = true ; Show a chat notification if you are attacked by another player
tribute = true ; Show a chat notification if an ally tributes resources to another team member if teams are locked, and all tributes in observer mode
barter = true ; Show a chat notification to observers when a player bartered resources
phase = completed ; Show a chat notification if you or an ally have started, aborted or completed a new phase, and phases of all players in observer mode. Possible values: none, completed, all.
[gui.splashscreen]
enable = true ; Enable/disable the splashscreen
version = 0 ; Splashscreen version (date of last modification). By default, 0 to force splashscreen to appear at first launch
[gui.session.diplomacycolors]
self = "21 55 149" ; Color of your units when diplomacy colors are enabled
ally = "86 180 31" ; Color of allies when diplomacy colors are enabled
neutral = "231 200 5" ; Color of neutral players when diplomacy colors are enabled
enemy = "150 20 20" ; Color of enemies when diplomacy colors are enabled
[joystick] ; EXPERIMENTAL: joystick/gamepad settings
enable = false
deadzone = 8192
[joystick.camera]
pan.x = 0
pan.y = 1
rotate.x = 3
rotate.y = 2
zoom.in = 5
zoom.out = 4
[chat]
timestamp = true ; Show at which time chat messages have been sent
[chat.session]
extended = true ; Whether to display the chat history
[lobby]
history = 0 ; Number of past messages to display on join
room = "arena24" ; Default MUC room to join
server = "lobby.wildfiregames.com" ; Address of lobby server
tls = true ; Whether to use TLS encryption when connecting to the server.
verify_certificate = false ; Whether to reject connecting to the lobby if the TLS certificate is invalid (TODO: wait for Gloox GnuTLS trust implementation to be fixed)
terms_url = "https://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/gui/prelobby/common/terms/"; Allows the user to save the text and print the terms
terms_of_service = "0" ; Version (hash) of the Terms of Service that the user has accepted
terms_of_use = "0" ; Version (hash) of the Terms of Use that the user has accepted
privacy_policy = "0" ; Version (hash) of the Privacy Policy that the user has accepted
xpartamupp = "wfgbot24" ; Name of the server-side XMPP-account that manage games
echelon = "echelon24" ; Name of the server-side XMPP-account that manages ratings
buddies = "," ; Comma separated list of playernames that the current user has marked as buddies
rememberpassword = true ; Whether to store the encrypted password in the user config
[lobby.columns]
gamerating = false ; Show the average rating of the participating players in a column of the gamelist
[lobby.stun]
enabled = true ; The STUN protocol allows hosting games without configuring the firewall and router.
; If STUN is disabled, the game relies on direct connection, UPnP and port forwarding.
server = "lobby.wildfiregames.com" ; Address of the STUN server.
port = 3478 ; Port of the STUN server.
delay = 200 ; Duration in milliseconds that is waited between STUN messages.
; Smaller numbers speed up joins but also become less stable.
[mod]
enabledmods = "mod public"
[modio]
public_key = "RWTsHxQMrRq4xwHisyBa2rNQfAedcINzbTT83jeX4/ZcfVxqLfWB4y8w" ; Public key corresponding to the private key valid mods are signed with
disclaimer = "0" ; Version (hash) of the Disclaimer that the user has accepted
[modio.v1]
baseurl = "https://api.mod.io/v1"
api_key = "23df258a71711ea6e4b50893acc1ba55"
name_id = "0ad"
[network]
duplicateplayernames = false ; Rename joining player to "User (2)" if "User" is already connected, otherwise prohibit join.
lateobservers = everyone ; Allow observers to join the game after it started. Possible values: everyone, buddies, disabled.
observerlimit = 8 ; Prevent further observer joins in running games if this limit is reached
gamestarttimeout = 60000 ; Don't disconnect clients timing out in the loading screen and rejoin process before exceeding this timeout.
[overlay]
fps = "false" ; Show frames per second in top right corner
realtime = "false" ; Show current system time in top right corner
netwarnings = "true" ; Show warnings if the network connection is bad
[profiler2]
autoenable = false ; Enable HTTP server output at startup (default off for security/performance)
gpu.arb.enable = true ; Allow GL_ARB_timer_query timing mode when available
gpu.ext.enable = true ; Allow GL_EXT_timer_query timing mode when available
gpu.intel.enable = true ; Allow GL_INTEL_performance_queries timing mode when available
[sound]
mastergain = 0.9
musicgain = 0.2
ambientgain = 0.6
actiongain = 0.7
uigain = 0.7
[sound.notify]
nick = true ; Play a sound when someone mentions your name in the lobby or game
gamesetup.join = false ; Play a sound when a new client joins the game setup
[tinygettext]
debug = false ; Print error messages each time a translation for an English string is not found.
[userreport] ; Opt-in online user reporting system
url_upload = "https://feedback.wildfiregames.com/report/upload/v1/" ; URL where UserReports are uploaded to
url_publication = "https://feedback.wildfiregames.com/" ; URL where UserReports were analyzed and published
url_terms = "https://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/gui/userreport/Terms_and_Conditions.txt"; Allows the user to save the text and print the terms
terms = "0" ; Version (hash) of the UserReporter Terms that the user has accepted
[view] ; Camera control settings
scroll.speed = 120.0
scroll.speed.modifier = 1.05 ; Multiplier for changing scroll speed
rotate.x.speed = 1.2
rotate.x.min = 28.0
rotate.x.max = 60.0
rotate.x.default = 35.0
rotate.y.speed = 2.0
rotate.y.speed.wheel = 0.45
rotate.y.default = 0.0
rotate.speed.modifier = 1.05 ; Multiplier for changing rotation speed
drag.speed = 0.5
zoom.speed = 256.0
zoom.speed.wheel = 32.0
zoom.min = 50.0
zoom.max = 200.0
zoom.default = 120.0
zoom.speed.modifier = 1.05 ; Multiplier for changing zoom speed
pos.smoothness = 0.1
zoom.smoothness = 0.4
rotate.x.smoothness = 0.5
rotate.y.smoothness = 0.3
near = 2.0 ; Near plane distance
far = 4096.0 ; Far plane distance
fov = 45.0 ; Field of view (degrees), lower is narrow, higher is wide
height.smoothness = 0.5
height.min = 16
Index: ps/trunk/binaries/data/mods/mod/hwdetect/hwdetect.js
===================================================================
--- ps/trunk/binaries/data/mods/mod/hwdetect/hwdetect.js (revision 23746)
+++ ps/trunk/binaries/data/mods/mod/hwdetect/hwdetect.js (revision 23747)
@@ -1,387 +1,395 @@
/* Copyright (C) 2020 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
This script is for adjusting the game's default settings based on the
user's system configuration details.
The game engine itself does some detection of capabilities, so it will
enable certain graphical features only when they are supported.
This script is for the messier task of avoiding performance problems
and driver bugs based on experience of particular system configurations.
*/
var g_IntelMesaChipsets = [
"Intel(R) 845G",
"Intel(R) 830M",
"Intel(R) 852GM/855GM",
"Intel(R) 865G",
"Intel(R) 915G",
"Intel (R) E7221G (i915)",
"Intel(R) 915GM",
"Intel(R) 945G",
"Intel(R) 945GM",
"Intel(R) 945GME",
"Intel(R) G33",
"Intel(R) Q35",
"Intel(R) Q33",
"Intel(R) IGD",
"Intel(R) 965Q",
"Intel(R) 965G",
"Intel(R) 946GZ",
"Intel(R) GMA500", // not in current Mesa
"Intel(R) 965GM",
"Intel(R) 965GME/GLE",
"Mobile Intel\xC2\xAE GM45 Express Chipset", // utf-8 decoded as iso-8859-1
"Intel(R) Integrated Graphics Device",
"Intel(R) G45/G43",
"Intel(R) Q45/Q43",
"Intel(R) G41",
"Intel(R) B43",
"Intel(R) IGDNG_D", // not in current Mesa; looks somewhat like Ironlake
"Intel(R) IGDNG_M", // not in current Mesa; looks somewhat like Ironlake
"Intel(R) Ironlake Desktop",
"Intel(R) Ironlake Mobile",
"Intel(R) Sandybridge Desktop",
"Intel(R) Sandybridge Mobile",
"Intel(R) Sandybridge Server",
"Intel(R) Ivybridge Desktop",
"Intel(R) Ivybridge Mobile",
"Intel(R) Ivybridge Server",
"Intel(R) Haswell Desktop",
"Intel(R) Haswell Mobile",
"Intel(R) Haswell Server",
"Unknown Intel Chipset",
"*", // dummy value to support IsWorseThanIntelMesa("*") to detect all Intel Mesa devices
];
// Originally generated from Mesa with
// perl -lne'print "\t$1," if /chipset = (".*")/' src/mesa/drivers/dri/intel/intel_context.c
// Assumed to be roughly ordered by performance.
var g_IntelWindowsChipsets = [
"Intel 845G",
"Intel 855GM",
"Intel 865G",
"Intel 915G",
"Intel 915GM",
"Intel 945G",
"Intel 945GM",
"Intel 965/963 Graphics Media Accelerator",
"Intel Broadwater G",
"Intel Bear Lake B",
"Intel Pineview Platform",
"Intel Eaglelake",
"Intel(R) G41 Express Chipset", // Eaglelake
"Intel(R) G45/G43 Express Chipset", // Eaglelake
"Intel Cantiga",
"Mobile Intel(R) 4 Series Express Chipset Family", // probably Cantiga
"Intel(R) HD Graphics", // probably Ironlake
"Intel(R) Graphics Media Accelerator HD", // no idea
"*",
];
// Determined manually from data reports.
// See https://en.wikipedia.org/wiki/Intel_GMA for useful listing.
var g_IntelMacChipsets = [
"Intel GMA 950",
"Intel GMA X3100",
"Intel HD Graphics",
"Intel HD Graphics 3000",
"Unknown Intel Chipset",
"*",
];
// Determined manually from data reports.
// See https://support.apple.com/kb/HT3246 for useful listing.
function IsWorseThanIntelMesa(renderer, chipset)
{
var target = g_IntelMesaChipsets.indexOf(chipset);
if (target == -1)
error("Invalid chipset "+chipset);
// GL_RENDERER is "Mesa DRI $chipset" or "Mesa DRI $chipset $otherstuff"
for (var i = 0; i < target; ++i)
{
var str = "Mesa DRI " + g_IntelMesaChipsets[i];
if (renderer == str || renderer.substr(0, str.length+1) == str+" ")
return true;
}
return false;
}
function IsWorseThanIntelWindows(renderer, chipset)
{
var target = g_IntelWindowsChipsets.indexOf(chipset);
if (target == -1)
error("Invalid chipset "+chipset);
var match = g_IntelWindowsChipsets.indexOf(renderer);
if (match != -1 && match < target)
return true;
return false;
}
function IsWorseThanIntelMac(renderer, chipset)
{
var target = g_IntelMacChipsets.indexOf(chipset);
if (target == -1)
error("Invalid chipset "+chipset);
// GL_RENDERER is "$chipset OpenGL Engine"
for (var i = 0; i < target; ++i)
{
var str = g_IntelMacChipsets[i]+" OpenGL Engine";
if (renderer == str)
return true;
}
return false;
}
function RunDetection(settings)
{
// This function should have no side effects, it should just
// set these output properties:
// List of warning strings to display to the user
// in an ugly GUI dialog box
var dialog_warnings = [];
// List of warning strings to log
var warnings = [];
// If variable value is not undefined it overrides default.cfg,
// local preferences have a higher priority anyway
var disable_audio = undefined;
var disable_s3tc = undefined;
var disable_shadows = undefined;
var disable_shadowpcf = undefined;
var disable_allwater = undefined;
var disable_fancywater = undefined;
var enable_glsl = undefined;
var enable_postproc = undefined;
var enable_smoothlos = undefined;
var override_renderpath = undefined;
// TODO: add some mechanism for setting config values
// (overriding default.cfg, but overridden by local.cfg)
// Extract all the settings we might use from the argument:
// (This is less error-prone than referring to "settings.foo" directly
// since typos in the matching code will be caught as references to
// undefined variables.)
// OS flags (0 or 1)
var os_unix = settings.os_unix;
var os_linux = settings.os_linux;
var os_macosx = settings.os_macosx;
var os_win = settings.os_win;
// Should avoid using these, since they're disabled in quickstart mode
var gfx_card = settings.gfx_card;
var gfx_drv_ver = settings.gfx_drv_ver;
var gfx_mem = settings.gfx_mem;
// Values from glGetString
var GL_VENDOR = settings.GL_VENDOR;
var GL_RENDERER = settings.GL_RENDERER;
var GL_VERSION = settings.GL_VERSION;
var GL_EXTENSIONS = settings.GL_EXTENSIONS.split(" ");
// Enable GLSL on OpenGL 3+, which should be able to properly
// manage GLSL shaders, needed for effects like windy trees
if (GL_VERSION.match(/^[3-9]/))
enable_glsl = true;
// Enable GLSL on OpenGL ES 2.0+, which doesn’t support the fixed
// function fallbacks
if (GL_VERSION.match(/^OpenGL ES /))
enable_glsl = true;
// Enable most graphics options on OpenGL 4+, which should be
// able to properly manage them
if (GL_VERSION.match(/^[4-9]/))
{
enable_postproc = true;
enable_smoothlos = true;
// enable all water effects
disable_allwater = false;
}
// Disable most graphics features on software renderers
if (GL_RENDERER.match(/^(Software Rasterizer|.*(llvm|soft)pipe.*|Mesa X11|Apple Software Renderer|GDI Generic)$/))
{
warnings.push("You are using '" + GL_RENDERER + "' graphics driver, expect very poor performance!");
warnings.push("If possible install a proper graphics driver for your hardware.");
enable_glsl = false;
enable_postproc = false;
enable_smoothlos = false;
// s3tc on software renderers halves fps and makes textures weird
disable_s3tc = true;
disable_shadows = true;
disable_shadowpcf = true;
disable_allwater = true;
}
// NVIDIA 260.19.* UNIX drivers cause random crashes soon after startup.
// https://www.wildfiregames.com/forum/index.php?showtopic=13668
// Fixed in 260.19.21:
// "Fixed a race condition in OpenGL that could cause crashes with multithreaded applications."
if (os_unix && GL_VERSION.match(/NVIDIA 260\.19\.(0[0-9]|1[0-9]|20)$/))
{
dialog_warnings.push("You are using 260.19.* series NVIDIA drivers, which may crash the game. Please upgrade to 260.19.21 or later.");
}
// https://trac.wildfiregames.com/ticket/684
// https://bugs.freedesktop.org/show_bug.cgi?id=24047
// R600 drivers will advertise support for S3TC but not actually support it,
// and will draw everything in grey instead, so forcibly disable S3TC.
// (We should add a version check once there's a version that does support it properly.)
if (os_unix && GL_RENDERER.match(/^Mesa DRI R600 /))
disable_s3tc = true;
// https://trac.wildfiregames.com/ticket/623
// Shadows are reportedly very slow on various drivers:
// r300 classic
// Intel 945
// Shadows are also known to be quite slow on some others:
// Intel 4500MHD
// In the interests of performance, we'll disable them on lots of devices
// (with a fairly arbitrary cutoff for Intels)
if (
(os_unix && GL_RENDERER.match(/^Mesa DRI R[123]00 /)) ||
(os_macosx && IsWorseThanIntelMac(GL_RENDERER, "Intel HD Graphics 3000")) ||
(os_unix && IsWorseThanIntelMesa(GL_RENDERER, "Intel(R) Ironlake Desktop")) ||
(os_win && IsWorseThanIntelWindows(GL_RENDERER, "Intel(R) HD Graphics"))
)
{
disable_shadows = true;
disable_shadowpcf = true;
}
// Fragment-shader water is really slow on most Intel devices (especially the
// "use actual depth" option), so disable it on all of them
if (
(os_macosx && IsWorseThanIntelMac(GL_RENDERER, "*")) ||
(os_unix && IsWorseThanIntelMesa(GL_RENDERER, "*")) ||
(os_win && IsWorseThanIntelWindows(GL_RENDERER, "*"))
)
{
disable_fancywater = true;
disable_shadowpcf = true;
}
// https://trac.wildfiregames.com/ticket/780
// r300 classic has problems with shader mode, so fall back to non-shader
if (os_unix && GL_RENDERER.match(/^Mesa DRI R[123]00 /))
{
override_renderpath = "fixed";
warnings.push("Some graphics features are disabled, due to bugs in old graphics drivers. Upgrading to a Gallium-based driver might help.");
}
// https://www.wildfiregames.com/forum/index.php?showtopic=15058
// GF FX has poor shader performance, so fall back to non-shader
if (GL_RENDERER.match(/^GeForce FX /))
{
override_renderpath = "fixed";
disable_allwater = true;
}
// https://trac.wildfiregames.com/ticket/964
// SiS Mirage 3 drivers apparently crash with shaders, so fall back to non-shader
// (The other known SiS cards don't advertise GL_ARB_fragment_program so we
// don't need to do anything special for them)
if (os_win && GL_RENDERER.match(/^Mirage Graphics3$/))
{
override_renderpath = "fixed";
}
return {
"dialog_warnings": dialog_warnings,
"warnings": warnings,
"disable_audio": disable_audio,
"disable_s3tc": disable_s3tc,
"disable_shadows": disable_shadows,
"disable_shadowpcf": disable_shadowpcf,
"disable_allwater": disable_allwater,
"disable_fancywater": disable_fancywater,
"enable_glsl": enable_glsl,
"enable_postproc": enable_postproc,
"enable_smoothlos": enable_smoothlos,
"override_renderpath": override_renderpath,
};
}
global.RunHardwareDetection = function(settings)
{
//print(JSON.stringify(settings, null, 1)+"\n");
var output = RunDetection(settings);
//print(JSON.stringify(output, null, 1)+"\n");
for (var i = 0; i < output.warnings.length; ++i)
warn(output.warnings[i]);
if (output.dialog_warnings.length)
{
var msg = output.dialog_warnings.join("\n\n");
Engine.DisplayErrorDialog(msg);
}
if (output.disable_audio !== undefined)
Engine.SetDisableAudio(output.disable_audio);
- if (output.disable_s3tc !== undefined)
- Engine.SetDisableS3TC(output.disable_s3tc);
-
if (output.disable_shadows !== undefined)
- Engine.SetDisableShadows(output.disable_shadows);
+ Engine.ConfigDB_CreateValue("hwdetect", "shadows", !output.disable_shadows);
if (output.disable_shadowpcf !== undefined)
- Engine.SetDisableShadowPCF(output.disable_shadowpcf);
+ Engine.ConfigDB_CreateValue("hwdetect", "shadowpcf", !output.disable_shadowpcf);
if (output.disable_allwater !== undefined)
- Engine.SetDisableAllWater(output.disable_allwater);
+ {
+ Engine.ConfigDB_CreateValue("hwdetect", "watereffects", !output.disable_allwater);
+ Engine.ConfigDB_CreateValue("hwdetect", "waterfancyeffects", !output.disable_allwater);
+ Engine.ConfigDB_CreateValue("hwdetect", "waterrealdepth", !output.disable_allwater);
+ Engine.ConfigDB_CreateValue("hwdetect", "watershadows", !output.disable_allwater);
+ Engine.ConfigDB_CreateValue("hwdetect", "waterrefraction", !output.disable_allwater);
+ Engine.ConfigDB_CreateValue("hwdetect", "waterreflection", !output.disable_allwater);
+ }
if (output.disable_fancywater !== undefined)
- Engine.SetDisableFancyWater(output.disable_fancywater);
+ {
+ Engine.ConfigDB_CreateValue("hwdetect", "waterfancyeffects", !output.disable_fancywater);
+ Engine.ConfigDB_CreateValue("hwdetect", "waterrealdepth", !output.disable_fancywater);
+ Engine.ConfigDB_CreateValue("hwdetect", "watershadows", !output.disable_fancywater);
+ }
if (output.enable_glsl !== undefined)
- Engine.SetEnableGLSL(output.enable_glsl);
+ Engine.ConfigDB_CreateValue("hwdetect", "preferglsl", output.enable_glsl);
if (output.enable_postproc !== undefined)
- Engine.SetEnablePostProc(output.enable_postproc);
+ Engine.ConfigDB_CreateValue("hwdetect", "postproc", output.enable_postproc);
if (output.enable_smoothlos !== undefined)
- Engine.SetEnableSmoothLOS(output.enable_smoothlos);
+ Engine.ConfigDB_CreateValue("hwdetect", "smoothlos", output.enable_smoothlos);
if (output.override_renderpath !== undefined)
- Engine.SetRenderPath(output.override_renderpath);
+ Engine.ConfigDB_CreateValue("hwdetect", "renderpath", output.override_renderpath);
};
Index: ps/trunk/source/ps/ConfigDB.h
===================================================================
--- ps/trunk/source/ps/ConfigDB.h (revision 23746)
+++ ps/trunk/source/ps/ConfigDB.h (revision 23747)
@@ -1,175 +1,180 @@
/* Copyright (C) 2019 Wildfire Games.
* This file is part of 0 A.D.
*
* 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
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see .
*/
/*
CConfigDB - Load, access and store configuration variables
TDD : http://www.wildfiregames.com/forum/index.php?showtopic=1125
OVERVIEW:
JavaScript: Check this documentation: http://trac.wildfiregames.com/wiki/Exposed_ConfigDB_Functions
*/
#ifndef INCLUDED_CONFIGDB
#define INCLUDED_CONFIGDB
#include "lib/file/vfs/vfs_path.h"
#include "ps/CStr.h"
#include "ps/Singleton.h"
#include