Compare commits

..

94 commits

Author SHA1 Message Date
phosit
30b741f8ba
Update appdata for next RC
(cherry picked from commit 72591b7608)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-29 21:56:19 +01:00
Ralph Sennhauser
2da2c3394f
Cleanly fail autostart for invalid map type
As for any invalid argument reject them and cleanly exit with failure
status.

Fixes: #7687
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
(cherry picked from commit 958e6de9d3)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-29 21:56:19 +01:00
Ralph Sennhauser
f578a5b34d
Readd JS API function Engine.Exit()
Requested in #8244 for scripting purposes and automated testing. Extend
the original design by adding a means to pass an exit status. This also
comes in handy in case one wants to cleanly error out from JS on parsing
errors of command line arguments as reported in #7967.

Fixes: #8244
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
(cherry picked from commit 0d60bdfd2e)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-29 21:56:19 +01:00
Vantha
8fee4dbb76
Temporary workaround for font baseline issue
Quick temporary fix for #8505 for the release of R28.

(cherry picked from commit 2483e7172b)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-29 21:56:19 +01:00
Vantha
baa18fd57d
Temporary workaround for icon misalignment
Quick temporary fix for #8194 for the release of R28.

(cherry picked from commit 7fd788af0f)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-29 21:56:19 +01:00
Atrik
231750edf1
Fix errors if promoted units change attack range
While in combat, if units are promoted and the promotion results
in a change in their attack range, this could trigger some errors
as 'this.template[type]' had a chance to be undefined when performing
a 'RepeatRangeCheck'.

Fixes #8670

(cherry picked from commit 68e625ab7a)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-29 21:56:18 +01:00
Ralph Sennhauser
0d1cdc0eaa
Workaround renamed property in gamereport
The gendered citizen feature changed stat counter names in
3592814aa8 which are submitted to echelon
for rated games with the game report, the change in name for the property
means it no longer matches the database column name effectively breaking
rated games.

Translate the property name on the fly.

Fixes: #8687
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
(cherry picked from commit 0691e7f0ff)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-29 21:56:18 +01:00
phosit
63d4513ebf
Serialize canPlay property in Petra
This was forgotten in 7b1d4426aa.

Fixes: #8674
(cherry picked from commit a6357322e9)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-22 20:43:57 +01:00
Dunedan
a1cb3055d9
Fix string extraction of new game settings
5741f77c6e and b5256ce014 added new translatable strings for game
settings, but missed adding them to
binaries/data/mods/public/l10n/messages.json to get them properly
extracted into the PO-templates for translation. This commit fixes that.

(cherry picked from commit f4c52e49a7)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-15 18:06:48 +01:00
Dunedan
7fd034a2c0
Fix translatable strings in XML files
Some translatable strings in XML files have leading and trailing line
breaks and tabs. As these characters are significant in text in XML
files, they don't belong there.

Refs: #8649
(cherry picked from commit 8f8d1195c2)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-14 20:59:47 +01:00
phosit
0f21853bd8
Update appdata for next RC
(cherry picked from commit b77ee3c5dc)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-05 21:09:03 +01:00
phosit
b7fe462045
Revert "Add myself to the community credits (for packaging work)"
This reverts commit 7f0486e18e.
2026-01-01 17:33:45 +01:00
phosit
bf0034f694
Close register-page before opening login-page
The `onTick` of the register-page was still running when connecting to
the lobby. This lead to an error when the `connect` message was
received.
With this commit returning from the login-page will always return to the
entrance-page. Previously it returned to the register-page when it was
opened by through that page.

(cherry picked from commit 0b83e24065)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-01 16:08:46 +01:00
Olivier Tilloy
b228b611de
Add myself to the community credits (for packaging work)
(cherry picked from commit 7f0486e18e)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-01 16:08:46 +01:00
Olivier Tilloy
72b56d9fe5
Spidermonkey build: do not unpack unneeded test files
This change reduces the disk space requirement by 50%, from 1.1 GB down to 564 MB.
It is relevant when building 0AD in resource-constrained environments (e.g. in CI).

(cherry picked from commit 8bd0d0b84f)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-01 16:08:46 +01:00
Itms
fb12d00c70
Build the Actor Editor during the nightly build
This is a regression of a fix in 7e481b73cd,
lost during the git migration. Refs #1819

(cherry picked from commit d1319179f8)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-01 16:08:46 +01:00
Vantha
1690efeb72
Complete the per-player pop cap implementation
The 'PopulationLimit' attribute of each player seems to have been
without effect for a long time, but this patch fixes it.

Fixes #7850

(cherry picked from commit 9b8ff77265)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-01 16:08:46 +01:00
Vantha
5c8cf9a470
Add fallback values for pop cap and pop cap type
Make InitGame.js responsible for providing proper (defined) values.

Refs #7850
Fixes #7695

(cherry picked from commit 3a73dffc1c)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-01 16:08:46 +01:00
Vantha
d9ae2f8503
Remove inconsistent override in CDropdown.h
It was added in 670f1e5d42 and, while not illegal, was inconsistent with the
rest of the header file, which caused compiler warnings.
As a quick solution the override keyword is simply removed again.
In the long run, it would be good to still modernise the style of all files
in that directory (at once).

(cherry picked from commit 2e450f0f52)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-01 16:08:45 +01:00
trompetin17
b71cd96d12
Fix exceeding input boundaries in console
After 734386ce9f the new font system calculate height and cap height,
previously was having some magic number. Now we are using cap height
divide 2 to give a more nice space.

Remove an extra pixel in the buffer and improves background color for
better reading and eye care.

This also support the change console font option added in d549cbeeaa

Fixes: #8351
(cherry picked from commit 8e820a988e)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-01 16:08:45 +01:00
Vladislav Belov
d93722a023
Fixes ProfilerViewer when drawing empty cells
Currently CalculateStringSize can't handle empty string (see #8630).
As a simple fix for RC just avoid drawing empty texts.

Refs: #8630
(cherry picked from commit df9c6f510c)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-01 16:08:45 +01:00
Itms
7d2647d59a
Fix NSIS auto-uninstall
The NSIS script incorrectly passes the default installation dir as
argument for the auto-uninstaller of previous installs.

This is supposed to avoid moving the uninstaller to a temp file, but it
is unclear why that was done, as this leaves the uninstaller behind.

More importantly, now that we have changed the default installation
directory, the auto-uninstall tries to remove the previous install from
the new location, which does nothing and leaves behind several GB on the
disk.

(cherry picked from commit 771bf0ba08)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-01 16:08:45 +01:00
Vladislav Belov
1dff943455
Fixes TerrainTextureManager after refactoring
In fb98f5059a the manager was refactored
and the order of deinitialization was incorrectly changed.

(cherry picked from commit cea77c497c)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-01 16:08:45 +01:00
real_tabasco_sauce
ce7a180e73
update scenario map to account for changed template name for clubman
(cherry picked from commit 621b4f96cc)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-01 16:08:45 +01:00
real_tabasco_sauce
ca1ad508a4
mixed improvements to germans
-Make clubmen champion macemen and remove buiding ability to ensure they are not mistaken for CS units.
-Decrease obstruction size of houses (clunky to place in staff match)
-Encampents only allowed in own/neutral territory
-'fear' icon used for Lugius vision aura instead of movement speed.
- Make covered wagons unable to research house techs and train civilians.

(cherry picked from commit ec19e5d663)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-01 16:08:45 +01:00
Vladislav Belov
6d531e0303
Fixes uninitialized GPUSkinning in Atlas
Currently CRenderingOptions are initialized only once on the application
start. It means changed m_GPUSkinning wasn't reset on the switch to Atlas.

Fixes #8596

(cherry picked from commit f43e98da09)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-01 16:08:45 +01:00
phosit
e6e5d61b22
Allow swapped in pages to close themselves
This wasn't possible because init functions are called inside each
other and the outer one overwrites the result of the inner one.
Now the outer result doesn't overwrite the inner result but stores it to
the pointed to location.

(cherry picked from commit e62eb96092)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-01 16:08:45 +01:00
Vantha
7386a5d514
Improve Engine.GetTextSize deprecation message
(cherry picked from commit 4d08446285)
Signed-off-by: phosit <phosit@autistici.org>
2025-12-23 20:18:16 +01:00
Vantha
4140858066
Fix warnings on the charts tab of summary screen
Engine.GetTextWidth has been deprecated since e845da025a

Idea:
If you look at a dropdown as just a text field (its header) that can
change caption like any other, then getPreferredHeaderTextSize is the
equivalent to getPreferredTextSize (present on buttons and text fields).

Fixes #8493

(cherry picked from commit 670f1e5d42)
Signed-off-by: phosit <phosit@autistici.org>
2025-12-23 20:18:16 +01:00
Vantha
cc56bafc66
Fix oversight in 83f4d8789b
(cherry picked from commit fbb6052c30)
Signed-off-by: phosit <phosit@autistici.org>
2025-12-23 20:18:16 +01:00
phosit
10408b46c2
Propagate error from autostart
The JavaScript error wasn't propagated leading to an infinite loop.

Fixes: #7967
(cherry picked from commit 14a5ccee52)
Signed-off-by: phosit <phosit@autistici.org>
2025-12-23 20:18:16 +01:00
Itms
e2764dcee1
Do not use Jenkins custom SVN client on Windows
It is extremely prone to timeouts and failures in this environment.

(cherry picked from commit ac36758b21)
Signed-off-by: phosit <phosit@autistici.org>
2025-12-14 10:37:17 +01:00
phosit
5c333770ee
Increase home island size on River Archipelago
With some settings mines weren't able to be placed.
Refs: #8579

(cherry picked from commit c02764e17a)
Signed-off-by: phosit <phosit@autistici.org>
2025-12-14 10:37:17 +01:00
real_tabasco_sauce
3cba40b5c8
buff new carthage unique mercenary slinger with increased crush damage and greater accuracy.
(cherry picked from commit e96d981319)
Signed-off-by: phosit <phosit@autistici.org>
2025-12-06 20:46:21 +01:00
cube002
2b85f5abf6
Fix carthage stone bonus
Add a civ restriction to make the bonus only apply to Carthage.

(cherry picked from commit 8d38ecda26)
(cherry picked from commit a03b01c935)
(cherry picked from commit f30271e955)
(cherry picked from commit 9c836d39e6)
(cherry picked from commit 91baeeb94e)
(cherry picked from commit cb3fecfce9)
Signed-off-by: phosit <phosit@autistici.org>
2025-12-06 20:37:01 +01:00
phosit
a6403f27d5
Update appdata for the next RC
(cherry picked from commit 759406dd77)
Signed-off-by: phosit <phosit@autistici.org>
2025-12-03 18:15:06 +01:00
Ralph Sennhauser
d90f4400ed
Fix autostart-host
Commit b90280855f added support for
multiplayer saved games changing the signature of StartNetworkHost
without updating all callers.

Fixes: #7684
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
(cherry picked from commit 31a262ff7e)
Signed-off-by: phosit <phosit@autistici.org>
2025-12-03 18:15:05 +01:00
Dunedan
7575a04305
Add Vietnamese as supported language
As 0 A.D. supports full unicode now and Vietnamese language coverage is
at a good level, let's include Vietnamese as supported language.

(cherry picked from commit 0086f005d4)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-30 14:24:26 +01:00
Dunedan
3e8f296c72
Re-add Catalan as supported language
While Catalan got removed for Alpha 27 because of low coverage, its
coverage is now good enough again to get re-added as supported language.

(cherry picked from commit ed1bd1d75b)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-30 14:24:26 +01:00
real_tabasco_sauce
1087e020d1
Add capture animations for citizens
Fixes #8557

(cherry picked from commit a32a28a5e3)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-30 14:24:26 +01:00
Vantha
e961288e89
Correct some settings of the Germans' sandbox map
(cherry picked from commit 36e93989d4)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-30 14:24:26 +01:00
phosit
7ec2d3f0e0
Throw error when simulation script can't be loaded
When a script in "simulation/helpers/" contained an error. Files in
"simulation/components" aren't loaded. The return value of
`LoadDefaultScripts` indicated an error but was ignored. The simulation
still tried to start.

Now instead of returning a ignoreable error code the error is thrown. In
the common path the error is implicitly rethrown to the JS-function
which tried to start the game.

fixes: #8133
(cherry picked from commit 9a526bcae1)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-24 20:20:17 +01:00
phosit
97eca26d58
Don't pass the AppHooks as pointer
It's not permitted to pass a nullptr to the `app_hooks_update`. So a
reference should be used.

CppCheck says one shouldn't take pointer to a temporary.

(cherry picked from commit 977bf5c0d1)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-24 20:20:17 +01:00
phosit
2e4caf5d19
Use designatet initializers for AppHooks
CppCheck wasn't able to handle `{0}`. C++20 allows to use designated
initializers.

(cherry picked from commit b17c2fb80f)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-24 20:20:17 +01:00
Vantha
490434948d
Remove some invalid entries from messages.json
'StatusName', 'ApplierTooltip' and 'ReceiverTooltip' are attributes of status
effects, which are defined in JSON files (and already extracted
correctly from there), not XMLs.

(cherry picked from commit 44984699f1)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-19 20:28:48 +01:00
Vantha
6a55830f1f
Add context and comment attributes where useful
Add context and comment attributes to all translated XML elements in the
simulation that can specify any string -- unlike "Rank", which has to be
"Basic", "Advanced", or "Elite".
Most of them aren't used right now, but they can be in the
future and by mods, without touching the schemas again.

Fixes #8540

(cherry picked from commit 7032293207)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-19 20:28:48 +01:00
Ralph Sennhauser
bf314cbb4c
Add Atlas support to Appimage
Include the shared library libAtlasUI.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
(cherry picked from commit 5609492731)
Signed-off-by: phosit <phosit@autistici.org>
2025-11-19 20:28:48 +01:00
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
2314 changed files with 31553 additions and 26191 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