Compare commits

..

47 commits

Author SHA1 Message Date
phosit
d3406f4509
Extend appdata.xml for 0.28.0
(cherry picked from commit 354ed957dc)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-11 18:40:46 +01:00
joeybadz
adb6a05ae7
Remove duplicate fertility festival tech in German tech tree
(cherry picked from commit c6b8593bdf)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-11 18:16:35 +01:00
Vladislav Belov
e590a7cd4e
Replaces choosedDeviceIt by chosenDeviceIt
(cherry picked from commit c0ea17f06e)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-11 18:16:35 +01:00
Vladislav Belov
8420377789
Disables Vulkan devices sorting by default
Currently we always choose the best device. But it's not always
desirable. A more safe approach is to use the default device (with
index 0). The only downside of that is if a user didn't adjust
settings then the game might run on an integrated GPU instead of a
discrete one. In the future it'll be solved by selecting GPU in
options: #8529

Fixes #8455

(cherry picked from commit 485200342d)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-11 18:16:34 +01:00
obelix
fbc1b160e1
Change BuildTime of Gaul Arrow Ship
(cherry picked from commit 479995bc6f)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-11 18:16:34 +01:00
obelix
e07aba6d37
Change BuildTime of Brit Arrow Ship
(cherry picked from commit 90847e0591)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-11 18:16:34 +01:00
Vantha
2de2084b5b
Improve the SpecificName of Celtic civilians
While "Brogiacos" and "Tegesacos" fit in terms of meaning, they are only
reconstructed words, "Ambactos" on the other hand is attested and
actually historically relevant.

(cherry picked from commit 19f6dd031d)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-11 18:16:34 +01:00
Ralph Sennhauser
526deb30f0
Fix reloading config for cinema
This fixes 7df7566d7c, which added
automatic switching off silhouettes in cinema mode while resetting the
value when leaving cinema mode. Reloading can only be done for a given
config namespace.

Fixes: #7552
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
(cherry picked from commit 32edc28cda)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-11 18:16:34 +01:00
Vladislav Belov
1e1db43854
Adds an option to destroy Vulkan old swapchain before
Now it's possible to destroy the old swapchain before creating a new
one. It might make the swapchain creation a bit slower but with a
lower memory peak.

(cherry picked from commit c4bc6c9627)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-10 20:15:31 +01:00
Vladislav Belov
b08f2d1d33
Waits Vulkan device idle also on window resize
Fixes the case when a swapchain was recreated on resize rather than
by VK_ERROR_OUT_OF_DATE_KHR.

(cherry picked from commit 8a64182ca2)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-10 20:15:31 +01:00
Vladislav Belov
d4736962ab
Deletes Vulkan resources on swapchain recreation
The change tries to minimize a memory peak during a window resizing.

Refs #6864

(cherry picked from commit de36c75023)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-10 20:15:31 +01:00
Vantha
68a7d8a03a
Provide context for the translation of "Germans"
(cherry picked from commit be83ba4029)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-10 20:15:31 +01:00
Vantha
c0d569162b
Improve the description of the Germans' civ bonus
Importantly, the word "Germans" is removed since it is prone to being
translated incorrectly and the other civ bonus descriptions don't
contain the civ's name either.

(cherry picked from commit 5d4eab73f9)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-10 20:15:31 +01:00
Vantha
6043ab248b
Add SpecificNames to the Germanic units
The names are in Proto-Germanic and mostly taken from Wiktionary.
They can be confirmed by directly searching the individual
Proto-Germanic terms online.

Champion Cavalry: "Aþalaridjô" (noble+rider)
Cavalry Spearman: "Gaizaridjô" (spear+rider)
Cavalry Javelineer: "Skeutaridjô" (quick+rider)
Worker: "Būraz" (dweller, farmer) -- deliberately decided against the most literal translation,
	which would be "Arbijaz", because that seems to be more connected to serfdom and the unit
	rather represents a generic commoner.
Infantry Swordsman: "Swerdamannaz" (sword+man)
Infantry Spearman: "Gaizamannaz" (spear+man)
Infantry Clubman: "Kulbawigô" (staff/club+warrior)
Infantry Javelineer: "Gaizawerpanaz" (spear/javelin+thrower)
Infantry Slinger: "Slingwanaz" (swinger/slinger)
Scout Ship: "Skeutabaitaz" (quick+boat)
Fishing Boat: "Fiskārijaz" (fisherman)
Fire Ship: "Brandabaitaz" (fire+boat)
Arrow Ship: "Harjaskipą" (army/war+ship)
Wagon: "Wagnaz" (direct translation)
Priest: "Gudjô" (direct translation)
Ram: "Rammabagmaz" (strong+tree/beam)
Trader: "Kaupô" (direct translation, also part of the word used for the market)
Merchant(ship): "Mangārī" (direct translation, very similar to "Kaupô")

(cherry picked from commit f38bc89611)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-10 20:15:31 +01:00
Vantha
6958a5edd0
Correct an overlooked 'Women' to 'Workers'
(cherry picked from commit 05b1ac4559)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-10 20:15:31 +01:00
Vantha
86bcb03f6e
Remove incorrect Germanic SpecificName
The SpecificName tag is meant to contain the name in the civ's native
language, Proto-Germanic for the Germans.
"Kriegsschiff", "Übungsbereich" and "Stadttor" on the other hand are
modern German words.

(cherry picked from commit a71688fc2c)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-10 20:15:31 +01:00
Vantha
f6a6c19132
Convert wrong Germanic SpecificNames to GenericNames
SpecificNames are meant to contain the names in the civ's native
language. The English names are supposed to in be the GenericName tag.

(cherry picked from commit 4d9fc0bb53)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-10 20:15:30 +01:00
Vladislav Belov
76337efe76
Fixes missing Vulkan application version
Missing after dc830ccf55.

(cherry picked from commit 8b1b1d28f8)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-10 20:15:30 +01:00
Stan
93fecf3720
Add credits for Obskurias
(cherry picked from commit 93706ae37c)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-10 20:15:30 +01:00
Vantha
df8b313a74
Add a sandbox map for the Germans
(cherry picked from commit 75feace618)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-05 14:20:35 +01:00
real_tabasco_sauce
e65e031344
adjust corsica vs sard
(cherry picked from commit 83dba854e5)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-05 14:20:35 +01:00
phosit
83832545ae
Add Boiorix as the codename for Release 28
(cherry picked from commit 9588da1d94)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-02 21:54:37 +01:00
real_tabasco_sauce
0b7323c096
Fix market exploit by basing the price change on the amount purchased.
Fix credit to Atrik
Credit for test fix goes to Itms

Fixes #6760

(cherry picked from commit 94d3699ce4)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-31 13:43:50 +01:00
Ralph Sennhauser
d503ae6da6
Replace boost::filesystem std::filyestem
Bumping the minimum version of macOS to 10.15 for spidermonky [1] also
allows us to use std::filesystem instead of boosts implementation.

[1] f14a98e26f

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
(cherry picked from commit eba8439295)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-31 13:43:50 +01:00
Ralph Sennhauser
48b9be5bb6
Require boost-1.69, drop boost_system lib
Boost 1.89 no longer offers the deprecated library for boost_system [1], so
drop it from the list of libraries to link against. This effectively
bumps the minimum required boost version to 1.69 [2].

[1] 7a495bb46d
[1] 2fa0a00583

Fixes: #8471
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
(cherry picked from commit 618ffc7bf9)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-31 13:43:50 +01:00
Ralph Sennhauser
a7f6171063
Do not require literal message ids in Atlas
In >=wxWidgets-3.3 there is a new static check for literal message
ids[1] so that xgettext would reliable work to extract strings to
translate. As we don't translate Atlas at all nor use xgettext just
disable the check to allow building against >=wxWidgets-3.3.

[1] https://wxwidgets.org/help/msgid-literals/

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
(cherry picked from commit e97f43b692)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-31 13:43:50 +01:00
phosit
8f4750db15
Remove the relaypoint before training units
While not as efficient this order is easier to reason and let's player
pause.

(cherry picked from commit 75805f4b23)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-31 13:43:50 +01:00
phosit
39a5a680d2
Rewrite the phrase about production availability
It's easier to understand and to translate in a language where a
formulation with "Respectively" is not common.

(cherry picked from commit e195c52e30)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-31 13:43:50 +01:00
phosit
61af0a0c26
Rewrite the phrase about building multiple houses
It was hard to understand.

(cherry picked from commit c3727a6a79)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-31 13:43:50 +01:00
phosit
53c806c0c4
Replace hunt by slaughter in phrase about chicken
It's not really hunting when nobody flees.
"Slaughter" is used later when talking about the same action.

(cherry picked from commit 727be2fb45)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-31 13:43:50 +01:00
phosit
b5bf9fd3e2
Replace civ by player in phrase about color
The color is not specivic to the civ but to the player.

(cherry picked from commit a6e4e22ca2)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-31 13:43:50 +01:00
phosit
7a72578517
Don't hardcode Shift as a hotkey in tutorial
It's not possible to format warnings. "a hotkey" is used instead.

Also when the hoplite icon is pressed, without using batches, the
warning doesn't restate that the hopplite should be pressed.

(cherry picked from commit 29ac569511)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-31 13:43:49 +01:00
phosit
1db46eaf9b
Replace "I" with the hotkey in eco walkthrough
(cherry picked from commit 4f38600c39)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-31 13:43:49 +01:00
phosit
819a875fcc
Only make existing Civilians invulnerable
On "Survival of the Fittest" the treasure-collector are made
invulnerable.
Thous Civilian might not exist when the player is removed.

Fixes: #8421
(cherry picked from commit e0481b283b)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-31 13:43:49 +01:00
Itms
1b50d731fc
Store NSIS registry keys under a consistent root
Reviewed-At: https://gitea.wildfiregames.com/0ad/0ad/pulls/8476
(cherry picked from commit 4716a230ab)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-31 13:43:49 +01:00
Itms
621aa9d7a9
Wipe NSIS install preferences when uninstalling
The user language and start menu folder name were saved, which goes
against recommendations in the NSIS documentation.

The installation directory was also saved, which might make sense,
but prevents us from dropping the "alpha" label.

Reviewed-At: https://gitea.wildfiregames.com/0ad/0ad/pulls/8476
Fixes: #7594
(cherry picked from commit 18df61517c)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-31 13:43:49 +01:00
Itms
6a6712799c
Fix install and Start Menu folder names on Windows
Those cannot end with a period.

Reviewed-At: https://gitea.wildfiregames.com/0ad/0ad/pulls/8476
(cherry picked from commit f772181501)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-31 13:43:49 +01:00
Itms
a7f0678dad
Add an engine "compatible" version
When a patch version is released, it must declare compatibility with the
previous patch versions of the same main release. This allows players to
keep replaying their games and to keep playing online with users of
other patches of the same main release.

This should have anticipated for dae7a8c394

(cherry picked from commit 866d6f0527)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-31 13:43:49 +01:00
Itms
4fca5ed21c
Use the PYROGENESIS_VERSION macro instead of a global
Reviewed-At: https://gitea.wildfiregames.com/0ad/0ad/pulls/8222
(cherry picked from commit 50f6da2a13)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-31 13:43:49 +01:00
Itms
abc83a7dfb
Address cppcheck uninitialized warning
Reviewed-At: https://gitea.wildfiregames.com/0ad/0ad/pulls/8222
(cherry picked from commit f0c8db6422)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-31 13:43:48 +01:00
Vladislav Belov
52e6d08e79
Fixes lseek for big files on Windows
It was broken in ef69c37f66, before that we were using _lseeki64.

Fixes #8459

(cherry picked from commit cb58116270)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-26 15:06:35 +01:00
Vantha
46e9585bce
PetraBot: Never play when the region analysis fails
If the region analysis at the start of the game fails, the bot can't
actually play and the managers aren't initialised. And to prevent errors
from the update functions, the OnUpdate at the root had an early return
if the entity count was 0. However, in some edge cases the region
analysis can fail even if the AI has entities.
This patch fixes this potential error by storing the result of the
region analysis directly and checking that instead.

(cherry picked from commit 7b1d4426aa)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-26 15:05:49 +01:00
Itms
8d05176032
Lock Linux CI cbindgen version and dependencies
This allows us to keep testing building with the minimal supported
Rust version.

(cherry picked from commit 59d28fed9b)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-26 15:03:08 +01:00
abian
41dac8bb20
Hide Abort Unit Order button when idle or guarding
Reviewed-By: bb
Fixes #6854

(cherry picked from commit 95467c2327)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-26 15:02:34 +01:00
Timothy Pearson
9dee4e4617
Fix FTBFS on ppc64le systems
Tested to compile and function normally under Debian Trixie ppc64le / POWER9

Signed-off-by: Timothy Pearson <tpearson@raptorcs.com>
(cherry picked from commit 2c9928e4cb)
Signed-off-by: phosit <phosit@autistici.org>
2025-10-26 15:00:27 +01:00
Ralph Sennhauser
981b3b898e
Support running individual tests or suites
Add back some functionality that got dropped with the move to a custom
runner in 39ea3b6ea5

Add option --list to print all available test grouped by suite.

Add option --suite to limit the run to a specific testsuite.

Add option --test to limit the run to a specific test.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
(cherry picked from commit a7d65d4a34)
2025-10-17 13:31:20 +02:00
phosit
d3239591b8
Bump copyright year for windows build 2025-10-15 17:58:23 +02:00
2365 changed files with 31925 additions and 26682 deletions

View file

@ -28,9 +28,9 @@ source/tools/spirv/.* @vladislavbelov
## == Scripts
## GUI
binaries/data/mods/public/gui/.* @Vantha @wraitii
binaries/data/mods/public/gui/.* @Phosit @wraitii
## AI
binaries/data/mods/public/simulation/ai/.* @Phosit
#binaries/data/mods/public/simulation/ai/.*
## Balancing
binaries/data/mods/public/simulation/(data|templates)/.* @real_tabasco_sauce

3
.gitignore vendored
View file

@ -14,7 +14,6 @@ libraries/macos
libraries/win32
libraries/win64
libraries/source/cpp-httplib/*
libraries/source/cxxtest-4.4/*
libraries/source/fcollada/*
libraries/source/nvtt/*
@ -29,7 +28,7 @@ libraries/source/spirv-reflect/*
appimage-build/
archives/
build/bin/
source/tools/spirv/rules.json
source/tools/spirv/rules.*.json
# Linting
cppcheck-error.log

View file

@ -83,12 +83,13 @@ repos:
args:
- --strict
- repo: https://github.com/eslint/eslint
rev: v9.39.2
rev: v9.33.0
hooks:
- id: eslint
language_version: 22.14.0
additional_dependencies:
- "@stylistic/eslint-plugin@5.6.1"
- eslint-plugin-brace-rules@0.1.6
- "@stylistic/eslint-plugin@4.4.0"
args:
- --max-warnings=0
- --no-warn-ignored

View file

@ -81,6 +81,9 @@ please inform Wildfire Games at webmaster at wildfiregames dot com.
- source/third_party/mikktspace/
- zlib
- source/third_party/mongoose/
- MIT - see license_mit.txt
- source/third_party/tinygettext/
- zlib

View file

@ -160,15 +160,6 @@ textures.maxanisotropy = 2
; GPU skinning via compute shaders, requires up-to-date drivers
gpuskinning = true
; Currently experimental feature to transit to PBR pipelines.
pbr = false
; We might want to render to different texture formats depending on quality and
; performance we need. We support: r11g11b10, rgba16, rgba32.
pbr.framebufferformat = "rgba16"
; Adjust exposure of the scene.
pbr.brightness = "0.5"
; Use smooth LOS interpolation
smoothlos = true
@ -225,19 +216,13 @@ 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
mousegrabtoggle = F3 ; Toggle mouse grabbing mode
mousegrabtoggle = "Ctrl+Alt" ; Toggle mouse grabbing mode
; > 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
catafalque = "Alt+Shift+F" ; Show catafalque overview
mapbrowser = "Alt+Shift+M" ; Show map browser
manual = "Alt+Shift+U" ; Show manual
tips = "Alt+Shift+I" ; Show tips and tricks
options = "Alt+Shift+O" ; Show options
hotkeys = "Alt+Shift+Y" ; Show hotkeys
; > CLIPBOARD CONTROLS
copy = "Ctrl+C" ; Copy to clipboard
@ -245,7 +230,7 @@ paste = "Ctrl+V" ; Paste from clipboard
cut = "Ctrl+X" ; Cut selected text and copy to the clipboard
; > CONSOLE SETTINGS
console.toggle = F9 ; Open/close console
console.toggle = BackQuote, F9 ; Open/close console
; > OVERLAY KEYS
fps.toggle = "Alt+F" ; Toggle frame counter
@ -266,8 +251,8 @@ quickload = "Shift+F8"
reset = "R" ; Reset camera rotation to default.
follow = "" ; Follow the first unit in the selection
rallypointfocus = "" ; Focus the camera on the rally point of the selected building
lastattackfocus = BackQuote ; Focus the camera on the last notified attack
togglebirdseyeview = "Shift+Tab" ; Toggle bird's eye view
lastattackfocus = "Space" ; Focus the camera on the last notified attack
togglebirdseyeview = "" ; Toggle bird's eye view
zoom.in = Plus, NumPlus ; Zoom camera in (continuous control)
zoom.out = Minus, NumMinus ; Zoom camera out (continuous control)
zoom.wheel.in = WheelUp ; Zoom camera in (stepped control)
@ -283,12 +268,12 @@ 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+Plus" ; Increase scroll speed
scroll.speed.decrease = "Ctrl+Minus" ; Decrease scroll speed
rotate.speed.increase = "Alt+Plus" ; Increase rotation speed
rotate.speed.decrease = "Alt+Minus" ; Decrease rotation speed
zoom.speed.increase = "Shift+Plus" ; Increase zoom speed
zoom.speed.decrease = "Shift+Minus" ; Decrease zoom speed
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
@ -333,12 +318,6 @@ idlewarrior = Slash, NumDivide ; Select next idle warrior
idleunit = BackSlash ; Select next idle unit
offscreen = Alt ; Include offscreen units in selection
singleselection = "" ; Modifier to select units individually, opposed to per formation.
; Select all units of specific class
[hotkey.selection.unit]
cavalry = Alt+E
infantry = Alt+X
civilian = Alt+A
hero = Alt+Z
[hotkey.selection.group.add]
1 = "Shift+1", "Shift+Num1"
2 = "Shift+2", "Shift+Num2"
@ -372,27 +351,9 @@ hero = Alt+Z
8 = 8, Num8
9 = 9, Num9
10 = 0, Num0
[hotkey.selection.structures]
barracks = "Ctrl+X"
stable = "Ctrl+Z"
civil_centre = "Ctrl+C"
[hotkey.structures.place]
house = "Space+H"
storehouse = "Space+S"
farmstead = "Space+G"
field = "Space+F"
corral = "Space+J"
barracks = "Space+B"
stable = "Space+V"
temple = "Space+T"
arsenal = "Space+A"
fortress = "Space+F"
forge = "Space+K"
sentry_tower = "Space+Q"
defense_tower = "Space+W"
market = "Space+M"
dock = "Space+D"
[hotkey.gamesetup]
mapbrowser.open = "M"
[hotkey.session]
kill = Delete, Backspace ; Destroy selected units
@ -431,14 +392,14 @@ flareactivate = "" ; Modifier to activate the mode to send a flare to
calltoarms = "" ; Modifier to call the selected units to the arms.
focusfire = "F" ; Modifier to control exclusively a building's arrows if it can attack
; Overlays
showstatusbars = "" ; Toggle display of status bars
devcommands.toggle = "Shift+F9" ; Toggle developer commands panel
highlightguarding = PageDown ; Toggle highlight of guarding units
highlightguarded = PageUp ; Toggle highlight of guarded units
diplomacycolors = "Alt+V" ; Toggle diplomacy colors
toggleattackrange = "" ; Toggle display of attack range overlays of selected defensive structures
toggleaurasrange = "" ; Toggle display of aura range overlays of selected units and structures
togglehealrange = "" ; Toggle display of heal range overlays of selected units
showstatusbars = Tab ; Toggle display of status bars
devcommands.toggle = "Alt+D" ; Toggle developer commands panel
highlightguarding = PageDown ; Toggle highlight of guarding units
highlightguarded = PageUp ; 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
@ -555,7 +516,7 @@ extended = true ; Whether to display the chat history
[lobby]
history = 0 ; Number of past messages to display on join
room = "arena29" ; Default MUC room to join
room = "arena28" ; 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 = true ; Whether to reject connecting to the lobby if the TLS certificate is invalid
@ -563,8 +524,8 @@ terms_url = "https://gitea.wildfiregames.com/0ad/0ad/src/branch/main/binaries/da
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 = "wfgbot29" ; Name of the server-side XMPP-account that manage games
echelon = "echelon29" ; Name of the server-side XMPP-account that manages ratings
xpartamupp = "wfgbot28" ; Name of the server-side XMPP-account that manage games
echelon = "echelon28" ; 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

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<objects>
<script file="gui/OpenRequest/Continuation/Script.js"/>
</objects>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<page>
<include>OpenRequest/Continuation/Object.xml</include>
</page>

View file

@ -1,4 +0,0 @@
async function init(arg)
{
return arg + " Continuation";
}

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<objects>
<script file="gui/OpenRequest/Entry/Script.js"/>
</objects>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<page>
<include>OpenRequest/Entry/Object.xml</include>
</page>

View file

@ -1,7 +0,0 @@
async function init()
{
return { [Engine.openRequest]: {
"page": "OpenRequest/Continuation/Page.xml",
"argument": "Entry"
} };
}

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<objects>
<script file="gui/OpenRequest/Root/Script.js"/>
</objects>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<page>
<include>OpenRequest/Root/Object.xml</include>
</page>

View file

@ -1,13 +0,0 @@
async function init()
{
const result = await Engine.OpenChildPage("OpenRequest/Entry/Page.xml");
await new Promise(closePageCallback =>
{
globalThis.closePageCallback = () =>
{
closePageCallback();
return result;
};
});
}

View file

@ -6,8 +6,7 @@ var obj1 = Engine.GetGUIObjectByName("obj1");
var obj3 = Engine.GetGUIObjectByName("obj3");
obj1.onTick = () => { ++called1; };
Engine.GetGUIObjectByName("obj2").onTick = () =>
{
Engine.GetGUIObjectByName("obj2").onTick = () => {
++called2;
delete obj1.onTick;
delete obj3.onTick;

View file

@ -1 +0,0 @@
testObject.getComputedSize();

View file

@ -2,7 +2,7 @@ try
{
Engine.callback();
}
catch(e)
catch (e)
{
log(e.message);
}

View file

@ -13,8 +13,7 @@ async function waitAndIncrement(promise)
{
let resolve;
const promise = new Promise(res =>
{
const promise = new Promise(res => {
incrementTest();
resolve = res;
});

View file

@ -2,13 +2,11 @@ function TestScript2A() {}
TestScript2A.prototype.Schema = "<ref name='anything'/>";
TestScript2A.prototype.Init = function()
{
TestScript2A.prototype.Init = function() {
this.x = eval(this.template.y);
};
TestScript2A.prototype.GetX = function()
{
TestScript2A.prototype.GetX = function() {
return this.x;
};

View file

@ -1,20 +1,15 @@
function TestScript1A() {}
TestScript1A.prototype.GetX = function()
{
TestScript1A.prototype.GetX = function() {
// Test that .entity is readonly
try
{
try {
delete this.entity;
Engine.TS_FAIL("Missed exception");
}
catch(e) { /* noop */ }
try
{
} catch (e) { /* noop */ }
try {
this.entity = -1;
Engine.TS_FAIL("Missed exception");
}
catch(e) { /* noop */ }
} catch (e) { /* noop */ }
// and return the value
return this.entity;

View file

@ -1,7 +1,6 @@
function TestScript1_Helper() {}
TestScript1_Helper.prototype.GetX = function()
{
TestScript1_Helper.prototype.GetX = function() {
return AdditionHelper(1, 2);
};

View file

@ -2,13 +2,11 @@ function HotloadA() {}
HotloadA.prototype.Schema = "<ref name='anything'/>";
HotloadA.prototype.Init = function()
{
HotloadA.prototype.Init = function() {
this.x = +this.template.x;
};
HotloadA.prototype.GetX = function()
{
HotloadA.prototype.GetX = function() {
return this.x;
};
@ -17,13 +15,11 @@ Engine.RegisterComponentType(IID_Test1, "HotloadA", HotloadA);
function HotloadB() {}
HotloadB.prototype.Init = function()
{
HotloadB.prototype.Init = function() {
this.x = +this.template.x;
};
HotloadB.prototype.GetX = function()
{
HotloadB.prototype.GetX = function() {
return this.x * 2;
};

View file

@ -2,13 +2,11 @@ function HotloadA() {}
HotloadA.prototype.Schema = "<ref name='anything'/>";
HotloadA.prototype.Init = function()
{
HotloadA.prototype.Init = function() {
this.x = +this.template.x;
};
HotloadA.prototype.GetX = function()
{
HotloadA.prototype.GetX = function() {
return this.x*10;
};

View file

@ -2,13 +2,11 @@ function Modding() {}
Modding.prototype.Schema = "<ref name='anything'/>";
Modding.prototype.Init = function()
{
Modding.prototype.Init = function() {
this.x = +this.template.x;
};
Modding.prototype.GetX = function()
{
Modding.prototype.GetX = function() {
return this.x;
};

View file

@ -1,5 +1,4 @@
Modding.prototype.GetX = function()
{
Modding.prototype.GetX = function() {
return this.x * 10;
};

View file

@ -1,17 +1,14 @@
function TestScript1A() {}
TestScript1A.prototype.Init = function()
{
TestScript1A.prototype.Init = function() {
this.x = 100;
};
TestScript1A.prototype.GetX = function()
{
TestScript1A.prototype.GetX = function() {
return this.x;
};
TestScript1A.prototype.OnUpdate = function(msg)
{
TestScript1A.prototype.OnUpdate = function(msg) {
this.x += msg.turnLength;
};
@ -21,18 +18,15 @@ Engine.RegisterComponentType(IID_Test1, "TestScript1A", TestScript1A);
function TestScript1B() {}
TestScript1B.prototype.Init = function()
{
TestScript1B.prototype.Init = function() {
this.x = 100;
};
TestScript1B.prototype.GetX = function()
{
TestScript1B.prototype.GetX = function() {
return this.x;
};
TestScript1B.prototype.OnGlobalUpdate = function(msg)
{
TestScript1B.prototype.OnGlobalUpdate = function(msg) {
this.x += msg.turnLength;
};
@ -42,13 +36,11 @@ Engine.RegisterComponentType(IID_Test1, "TestScript1B", TestScript1B);
function TestScript2A() {}
TestScript2A.prototype.Init = function()
{
TestScript2A.prototype.Init = function() {
this.x = 200;
};
TestScript2A.prototype.GetX = function()
{
TestScript2A.prototype.GetX = function() {
Engine.BroadcastMessage(MT_Update, { "turnLength": 50 });
Engine.PostMessage(1, MT_Update, { "turnLength": 500 });
Engine.PostMessage(2, MT_Update, { "turnLength": 5000 });

View file

@ -1,7 +1,6 @@
function TestScript1_Init() {}
TestScript1_Init.prototype.Init = function()
{
TestScript1_Init.prototype.Init = function() {
var param = this.template;
// print("# ",uneval(param),"\n");
if (param)
@ -10,8 +9,7 @@ TestScript1_Init.prototype.Init = function()
this.x = 100;
};
TestScript1_Init.prototype.GetX = function()
{
TestScript1_Init.prototype.GetX = function() {
return this.x;
};
@ -21,18 +19,12 @@ Engine.RegisterComponentType(IID_Test1, "TestScript1_Init", TestScript1_Init);
function TestScript1_readonly() {}
TestScript1_readonly.prototype.GetX = function()
{
try { this.template = null; }
catch(e) { /* noop */ }
try { delete this.template; }
catch(e) { /* noop */ }
try { this.template.x += 1000; }
catch(e) { /* noop */ }
try { delete this.template.x; }
catch(e) { /* noop */ }
try { this.template.y = 2000; }
catch(e) { /* noop */ }
TestScript1_readonly.prototype.GetX = function() {
try { this.template = null; } catch (e) { /* noop */ }
try { delete this.template; } catch (e) { /* noop */ }
try { this.template.x += 1000; } catch (e) { /* noop */ }
try { delete this.template.x; } catch (e) { /* noop */ }
try { this.template.y = 2000; } catch (e) { /* noop */ }
return +(this.template.x || 1) + +(this.template.y || 2);
};

View file

@ -1,12 +1,10 @@
function TestScript1A() {}
TestScript1A.prototype.Init = function()
{
TestScript1A.prototype.Init = function() {
this.x = 100;
};
TestScript1A.prototype.GetX = function()
{
TestScript1A.prototype.GetX = function() {
var test2 = Engine.QueryInterface(this.entity, IID_Test2);
return test2.GetX() + (test2.x || 0);
};
@ -17,13 +15,11 @@ Engine.RegisterComponentType(IID_Test1, "TestScript1A", TestScript1A);
function TestScript2A() {}
TestScript2A.prototype.Init = function()
{
TestScript2A.prototype.Init = function() {
this.x = 200;
};
TestScript2A.prototype.GetX = function()
{
TestScript2A.prototype.GetX = function() {
return this.x;
};

View file

@ -1,14 +1,12 @@
function TestScript1_values() {}
TestScript1_values.prototype.Init = function()
{
TestScript1_values.prototype.Init = function() {
this.x = +this.template.x;
this.str = "this is a string";
this.things = { "a": 1, "b": "2", "c": [3, "4", [5, []]] };
};
TestScript1_values.prototype.GetX = function()
{
TestScript1_values.prototype.GetX = function() {
// print(uneval(this));
return this.x;
};
@ -19,21 +17,16 @@ Engine.RegisterComponentType(IID_Test1, "TestScript1_values", TestScript1_values
function TestScript1_entity() {}
TestScript1_entity.prototype.GetX = function()
{
TestScript1_entity.prototype.GetX = function() {
// Test that .entity is readonly
try
{
try {
delete this.entity;
Engine.TS_FAIL("Missed exception");
}
catch(e) { /* OK */ }
try
{
} catch (e) { /* OK */ }
try {
this.entity = -1;
Engine.TS_FAIL("Missed exception");
}
catch(e) { /* OK */ }
} catch (e) { /* OK */ }
// and return the value
return this.entity;
@ -45,15 +38,13 @@ Engine.RegisterComponentType(IID_Test1, "TestScript1_entity", TestScript1_entity
function TestScript1_nontree() {}
TestScript1_nontree.prototype.Init = function()
{
TestScript1_nontree.prototype.Init = function() {
var n = [1];
this.x = [n, n, null, { "y": n }];
this.x[2] = this.x;
};
TestScript1_nontree.prototype.GetX = function()
{
TestScript1_nontree.prototype.GetX = function() {
// print(uneval(this)+"\n");
this.x[0][0] += 1;
return this.x[0][0] + this.x[1][0] + this.x[2][0][0] + this.x[3].y[0];
@ -65,18 +56,15 @@ Engine.RegisterComponentType(IID_Test1, "TestScript1_nontree", TestScript1_nontr
function TestScript1_custom() {}
TestScript1_custom.prototype.Init = function()
{
TestScript1_custom.prototype.Init = function() {
this.y = 2;
};
TestScript1_custom.prototype.Serialize = function()
{
TestScript1_custom.prototype.Serialize = function() {
return { "c": 1 };
};
TestScript1_custom.prototype.Deserialize = function(data)
{
TestScript1_custom.prototype.Deserialize = function(data) {
this.c = data.c;
};
@ -86,8 +74,7 @@ Engine.RegisterComponentType(IID_Test1, "TestScript1_custom", TestScript1_custom
function TestScript1_getter() {}
TestScript1_getter.prototype.Init = function()
{
TestScript1_getter.prototype.Init = function() {
this.x = 100;
this.__defineGetter__('x', function() { print("FAIL\n"); die(); return 200; });
};
@ -100,20 +87,17 @@ function TestScript1_consts() {}
TestScript1_consts.prototype.Schema = "<ref name='anything'/>";
TestScript1_consts.prototype.Init = function()
{
TestScript1_consts.prototype.Init = function() {
this.cached = (+this.entity) + (+this.template.x);
};
TestScript1_consts.prototype.Serialize = null;
TestScript1_consts.prototype.Deserialize = function(data)
{
TestScript1_consts.prototype.Deserialize = function(data) {
this.Init();
};
TestScript1_consts.prototype.GetX = function()
{
TestScript1_consts.prototype.GetX = function() {
return this.cached;
};

View file

@ -1,17 +1,14 @@
function TestScript1A() {}
TestScript1A.prototype.Init = function()
{
TestScript1A.prototype.Init = function() {
this.x = 101000;
};
TestScript1A.prototype.GetX = function()
{
TestScript1A.prototype.GetX = function() {
return this.x;
};
TestScript1A.prototype.OnTurnStart = function(msg)
{
TestScript1A.prototype.OnTurnStart = function(msg) {
this.x += 1;
};
@ -23,8 +20,7 @@ function TestScript1B() {}
TestScript1B.prototype = Object.create(TestScript1A.prototype);
TestScript1B.prototype.Init = function()
{
TestScript1B.prototype.Init = function() {
this.x = 102000;
};
@ -34,18 +30,15 @@ Engine.RegisterComponentType(IID_Test1, "TestScript1B", TestScript1B);
function TestScript2A() {}
TestScript2A.prototype.Init = function()
{
TestScript2A.prototype.Init = function() {
this.x = 201000;
};
TestScript2A.prototype.GetX = function()
{
TestScript2A.prototype.GetX = function() {
return this.x;
};
TestScript2A.prototype.OnUpdate = function(msg)
{
TestScript2A.prototype.OnUpdate = function(msg) {
this.x += msg.turnLength;
};

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<material>
<required_texture name="baseTex"/>
<shader pass="main" effect="dummy"/>
<shader effect="dummy"/>
</material>

View file

@ -24,23 +24,9 @@
<empty/>
</element>
</optional>
<oneOrMore>
<element name="shader">
<attribute name="effect"/>
<attribute name="pass">
<choice>
<value>main</value>
<value>shadow_caster</value>
<value>silhouette_occluder</value>
<value>silhouette_caster</value>
<value>wireframe</value>
<value>wireframe_solid</value>
<value>reflections</value>
<value>refractions</value>
</choice>
</attribute>
</element>
</oneOrMore>
<element name="shader">
<attribute name="effect"/>
</element>
<zeroOrMore>
<element name="define">
<attribute name="name"/>

View file

@ -1,8 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<material>
<shader pass="main" effect="terrain_base"/>
<shader pass="reflections" effect="terrain_base_reflections"/>
<shader pass="refractions" effect="terrain_base"/>
<shader pass="wireframe" effect="terrain_base_wireframe"/>
<shader effect="terrain_base"/>
<required_texture name="baseTex"/>
</material>

View file

@ -4,9 +4,6 @@
<required_texture name="baseTex"/>
<required_texture name="normTex" define="USE_NORMAL_MAP"/>
<required_texture name="specTex" define="USE_SPECULAR_MAP"/>
<shader pass="main" effect="terrain_base"/>
<shader pass="reflections" effect="terrain_base_reflections"/>
<shader pass="refractions" effect="terrain_base"/>
<shader pass="wireframe" effect="terrain_base_wireframe"/>
<shader effect="terrain_base"/>
<uniform name="effectSettings" value="1.0 15.0 0.0"/>
</material>

View file

@ -4,9 +4,6 @@
<required_texture name="baseTex"/>
<required_texture name="normTex" define="USE_NORMAL_MAP"/>
<required_texture name="specTex" define="USE_SPECULAR_MAP"/>
<shader pass="main" effect="terrain_base"/>
<shader pass="reflections" effect="terrain_base_reflections"/>
<shader pass="refractions" effect="terrain_base"/>
<shader pass="wireframe" effect="terrain_base_wireframe"/>
<shader effect="terrain_base"/>
<uniform name="effectSettings" value="1.2 15.0 0.0"/>
</material>

View file

@ -4,9 +4,6 @@
<required_texture name="baseTex"/>
<required_texture name="normTex" define="USE_NORMAL_MAP"/>
<required_texture name="specTex" define="USE_SPECULAR_MAP"/>
<shader pass="main" effect="terrain_base"/>
<shader pass="reflections" effect="terrain_base_reflections"/>
<shader pass="refractions" effect="terrain_base"/>
<shader pass="wireframe" effect="terrain_base_wireframe"/>
<shader effect="terrain_base"/>
<uniform name="effectSettings" value="0.8 15.0 0.0"/>
</material>

View file

@ -3,9 +3,6 @@
<alternative material="terrain_base.xml" quality="1"/>
<define name="USE_TRIPLANAR" value="1"/>
<required_texture name="baseTex"/>
<shader pass="main" effect="terrain_base"/>
<shader pass="reflections" effect="terrain_base_reflections"/>
<shader pass="refractions" effect="terrain_base"/>
<shader pass="wireframe" effect="terrain_base_wireframe"/>
<shader effect="terrain_base"/>
<uniform name="effectSettings" value="1.0 15.0 0.0"/>
</material>

View file

@ -5,9 +5,6 @@
<required_texture name="baseTex"/>
<required_texture name="normTex" define="USE_NORMAL_MAP"/>
<required_texture name="specTex" define="USE_SPECULAR_MAP"/>
<shader pass="main" effect="terrain_base"/>
<shader pass="reflections" effect="terrain_base_reflections"/>
<shader pass="refractions" effect="terrain_base"/>
<shader pass="wireframe" effect="terrain_base_wireframe"/>
<shader effect="terrain_base"/>
<uniform name="effectSettings" value="1.0 15.0 0.0"/>
</material>

View file

@ -41,8 +41,7 @@ export async function init(initialColor)
const splitColor = initialColor.split(" ");
const chanels = labels.map((label, i) =>
{
const chanels = labels.map((label, i) => {
Engine.GetGUIObjectByName("colorLabel[" + i + "]").caption = label;
resizeChanel(i);
@ -71,10 +70,8 @@ export async function init(initialColor)
while (true)
{
colorDisplay.sprite = "color:" + currentColor();
const chanelPromises = chanels.map(chanel =>
{
return new Promise(resolve =>
{
const chanelPromises = chanels.map(chanel => {
return new Promise(resolve => {
chanel.slider.onValueChange = resolve.bind(undefined, { "value": chanel });
});
});

View file

@ -131,7 +131,7 @@
scrollbar_style="ModernScrollBar"
textcolor="white"
text_align="left"
text_valign="top"
text_valign="center"
sprite="ModernDarkBox"
sprite_overlay="ModernDarkBoxGoldBorder"
/>

View file

@ -23,10 +23,8 @@ function distributeButtonsHorizontally(button, captions)
function setButtonCaptionsAndVisibility(buttons, captions, cancelHotkey, name)
{
return new Promise(resolve =>
{
captions.forEach((caption, i) =>
{
return new Promise(resolve => {
captions.forEach((caption, i) => {
buttons[i] = Engine.GetGUIObjectByName(name + (i + 1));
buttons[i].caption = caption;
buttons[i].hidden = false;

View file

@ -89,7 +89,7 @@
</define>
<define name="font">
<data type="string">
<param name="pattern">[a-z]+-(bold-|italic-)?(stroke-)?[0-9]{1,3}</param>
<param name="pattern">(mono|sans)-(bold-|italic-)?(stroke-)?[0-9]{1,3}</param>
</data>
</define>
<define name="size">

View file

@ -3,8 +3,7 @@ var g_IncompatibleModsFile = "gui/incompatible_mods/incompatible_mods.txt";
function init(data)
{
Engine.GetGUIObjectByName("mainText").caption = Engine.TranslateLines(Engine.ReadFile(g_IncompatibleModsFile));
return new Promise(closePageCallback =>
{
return new Promise(closePageCallback => {
Engine.GetGUIObjectByName("btnClose").onPress = closePageCallback;
});
}

View file

@ -27,14 +27,12 @@ var g_ModIOState = {
/**
* Finished status indicators
*/
"ready": (progressData, closePageCallback) =>
{
"ready": (progressData, closePageCallback) => {
// GameID acquired, ready to fetch mod list
if (!g_RequestCancelled)
updateModList(closePageCallback);
},
"listed": progressData =>
{
"listed": progressData => {
// List of available mods acquired
// Only run this once (for each update).
@ -46,8 +44,7 @@ var g_ModIOState = {
g_ModsAvailableOnline = Engine.ModIoGetMods();
displayMods();
},
"success": progressData =>
{
"success": progressData => {
// Successfully acquired a mod file
hideDialog();
Engine.GetGUIObjectByName("downloadButton").enabled = true;
@ -55,24 +52,20 @@ var g_ModIOState = {
/**
* In-progress status indicators.
*/
"gameid": progressData =>
{
"gameid": progressData => {
// Acquiring GameID from mod.io
},
"listing": progressData =>
{
"listing": progressData => {
// Acquiring list of available mods from mod.io
},
"downloading": progressData =>
{
"downloading": progressData => {
// Downloading a mod file
updateProgressBar(progressData.progress, g_ModsAvailableOnline[selectedModIndex()].filesize);
},
/**
* Error/Failure status indicators.
*/
"failed_gameid": async(progressData, closePageCallback) =>
{
"failed_gameid": async(progressData, closePageCallback) => {
// Game ID couldn't be retrieved
const promise = showErrorMessageBox(
sprintf(translateWithContext("mod.io error message", "Game ID could not be retrieved.\n\n%(technicalDetails)s"), {
@ -87,8 +80,7 @@ var g_ModIOState = {
else
init();
},
"failed_listing": async(progressData, closePageCallback) =>
{
"failed_listing": async(progressData, closePageCallback) => {
// Mod list couldn't be retrieved
const promise = showErrorMessageBox(
sprintf(translateWithContext("mod.io error message", "Mod List could not be retrieved.\n\n%(technicalDetails)s"), {
@ -103,8 +95,7 @@ var g_ModIOState = {
else
updateModList(closePageCallback);
},
"failed_downloading": async(progressData) =>
{
"failed_downloading": async(progressData) => {
// File couldn't be retrieved
const promise = showErrorMessageBox(
sprintf(translateWithContext("mod.io error message", "File download failed.\n\n%(technicalDetails)s"), {
@ -119,8 +110,7 @@ var g_ModIOState = {
else
downloadMod();
},
"failed_filecheck": async(progressData) =>
{
"failed_filecheck": async(progressData) => {
// The file is corrupted
const promise = showErrorMessageBox(
sprintf(translateWithContext("mod.io error message", "File verification error.\n\n%(technicalDetails)s"), {
@ -136,8 +126,7 @@ var g_ModIOState = {
/**
* Default
*/
"none": progressData =>
{
"none": progressData => {
// Nothing has happened yet.
}
};
@ -155,8 +144,7 @@ function init(data)
return Promise.race([
promise,
new Promise(closePageCallback =>
{
new Promise(closePageCallback => {
Engine.GetGUIObjectByName("backButton").onPress = closePageCallback;
Engine.GetGUIObjectByName("modio").onTick = onTick.bind(null, closePageCallback);
})
@ -339,8 +327,7 @@ async function progressDialog(dialogCaption, dialogTitle, showProgressBar, butto
const downloadDialog_button = Engine.GetGUIObjectByName("downloadDialog_button");
downloadDialog_button.caption = buttonCaption;
await new Promise(resolve =>
{
await new Promise(resolve => {
downloadDialog_button.onPress = resolve;
});
cancelRequest();

View file

@ -1,8 +1,7 @@
function init(data)
{
Engine.GetGUIObjectByName("mainText").caption = Engine.TranslateLines(Engine.ReadFile("gui/modmod/help/help.txt"));
return new Promise(closePageCallback =>
{
return new Promise(closePageCallback => {
Engine.GetGUIObjectByName("closeButton").onPress = closePageCallback;
});
}

View file

@ -68,12 +68,8 @@ function init(data, hotloadData)
if (g_HasIncompatibleMods)
Engine.OpenChildPage("page_incompatible_mods.xml", {});
return new Promise(closePageCallback =>
{
return new Promise(closePageCallback => {
Engine.GetGUIObjectByName("quitButton").onPress = closePageCallback;
Engine.GetGUIObjectByName("cancelButton").onPress = closePageCallback.bind(undefined, {
[Engine.openRequest]: { "page": "page_pregame.xml" }
});
});
}
@ -296,6 +292,11 @@ function filterMod(folder)
return !negateFilter;
}
function closePage()
{
Engine.SwitchGuiPage("page_pregame.xml", {});
}
/**
* Moves an item in the list up or down.
*/

View file

@ -194,6 +194,7 @@
<object name="cancelButton" type="button" style="ModernButtonRed" size="100%-932 100%-44 100%-752 100%-16" hotkey="cancel">
<translatableAttribute id="caption">Cancel</translatableAttribute>
<action on="Press">closePage();</action>
</object>
<object type="button" style="ModernButtonRed" size="100%-748 100%-44 100%-568 100%-16">

View file

@ -9,6 +9,6 @@
scroll_bottom="true"
textcolor="white"
text_align="left"
text_valign="top"
text_valign="center"
/>
</styles>

View file

@ -5,7 +5,7 @@ const g_ModProperties = {
"type": "string",
"validate": validateName
},
// example: "0.29.0"
// example: "0.28.0"
"version": {
"required": true,
"type": "string",

View file

@ -1,7 +1,6 @@
async function init()
function init()
{
return { [Engine.openRequest]: {
"page": "page_modmod.xml",
"argument": { "cancelbutton": false }
} };
Engine.SwitchGuiPage("page_modmod.xml", {
"cancelbutton": false
});
}

View file

@ -21,8 +21,7 @@ async function init(data)
initURLButtons(data.termsURL, data.urlButtons);
initLanguageSelection();
const accepted = await new Promise(resolve =>
{
const accepted = await new Promise(resolve => {
Engine.GetGUIObjectByName("cancelButton").onPress = resolve.bind(null, false);
Engine.GetGUIObjectByName("connectButton").onPress = resolve.bind(null, true);
});
@ -41,16 +40,14 @@ function initURLButtons(termsURL, urlButtons)
"url": termsURL
});
urlButtons.forEach((urlButton, i) =>
{
urlButtons.forEach((urlButton, i) => {
const button = Engine.GetGUIObjectByName("button[" + i + "]");
button.caption = urlButton.caption;
button.hidden = false;
button.tooltip = sprintf(translate("Open %(url)s in the browser."), {
"url": urlButton.url
});
button.onPress = () =>
{
button.onPress = () => {
openURL(urlButton.url);
};
});
@ -65,8 +62,7 @@ function initLanguageSelection()
const languageDropdown = Engine.GetGUIObjectByName("languageDropdown");
languageDropdown.size = (languageLabelWidth + 10) + " 4 100% 100%";
languageDropdown.list = (() =>
{
languageDropdown.list = (() => {
const displayNames = Engine.GetSupportedLocaleDisplayNames();
const baseNames = Engine.GetSupportedLocaleBaseNames();
@ -84,8 +80,7 @@ function initLanguageSelection()
return list;
})();
languageDropdown.onSelectionChange = () =>
{
languageDropdown.onSelectionChange = () => {
Engine.GetGUIObjectByName("mainText").caption =
sprintf(
languageDropdown.selected == 1 ?

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2026 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -182,6 +182,7 @@ function RunDetection(settings)
var disable_shadowpcf;
var disable_allwater;
var disable_fancywater;
var enable_glsl;
var enable_postproc;
var enable_smoothlos;
var override_renderpath;
@ -213,6 +214,16 @@ function RunDetection(settings)
var GL_VERSION = settings.renderer_backend.GL_VERSION;
var GL_EXTENSIONS = settings.renderer_backend.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 doesnt 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]/))
@ -228,6 +239,7 @@ function RunDetection(settings)
{
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
@ -303,6 +315,8 @@ function RunDetection(settings)
// https://gitea.wildfiregames.com/0ad/0ad/issues/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";
@ -317,6 +331,7 @@ function RunDetection(settings)
"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,
@ -325,8 +340,8 @@ function RunDetection(settings)
global.RunHardwareDetection = function(settings)
{
// Currently we don't have limitations for other backends than GL.
if (settings.renderer_backend.name != 'gl')
// Currently we don't have limitations for other backends than GL and GL ARB.
if (settings.renderer_backend.name != 'gl' && settings.renderer_backend.name != 'glarb')
return;
// print(JSON.stringify(settings, null, 1)+"\n");
@ -370,6 +385,9 @@ global.RunHardwareDetection = function(settings)
Engine.ConfigDB_CreateValue("hwdetect", "watershadows", (!output.disable_fancywater).toString());
}
if (output.enable_glsl !== undefined)
Engine.ConfigDB_CreateValue("hwdetect", "preferglsl", (output.enable_glsl).toString());
if (output.enable_postproc !== undefined)
Engine.ConfigDB_CreateValue("hwdetect", "postproc", (output.enable_postproc).toString());

View file

@ -14,8 +14,7 @@ print("<th>GL_RENDERER");
print("<th>Output");
print("<th>Warnings");
hwdetectTestData.sort(function(a, b)
{
hwdetectTestData.sort(function(a, b) {
if (a.renderer_backend.GL_RENDERER < b.renderer_backend.GL_RENDERER)
return -1;
if (b.renderer_backend.GL_RENDERER < a.renderer_backend.GL_RENDERER)

View file

@ -0,0 +1,27 @@
!!ARBfp1.0
TEMP colorTex;
TEX colorTex, fragment.texcoord[0], texture[0], 2D;
TEMP grayscale;
MOV grayscale.r, 0.3;
MOV grayscale.g, 0.59;
MOV grayscale.b, 0.11;
MOV grayscale.a, 0.0;
PARAM colorAdd = program.local[1];
PARAM colorMul = program.local[2];
PARAM grayscaleFactor = program.local[3];
TEMP colorGray;
DP3 colorGray.rgb, colorTex, grayscale;
MOV colorGray.a, colorTex.a;
TEMP color;
LRP color, grayscaleFactor.r, colorGray, colorTex;
MUL color, color, colorMul;
ADD color, color, colorAdd;
MOV result.color, color;
END

View file

@ -0,0 +1,19 @@
!!ARBvp1.0
PARAM transform = program.local[0];
PARAM translation = program.local[1];
TEMP position;
MUL position, transform, vertex.position.xyxy;
ADD position.x, position.x, position.y;
ADD position.y, position.z, position.w;
ADD position, position, translation;
MOV position.z, 0.0;
MOV position.w, 1.0;
MOV result.position, position;
MOV result.texcoord[0], vertex.texcoord[0];
END

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<vertex file="arb/canvas2d.vp">
<stream name="pos"/>
<stream name="uv0"/>
<uniform name="transform" loc="0" type="vec4"/>
<uniform name="translation" loc="1" type="vec2"/>
</vertex>
<fragment file="arb/canvas2d.fp">
<uniform name="tex" loc="0" type="sampler2D"/>
<uniform name="colorAdd" loc="1" type="vec4"/>
<uniform name="colorMul" loc="2" type="vec4"/>
<uniform name="grayscaleFactor" loc="3" type="float"/>
</fragment>
</program>

View file

@ -0,0 +1,13 @@
!!ARBfp1.0
#if DEBUG_TEXTURED
ATTRIB v_tex = fragment.texcoord[0];
TEX result.color, v_tex, texture[0], 2D;
#else
PARAM color = program.local[0];
MOV result.color, color;
#endif
END

View file

@ -0,0 +1,25 @@
!!ARBvp1.0
PARAM transform[4] = { program.local[0..3] };
#if DEBUG_TEXTURED
PARAM textureTransform = program.local[4];
#endif
ATTRIB position = vertex.position;
#if DEBUG_TEXTURED
ATTRIB uv = vertex.texcoord[0];
#endif
DP4 result.position.x, transform[0], position;
DP4 result.position.y, transform[1], position;
DP4 result.position.z, transform[2], position;
DP4 result.position.w, transform[3], position;
#if DEBUG_TEXTURED
OUTPUT v_tex = result.texcoord[0];
MUL v_tex.x, textureTransform.x, uv.x;
MUL v_tex.y, textureTransform.y, uv.z;
#endif
END

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<vertex file="arb/debug_overlay.vp">
<uniform name="transform" loc="0" type="mat4"/>
<uniform name="textureTransform" loc="4" type="vec2" if="DEBUG_TEXTURED"/>
<stream name="pos"/>
<stream name="uv0" if="DEBUG_TEXTURED"/>
</vertex>
<fragment file="arb/debug_overlay.fp">
<uniform name="baseTex" loc="0" type="sampler2D" if="DEBUG_TEXTURED"/>
<uniform name="color" loc="0" type="vec4" if="!DEBUG_TEXTURED"/>
</fragment>
</program>

View file

@ -0,0 +1,3 @@
!!ARBfp1.0
MOV result.color, program.local[0];
END

View file

@ -0,0 +1,12 @@
!!ARBvp1.0
ATTRIB position = vertex.position;
PARAM transform[4] = { program.local[0..3] };
DP4 result.position.x, transform[0], position;
DP4 result.position.y, transform[1], position;
DP4 result.position.z, transform[2], position;
DP4 result.position.w, transform[3], position;
END

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<vertex file="arb/dummy.vp">
<stream name="pos"/>
<uniform name="transform" loc="0" type="mat4"/>
</vertex>
<fragment file="arb/dummy.fp">
<uniform name="color" loc="0" type="vec4"/>
</fragment>
</program>

View file

@ -0,0 +1,9 @@
!!ARBfp1.0
PARAM colorMul = program.local[0];
TEMP color;
TEX color, fragment.texcoord[0], texture[0], 2D;
MUL color, color, colorMul;
MOV result.color, color;
END

View file

@ -0,0 +1,15 @@
!!ARBvp1.0
ATTRIB position = vertex.position;
ATTRIB uv = vertex.texcoord[0];
PARAM transform[4] = { program.local[0..3] };
DP4 result.position.x, transform[0], position;
DP4 result.position.y, transform[1], position;
DP4 result.position.z, transform[2], position;
DP4 result.position.w, transform[3], position;
MOV result.texcoord, uv;
END

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<vertex file="arb/foreground_overlay.vp">
<stream name="pos"/>
<stream name="uv0"/>
<uniform name="transform" loc="0" type="mat4"/>
</vertex>
<fragment file="arb/foreground_overlay.fp">
<uniform name="baseTex" loc="0" type="sampler2D"/>
<uniform name="colorMul" loc="0" type="vec4"/>
</fragment>
</program>

View file

@ -0,0 +1,17 @@
!!ARBfp1.0
ATTRIB v_los = fragment.texcoord[0];
PARAM delta = program.local[0];
TEMP los1_tex;
TEMP los2_tex;
TEX los1_tex, v_los, texture[0], 2D;
TEX los2_tex, v_los, texture[1], 2D;
TEMP smoothing;
MOV_SAT smoothing, delta.x;
LRP result.color, smoothing, los1_tex.rrrr, los2_tex.rrrr;
END

View file

@ -0,0 +1,6 @@
!!ARBvp1.0
MOV result.position, vertex.position;
MOV result.texcoord, vertex.texcoord[0];
END

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<vertex file="arb/los_interp.vp">
<stream name="pos"/>
<stream name="uv0"/>
</vertex>
<fragment file="arb/los_interp.fp">
<uniform name="delta" loc="0" type="float"/>
<uniform name="losTex1" loc="0" type="sampler2D"/>
<uniform name="losTex2" loc="1" type="sampler2D"/>
</fragment>
</program>

View file

@ -0,0 +1,23 @@
!!ARBfp1.0
#if MINIMAP_BASE
TEX result.color, fragment.texcoord[0], texture[0], 2D;
#endif
#if MINIMAP_LOS
TEMP tex;
TEX tex, fragment.texcoord[0], texture[0], 2D;
MOV result.color.r, tex.r;
MOV result.color.g, tex.r;
MOV result.color.b, tex.r;
MOV result.color.a, tex.r;
#endif
#if MINIMAP_POINT
MOV result.color, fragment.color;
MOV result.color.a, 1.0;
#endif
END

View file

@ -0,0 +1,32 @@
!!ARBvp1.0
PARAM transform = program.local[0];
PARAM translation = program.local[1];
PARAM textureTransform = program.local[2];
OUTPUT v_tex = result.texcoord[0];
TEMP position;
MUL position, transform, vertex.position.xyxy;
ADD position.x, position.x, position.y;
ADD position.y, position.z, position.w;
ADD position, position, translation.xyxy;
MOV position.z, 0.0;
MOV position.w, 1.0;
MOV result.position, position;
#if MINIMAP_BASE || MINIMAP_LOS
TEMP tex;
MUL tex, textureTransform, vertex.texcoord.xyxy;
ADD tex.x, tex.x, tex.y;
ADD tex.y, tex.z, tex.w;
ADD tex, tex, translation.zwzw;
MOV tex.z, 0.0;
MOV tex.w, 1.0;
MOV v_tex, tex;
#endif
#if MINIMAP_POINT
MOV result.color, vertex.color;
#endif
END

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<vertex file="arb/minimap.vp">
<stream name="pos"/>
<stream name="uv0" if="MINIMAP_BASE || MINIMAP_LOS"/>
<stream name="color" if="MINIMAP_POINT"/>
<uniform name="transform" loc="0" type="vec4"/>
<uniform name="translation" loc="1" type="vec4"/>
<uniform name="textureTransform" loc="2" type="vec4"/>
</vertex>
<fragment file="arb/minimap.fp">
<uniform name="baseTex" loc="0" type="sampler2D" if="MINIMAP_BASE || MINIMAP_LOS"/>
</fragment>
</program>

View file

@ -0,0 +1,7 @@
!!ARBfp1.0
PARAM color = program.local[0];
MOV result.color, color;
END

View file

@ -0,0 +1,18 @@
!!ARBvp1.0
PARAM transform[4] = { program.local[0..3] };
PARAM instancingTransform = program.local[4];
TEMP position;
MAD position.x, vertex.position.x, instancingTransform.w, instancingTransform.x;
MAD position.y, vertex.position.y, instancingTransform.w, instancingTransform.y;
MAD position.z, vertex.position.z, instancingTransform.w, instancingTransform.z;
MOV position.w, 1.0;
DP4 result.position.x, transform[0], position;
DP4 result.position.y, transform[1], position;
DP4 result.position.z, transform[2], position;
DP4 result.position.w, transform[3], position;
END

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<vertex file="arb/overlay_solid.vp">
<uniform name="transform" loc="0" type="mat4"/>
<uniform name="instancingTransform" loc="4" type="vec4"/>
<stream name="pos"/>
</vertex>
<fragment file="arb/overlay_solid.fp">
<uniform name="color" loc="0" type="vec4"/>
</fragment>
</program>

View file

@ -0,0 +1,34 @@
!!ARBfp1.0
PARAM objectColor = program.local[0];
TEMP base;
TEMP mask;
TEMP color;
// Combine base texture and color, using mask texture
TEX base, fragment.texcoord[0], texture[0], 2D;
TEX mask, fragment.texcoord[0], texture[1], 2D;
#if USE_OBJECTCOLOR
LRP color.rgb, mask, objectColor, base;
#else
LRP color.rgb, mask, fragment.color, base;
#endif
#if IGNORE_LOS
MOV result.color.rgb, color;
#else
// Multiply RGB by LOS texture (red channel)
TEMP los;
TEX los, fragment.texcoord[1], texture[2], 2D;
SUB los.r, los.r, 0.03;
MUL los.r, los.r, 0.97;
MUL result.color.rgb, color, los.r;
#endif
// Use alpha from base texture, combined with the object color/fragment alpha.
#if USE_OBJECTCOLOR
MUL result.color.a, objectColor.a, base.a;
#else
MUL result.color.a, fragment.color.a, base.a;
#endif
END

View file

@ -0,0 +1,21 @@
!!ARBvp1.0
PARAM transform[4] = { program.local[0..3] };
#if !IGNORE_LOS
PARAM losTransform = program.local[4];
#endif
ATTRIB position = vertex.position;
DP4 result.position.x, transform[0], position;
DP4 result.position.y, transform[1], position;
DP4 result.position.z, transform[2], position;
DP4 result.position.w, transform[3], position;
MOV result.texcoord[0], vertex.texcoord[0];
#if !IGNORE_LOS
MAD result.texcoord[1], position.xzzz, losTransform.x, losTransform.y;
#endif
MOV result.color, vertex.color;
END

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<!-- This shader is used for rendering overlay lines (e.g. territory boundaries), and also for
rendering the unit selection ring quad overlays, since they are almost identical. The only
difference is that in unit selection ring mode, the uniform objectColor is ignored and instead
replaced by a color stream from the vertices. The USE_OBJECTCOLOR define is used to switch
between either mode. -->
<vertex file="arb/overlayline.vp">
<stream name="pos"/>
<stream name="uv0"/>
<stream name="color" if="!USE_OBJECTCOLOR"/>
<uniform name="transform" loc="0" type="mat4"/>
<uniform name="losTransform" loc="4" type="vec2" if="!IGNORE_LOS"/>
</vertex>
<fragment file="arb/overlayline.fp">
<uniform name="baseTex" loc="0" type="sampler2D"/>
<uniform name="maskTex" loc="1" type="sampler2D"/>
<uniform name="losTex" loc="2" type="sampler2D" if="!IGNORE_LOS"/>
<uniform name="objectColor" loc="0" type="vec4" if="USE_OBJECTCOLOR"/>
</fragment>
</program>

View file

@ -0,0 +1,25 @@
!!ARBfp1.0
ATTRIB v_los = fragment.texcoord[1];
PARAM sunColor = program.local[0];
TEMP tex, losTex, color;
TEX tex, fragment.texcoord[0], texture[0], 2D;
TEMP temp;
MOV temp, 0.5;
ADD color.rgb, fragment.color, sunColor;
MUL color.rgb, color, temp;
MUL color.rgb, color, tex;
// Multiply everything by the LOS texture
TEX losTex, v_los, texture[1], 2D;
SUB losTex.r, losTex.r, 0.03;
MUL losTex.r, losTex.r, 0.97;
MUL result.color.rgb, color, losTex.r;
MUL result.color.a, tex, fragment.color;
END

View file

@ -0,0 +1,29 @@
!!ARBvp1.0
ATTRIB uv = vertex.texcoord[0];
ATTRIB offset = vertex.texcoord[1];
PARAM transform[4] = { program.local[0..3] };
PARAM modelViewMatrix[4] = { program.local[4..7] };
PARAM losTransform = program.local[8];
TEMP axis1;
MOV axis1, modelViewMatrix[0];
TEMP axis2;
MOV axis2, modelViewMatrix[1];
TEMP position;
MAD position.xyz, axis1, offset.x, vertex.position;
MAD position.xyz, axis1, offset.y, position;
MAD position.xyz, axis2, offset.x, position;
MAD position.xyz, axis2, -offset.y, position;
MOV position.w, vertex.position.w;
DP4 result.position.x, transform[0], position;
DP4 result.position.y, transform[1], position;
DP4 result.position.z, transform[2], position;
DP4 result.position.w, transform[3], position;
MOV result.texcoord[0], uv;
MOV result.color, vertex.color;
MAD result.texcoord[1], vertex.position.xzzz, losTransform.x, losTransform.y;
END

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<vertex file="arb/particle.vp">
<stream name="pos"/>
<stream name="color"/>
<stream name="uv0"/>
<stream name="uv1"/>
<uniform name="transform" loc="0" type="mat4"/>
<uniform name="modelViewMatrix" loc="4" type="mat4"/>
<uniform name="losTransform" loc="8" type="vec2"/>
</vertex>
<fragment file="arb/particle.fp">
<uniform name="baseTex" loc="0" type="sampler2D"/>
<uniform name="losTex" loc="1" type="sampler2D"/>
<uniform name="sunColor" loc="0" type="vec3"/>
</fragment>
</program>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<vertex file="arb/particle.vp">
<stream name="pos"/>
<stream name="uv0"/>
<stream name="uv1"/>
<uniform name="transform" loc="0" type="mat4"/>
<uniform name="losTransform" loc="5" type="vec2"/>
</vertex>
<fragment file="arb/solid.fp"/>
</program>

View file

@ -0,0 +1,27 @@
!!ARBfp1.0
# cgc version 3.1.0013, build date Apr 24 2012
# command line args: -oglsl -profile arbfp1
# source file: sky.fs
#vendor NVIDIA Corporation
#version 3.1.0.13
#profile arbfp1
#program main
#semantic baseTex
#var float4 gl_FragColor : $vout.COLOR : COL : -1 : 1
#var samplerCUBE baseTex : : texunit 0 : -1 : 1
#var float3 v_tex : $vin.TEX0 : TEX0 : -1 : 1
#const c[0] = 0.25 0 1 4
PARAM c[1] = { { 0.25, 0, 1, 4 } };
TEMP R0;
TEMP R1;
TEMP R2;
SLT R2.x, c[0].y, fragment.texcoord[0].y;
ABS R2.x, R2;
TEX R0, fragment.texcoord[0], texture[0], CUBE;
ADD R1.x, -fragment.texcoord[0].y, c[0];
MUL R1, R0, R1.x;
MUL R1, R1, c[0].w;
CMP R2.x, -R2, c[0].y, c[0].z;
CMP result.color, -R2.x, R0, R1;
END
# 8 instructions, 3 R-regs

View file

@ -0,0 +1,15 @@
!!ARBvp1.0
ATTRIB position = vertex.position;
ATTRIB uv = vertex.texcoord[0];
PARAM transform[4] = { program.local[0..3] };
DP4 result.position.x, transform[0], position;
DP4 result.position.y, transform[1], position;
DP4 result.position.z, transform[2], position;
DP4 result.position.w, transform[3], position;
MOV result.texcoord, uv;
END

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<vertex file="arb/sky.vp">
<stream name="pos"/>
<stream name="uv0"/>
<uniform name="transform" loc="0" type="mat4"/>
</vertex>
<fragment file="arb/sky.fp">
<uniform name="baseTex" loc="0" type="samplerCube"/>
</fragment>
</program>

View file

@ -0,0 +1,7 @@
!!ARBfp1.0
PARAM color = program.local[0];
MOV result.color, color;
END

View file

@ -0,0 +1,14 @@
!!ARBvp1.0
PARAM transform[4] = { program.local[0..3] };
TEMP position;
DP4 position.x, transform[0], vertex.position;
DP4 position.y, transform[1], vertex.position;
DP4 position.z, transform[2], vertex.position;
MOV position.w, 1.0;
MOV result.position, position;
END

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<vertex file="arb/solid.vp">
<uniform name="transform" loc="0" type="mat4"/>
<stream name="pos"/>
</vertex>
<fragment file="arb/solid.fp">
<uniform name="color" loc="0" type="vec4"/>
</fragment>
</program>

View file

@ -0,0 +1,3 @@
!!ARBfp1.0
MOV result.color, program.local[0];
END

View file

@ -0,0 +1,12 @@
!!ARBfp1.0
#ifdef REQUIRE_ALPHA_GEQUAL
TEMP tex;
TEMP temp;
TEX tex, fragment.texcoord[0], texture[0], 2D;
SUB temp.x, tex.a, REQUIRE_ALPHA_GEQUAL;
KIL temp.x; // discard if < 0.0
MOV result.color, tex;
#else
TEX result.color, fragment.texcoord[0], texture[0], 2D;
#endif
END

View file

@ -0,0 +1,20 @@
!!ARBvp1.0
#ifdef USE_INSTANCING
PARAM instancingTransform[4] = { program.local[0..3] };
TEMP position;
DP4 position.x, instancingTransform[0], vertex.position;
DP4 position.y, instancingTransform[1], vertex.position;
DP4 position.z, instancingTransform[2], vertex.position;
MOV position.w, 1.0;
#else
ATTRIB position = vertex.position;
#endif
PARAM transform[4] = { program.local[4..7] };
DP4 result.position.x, transform[0], position;
DP4 result.position.y, transform[1], position;
DP4 result.position.z, transform[2], position;
DP4 result.position.w, transform[3], position;
MOV result.texcoord[0], vertex.texcoord[0];
END

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<vertex file="arb/terrain_common.vp">
<uniform name="sunColor" loc="0" type="vec3"/>
<uniform name="textureTransform" loc="1" type="vec2"/>
<uniform name="losTransform" loc="2" type="vec2"/>
<uniform name="shadowTransform" loc="3" type="mat4"/>
<uniform name="shadowScale" loc="7" type="vec4"/>
<uniform name="sunDir" loc="8" type="vec3"/>
<uniform name="transform" loc="9" type="mat4"/>
<stream name="pos"/>
<stream name="normal"/>
<stream name="uv0"/>
<stream name="uv1" if="BLEND"/>
</vertex>
<fragment file="arb/terrain_common.fp">
<uniform name="baseTex" loc="0" type="sampler2D"/>
<uniform name="blendTex" loc="1" type="sampler2D" if="BLEND"/>
<uniform name="shadowTex" loc="2" type="sampler2DShadow"/>
<uniform name="losTex" loc="3" type="sampler2D"/>
<uniform name="shadingColor" loc="1" type="vec3" if="DECAL"/>
<uniform name="ambient" loc="0" type="vec3"/>
<uniform name="shadowScale" loc="2" type="vec4"/>
</fragment>
</program>

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<define name="BLEND" value="1"/>
<vertex file="arb/terrain_common.vp">
<uniform name="sunColor" loc="0" type="vec3"/>
<uniform name="textureTransform" loc="1" type="vec2"/>
<uniform name="losTransform" loc="2" type="vec2"/>
<uniform name="shadowTransform" loc="3" type="mat4"/>
<uniform name="shadowScale" loc="7" type="vec4"/>
<uniform name="sunDir" loc="8" type="vec3"/>
<uniform name="transform" loc="9" type="mat4"/>
<stream name="pos"/>
<stream name="normal"/>
<stream name="uv0"/>
<stream name="uv1"/>
</vertex>
<fragment file="arb/terrain_common.fp">
<uniform name="baseTex" loc="0" type="sampler2D"/>
<uniform name="blendTex" loc="1" type="sampler2D"/>
<uniform name="shadowTex" loc="2" type="sampler2DShadow"/>
<uniform name="losTex" loc="3" type="sampler2D"/>
<uniform name="ambient" loc="0" type="vec3"/>
<uniform name="shadowScale" loc="2" type="vec4"/>
</fragment>
</program>

View file

@ -0,0 +1,101 @@
!!ARBfp1.0
#if USE_FP_SHADOW
OPTION ARB_fragment_program_shadow;
#endif
PARAM ambient = program.local[0];
#if DECAL
PARAM shadingColor = program.local[1];
#endif
#if USE_FP_SHADOW && USE_SHADOW_PCF
PARAM shadowScale = program.local[2];
TEMP offset, size, weight, depthSample;
#endif
TEMP tex;
TEMP temp;
TEMP diffuse;
TEMP color;
#if BLEND
// Use alpha from blend texture
// TODO: maybe we should invert the texture instead of doing SUB here?
TEX tex.a, fragment.texcoord[1], texture[1], 2D;
SUB result.color.a, 1.0, tex.a;
#endif
// Load diffuse color
TEX color, fragment.texcoord[0], texture[0], 2D;
#if DECAL
// Use alpha from main texture
MOV result.color.a, color;
#endif
// Compute color = texture * (ambient + diffuse*shadow)
// (diffuse is 2*fragment.color due to clamp-avoidance in the vertex program)
#if USE_SHADOW && !DISABLE_RECEIVE_SHADOWS
TEMP shadowBias;
TEMP biasedShdw;
MOV shadowBias.x, 0.0005;
MOV biasedShdw, fragment.texcoord[2];
SUB biasedShdw.z, fragment.texcoord[2].z, shadowBias.x;
#if USE_FP_SHADOW
#if USE_SHADOW_PCF
SUB offset.xy, fragment.texcoord[2], 0.5;
FRC offset.xy, offset;
ADD size.xy, offset, 1.0;
SUB size.zw, 2.0, offset.xyxy;
MAD offset.xy, -0.5, offset, fragment.texcoord[2];
MOV offset.z, biasedShdw.z;
ADD weight, { 1.0, 1.0, -0.5, -0.5 }, offset.xyxy;
MUL weight, weight, shadowScale.zwzw;
MOV offset.xy, weight.zwww;
TEX depthSample.r, offset, texture[2], SHADOW2D;
MOV temp.x, depthSample.r;
MOV offset.x, weight.x;
TEX depthSample.r, offset, texture[2], SHADOW2D;
MOV temp.y, depthSample.r;
MOV offset.xy, weight.zyyy;
TEX depthSample.r, offset, texture[2], SHADOW2D;
MOV temp.z, depthSample.r;
MOV offset.x, weight.x;
TEX depthSample.r, offset, texture[2], SHADOW2D;
MOV temp.w, depthSample.r;
MUL size, size.zxzx, size.wwyy;
DP4 temp.x, temp, size;
MUL temp.x, temp.x, 0.111111;
#else
TEX temp.x, biasedShdw, texture[2], SHADOW2D;
#endif
#else
TEX tex, fragment.texcoord[2], texture[2], 2D;
MOV_SAT temp.z, biasedShdw.z;
SGE temp.x, tex.x, temp.z;
#endif
MUL diffuse.rgb, fragment.color, 2.0;
MAD temp.rgb, diffuse, temp.x, ambient;
MUL color.rgb, color, temp;
#else
MAD temp.rgb, fragment.color, 2.0, ambient;
MUL color.rgb, color, temp;
#endif
// Multiply everything by the LOS texture
TEX tex.r, fragment.texcoord[3], texture[3], 2D;
SUB tex.r, tex.r, 0.03;
MUL tex.r, tex.r, 0.97;
MUL color.rgb, color, tex.r;
#if DECAL
MUL result.color.rgb, color, shadingColor;
#else
MOV result.color.rgb, color;
#endif
END

View file

@ -0,0 +1,74 @@
!!ARBvp1.0
PARAM sunColor = program.local[0];
PARAM textureTransform = program.local[1];
PARAM losTransform = program.local[2];
PARAM shadowTransform[4] = { program.local[3..6] };
PARAM sunDir = program.local[8];
PARAM transform[4] = { program.local[9..12] };
#if USE_FP_SHADOW && USE_SHADOW_PCF
PARAM shadowScale = program.local[7];
#endif
TEMP lighting;
TEMP terrainTextureTransform;
MOV terrainTextureTransform, textureTransform;
MOV terrainTextureTransform.z, -textureTransform.y;
MOV terrainTextureTransform.w, 0;
//// Compute position and normal:
ATTRIB position = vertex.position;
DP4 result.position.x, transform[0], position;
DP4 result.position.y, transform[1], position;
DP4 result.position.z, transform[2], position;
DP4 result.position.w, transform[3], position;
//// Compute lighting:
// Diffuse factor is precomputed in vertex attribute
// Scale diffuse to allow overbrightness (since result.color will be clamped to [0, 1])
//
DP3 lighting, -sunDir, vertex.normal;
MAX lighting, 0.0, lighting; // DP3_SAT isn't available here.
MUL lighting, lighting, 0.5;
// Apply light color
MUL result.color, lighting, sunColor;
//// Texture coordinates:
#if DECAL
MOV result.texcoord[0], vertex.texcoord[0];
#else
// Compute texcoords from position and terrain-texture-dependent transform.
// textureTransform is stored as [c, -s, s, 0],
// and we want texcoord = (x*c + z*-s, x*-s + z*-c, 0, 1)
DP3 result.texcoord[0].x, terrainTextureTransform.xyww, position.xzww;
DP3 result.texcoord[0].y, -terrainTextureTransform.zxww, position.xzww;
MOV result.texcoord[0].z, 0;
MOV result.texcoord[0].w, 1;
#endif
#if BLEND
MOV result.texcoord[1], vertex.texcoord[1];
#endif
#if USE_SHADOW
#if USE_FP_SHADOW && USE_SHADOW_PCF
TEMP shadowtc;
DP4 shadowtc.x, shadowTransform[0], position;
DP4 shadowtc.y, shadowTransform[1], position;
MUL result.texcoord[2].xy, shadowtc, shadowScale;
#else
DP4 result.texcoord[2].x, shadowTransform[0], position;
DP4 result.texcoord[2].y, shadowTransform[1], position;
#endif
DP4 result.texcoord[2].z, shadowTransform[2], position;
DP4 result.texcoord[2].w, shadowTransform[3], position;
#endif
MAD result.texcoord[3], position.xzzz, losTransform.x, losTransform.y;
END

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<define name="DECAL" value="1"/>
<vertex file="arb/terrain_common.vp">
<uniform name="sunColor" loc="0" type="vec3"/>
<uniform name="textureTransform" loc="1" type="vec2"/>
<uniform name="losTransform" loc="2" type="vec2"/>
<uniform name="shadowTransform" loc="3" type="mat4"/>
<uniform name="shadowScale" loc="7" type="vec4"/>
<uniform name="sunDir" loc="8" type="vec3"/>
<uniform name="transform" loc="9" type="mat4"/>
<stream name="pos"/>
<stream name="normal"/>
<stream name="uv0"/>
</vertex>
<fragment file="arb/terrain_common.fp">
<uniform name="baseTex" loc="0" type="sampler2D"/>
<uniform name="shadowTex" loc="2" type="sampler2DShadow"/>
<uniform name="losTex" loc="3" type="sampler2D"/>
<uniform name="ambient" loc="0" type="vec3"/>
<uniform name="shadingColor" loc="1" type="vec3"/>
<uniform name="shadowScale" loc="2" type="vec4"/>
</fragment>
</program>

View file

@ -0,0 +1,19 @@
!!ARBfp1.0
PARAM color = program.local[2];
ATTRIB v_coords = fragment.texcoord[0];
ATTRIB v_losCoords = fragment.texcoord[1];
TEMP diffuse;
TEX diffuse, v_coords, texture[0], 2D;
MUL diffuse, diffuse, color;
TEMP los;
TEX los, v_losCoords, texture[1], 2D;
SUB los.r, los.r, 0.03;
MUL los.r, los.r, 0.97;
MUL diffuse, diffuse, los.r;
MOV result.color, diffuse;
END

View file

@ -0,0 +1,39 @@
!!ARBvp1.0
ATTRIB position = vertex.position;
PARAM transform[4] = { program.local[0..3] };
PARAM losTransform = program.local[4];
PARAM time = program.local[5];
OUTPUT v_coords = result.texcoord[0];
OUTPUT v_losCoords = result.texcoord[1];
DP4 result.position.x, transform[0], position;
DP4 result.position.y, transform[1], position;
DP4 result.position.z, transform[2], position;
DP4 result.position.w, transform[3], position;
TEMP tx;
MUL tx, time, -0.01235; // 1.0 / 81.0
FRC tx, tx;
TEMP tz;
MUL tz, time, -0.02941; // 1.0 / 34.0
FRC tz, tz;
TEMP offset;
MOV offset.x, tx;
MOV offset.z, tz;
TEMP coords;
// Divide by period 16 and add offset.
MAD coords, position, 0.0625, offset;
ADD coords, coords, offset;
MOV v_coords, coords.xzxz;
TEMP losCoords;
MOV losCoords, position.xzxz;
MUL losCoords, losCoords, losTransform.xxxx;
ADD losCoords, losCoords, losTransform.yyyy;
MOV v_losCoords, losCoords.xyxy;
END

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<vertex file="arb/water_simple.vp">
<stream name="pos"/>
<uniform name="transform" loc="0" type="mat4"/>
<uniform name="losTransform" loc="4" type="vec2"/>
<uniform name="time" loc="5" type="float"/>
</vertex>
<fragment file="arb/water_simple.fp">
<uniform name="baseTex" loc="0" type="sampler2D"/>
<uniform name="losTex" loc="1" type="sampler2D"/>
<uniform name="color" loc="2" type="vec4"/>
</fragment>
</program>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<effect>
<technique>
<require shaders="arb"/>
<require shaders="glsl"/>
<require shaders="spirv"/>
<pass shader="canvas2d">

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<effect>
<technique>
<require shaders="glsl"/>
<require shaders="spirv"/>
<compute shader="compute_resolve_pbr"/>
</technique>
</effect>

Some files were not shown because too many files have changed in this diff Show more