1
0
forked from mirrors/0ad

Compare commits

..

570 Commits

Author SHA1 Message Date
phosit a80446eb59 Use the profiler to profile map generation
Instead of writing the duration to the console it uses
`Engine.ProfileStart` and `Engine.ProfileStop` to profile map
generation.

Refs: #5263
2026-07-25 10:47:49 +02:00
phosit 4122f0bfb3 Use atomic instead of COMPILER_FENCE for Profiler2 2026-07-24 17:22:44 +02:00
Ralph Sennhauser aae1bbbab2 Use new WX object macro
Added in 2010.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-24 16:51:58 +02:00
Ralph Sennhauser 8523fa5ab4 Fix Atlas build on macOS Tahoe
Bump wxWidgets, the upstream fix was backported to 3.2.9 with commit
a6fc33b416e2ebc804d80a1ac66021935c434573

Fixes: #8594
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-24 13:14:34 +02:00
phosit 8b1e78ae1e Use JS classes for the AI
Fixes: #6285
2026-07-23 15:15:59 +02:00
phosit 09671b49a2 Use JS classes for QueuePlan
Classes derifed from `QueuePlan` used manual inherintance.

Refs: #6285
2026-07-23 15:12:50 +02:00
phosit 327e70ea82 Use JS classes for Template and Entity
`Template` and `Entity` used a costum form of inheritance.

Refs: #6285
2026-07-23 15:12:50 +02:00
phosit f9de339f85 Use JS classes for Terain-Analysis and InfoMap
`TerrainAnalysis` and `Accessibility` used a costum form of inheritance.

Refs: #6285
2026-07-23 15:12:50 +02:00
phosit ea1026a1cc Define the terrain states in a dedicated file 2026-07-23 15:12:49 +02:00
Vantha 2520c45220 Only call Engine.EndGame right before closing
Since #7786, the GUI tick completed normally after calling
`closePageCallback` instead of being cancelled like previously. Since
`Engine.EndGame` deletes the internal `g_Game` pointer, every Engine call
after it that tried to access `g_Game` caused a segfault.
This patch solves it by moving `Engine.EndGame` to the very end, right
before closing the session page.
In order to follow the convention that only functions directly closing
the page are called `closePageCallback`, that function is in turn
renamed to `closeSession`. Additionally, this allows only resolving
the promise with a bool (`showSummary`) and then only calling
`getNextPageOpenRequest` at the end of `init` for reasons of simplicity.
2026-07-22 23:51:49 +02:00
Vantha 801d21671e Correct hotkey names in Economy Walkthrough
The queue hotkey is called "session.queue", not "selection.queue"

Fixes #8939
2026-07-22 23:51:49 +02:00
Vantha 931c132b1b Fix brief text misalignment in GUI text objects
The issue was introduced by 8a2a450686.
It affected GUI text objects (CText) with `scrollbar` set to true; when
their caption was long enough for a scrollbar to be visible and then the
size changed (got bigger) so that no scrollbar was needed anymore, then
for a single frame the text was completely misaligned. This happened
because in `CText::Draw` the scrollbar wasn't updated yet, so the newly
added `GetScrollBar(0).IsVisible()` check still returned true, even
though it wouldn't end up being rendered anyway -- it was updated in
`IGUITextOwner::DrawText` eventually.

This happened to the tutorial info panel in the starting economy
walkthrough, for example. Note: in that case the scrollbar wasn't ever
drawn, but it was temporarily set visible within a frame by the JS
object resizing logic.
2026-07-22 23:51:49 +02:00
Vantha 6ed963b94c Don't check all scrollbars' visibility in CText
The CText class is designed to only work with one scrollbar, so the
any_of was pointless.
2026-07-22 23:51:49 +02:00
Vantha a784659158 Two adjustments to the Introductory Tutorial
This patch splits the steps that said "Wait for X and then do Y" into
two different steps "Wait for X" and "Do Y".
2026-07-22 23:51:49 +02:00
Vantha 52b40aaa4f Add a tutorial panel for explaining the GUI
This patch adds a new type of tutorial steps called "GUI explanation",
with a corresponding GUI panel. The purpose of it is to explain what a
certain GUI element does. To make use of it the trigger script has to
specify the target GUI object's name as well as the side on which to
place the explanation panel relative to the target itself. The panel
then highlights the target object by fading everything else out with
black and also uses an arrow to point to it. Whilever the target GUI
object is hidden, the panel hides the background fade too and shows a
warning message.
Unlike for the other steps, the TutorialManager does not hide the
previously active panel when showing a GUI explanation, but instead
only disables it, since it could contain relevant information and the
GUI explanation panel is visibly placed "above" all other panels (in the
Z axis).
2026-07-22 23:51:49 +02:00
Vantha 27fbf02ff4 Improve the ending of tutorials
This patch introduces two functions `CompleteTutorial` and
`FailTutorial` for the tutorial steps to call. They can pass a
message to it to be shown on the victory/defeat screen.
`CompleteTutorial` is also called automatically when all steps are
finished, which resolves #8583 and prevents it from happening in the
future.
`FailTutorial` isn't used anywhere at the moment, but it'll be useful
for the future.

Fixes #8583
2026-07-22 23:51:49 +02:00
Vantha f1a9c503b8 Support custom hint & button captions in the tutorial
This patch allows steps to override the default hint caption and button
caption set by the PanelControlSection class. This allows them to better
communicate what the player is supposed to do, e.g. don't show "Follow
the instructions" if the player is only supposed to wait.
2026-07-22 23:51:49 +02:00
Vantha f39e71cca0 Move calls in playersFinished to handlers
This patch fixes the TODO comment in playersFinished and moves
all of the calls to handlers. The only reason for adding back the
function `handlePlayersFinished` is to prevent duplication in the "won"
and "defeated" message handlers. In the future, code to execute when
players finish in the future should exclusively be added by registering
new handlers, not by adding it to that function.
2026-07-22 23:51:49 +02:00
Vantha 6456bccebe Replace old GetState and SetState calls
966727b52e made the player state an enum and introduced more descriptive
functions to achieve the same thing, but it seems they were forgotten to
be replaced in a few places, which this patch fixes.
2026-07-22 23:51:49 +02:00
Vantha 0cc025f675 Indicate if a tutorial step is already done
If a new tutorial step has already been completed by the player it isn't
skipped, but instead shown with the continue button, so that the player
can manually switch to the next one. However, it wasn't well
communicated to the player that this was the case and why the continue
button was shown at the same time as the instruction. This patch adds a
hint "You have already done this." to explain the this to the player.
2026-07-22 23:51:49 +02:00
Vantha 05d434830f Add hotloading support to the tutorial UI 2026-07-22 23:51:49 +02:00
Vantha 2522c305dd Allow defining tutorial steps more compactly
This allows the trigger scripts to combine consecutive tutorial steps
that only differ in the `panelData.text` property into a single one that
instead defines a `panelData.texts` array.
2026-07-22 23:51:49 +02:00
Vantha 7e77065c56 Add an info panel to the tutorial
This patch adds a new tutorial step type and corresponding tutorial
panel labelled "info". It is intended to display steps whose purpose it
is to explain something to the player and give tips -- rather than
just giving instructions and telling the player what to do, like the
instruction panel does.
Also, it can show several related steps at once. To do that, the first
step has to set the 'appendable' flag to true and can also define a
title; then the succeeding steps can then set the 'appendToPrevious'
flag to true in order to do exactly that.
Note: 'info'-type tutorial steps are still supposed to be able to define
triggers, switch to the next step on their own and hide the continue
button on the info panel, to teach the topic interactively, e.g.
"Select a unit by left-clicking on it."

In order to prevent code duplication between `InfoPanel` and
`InstructionPanel` a generic superclass `TutorialPanel` is introduced,
which manages the text, hint, and button objects.
2026-07-22 23:51:49 +02:00
Vantha 6dd8139b43 Only show the last instruction in the tutorial
The idea is to add different types of panels to the tutorial in the
future. And the only texts that players might read multiple times are
tips or explanations, which the plan is to display on an entirely
separate panel anyway.
2026-07-22 23:51:49 +02:00
Vantha c2c8f5bdf2 Remove pointless trainingDone from tutorial
In `Init` it was always overwritten to false, so `IsDone` always returned
false anyway.
2026-07-22 23:51:49 +02:00
Vantha 1f7d384c29 Fix player command handling in the tutorial
Move the code that checks whether a player command is a "continue
tutorial" into a separate method, so that it never overrides the player
command action of the active tutorial step. This could previously
happen if a step had the showContinueButton flag was set to true (and
a OnPlayerCommand method defined).
2026-07-22 23:51:49 +02:00
Vantha 2f27dcc97d Rename index to stepIndex in Tutorial.js
Makes it more clear what it is an index of.
2026-07-22 23:51:49 +02:00
Vantha 6e6864fd7c Improve internal naming of tutorial triggers
Make the naming consistent with e.g. the Triggers Demo map
Remove the "On" at the start, since it's otherwise used for message
handlers, and replace "Trigger" at the end with "Action", since that
more accurately describes what it is.
2026-07-22 23:51:49 +02:00
Vantha 702e3f1113 Revise tutorial step handling
- Remove the delay functionality from the tutorial. It was unused and
  that for a reason. Switching to the next step after a fixed amount of
  time is never wanted. It was only used to force-show the ready button
  in one case, but a designated bool communicates the purpose better.
- Rename the "ready" button to "continue" as it fits better.
- Rename "leave" to "isLast" as it's more descriptive.
- Rename the "warning" object of the instruction panel to "hint" as it's
  not always display warnings, and move its captions to the class
  prototype like the coding conventions state.
- Simplify the logic in NextStep a bit to make it more readable.
2026-07-22 23:51:49 +02:00
Vantha f3b71a1fbf Remove unused this.fullText from the tutorial 2026-07-22 23:51:49 +02:00
Vantha e02a2e0b31 Add support for different types of tutorial steps
This patch doesn't add any new functionality and keeps the introductory
tutorial and economy walkthrough as they are. Instead, it rearranges some
code to enable easily adding different types of tutorial steps in the
future. The idea is for each type to be displayed on a different panel
and for the TutorialManager to switch back and forth between them, and
to handle and translate the received messages from the simulation and
pass them along to the active panel. Currently, there are only
"instruction"-type steps, which are handled by the InstructionPanel in
the GUI. But new ones can be added in the future, like information boxes
or bigger objectives.
2026-07-22 23:51:49 +02:00
Vantha ab4a9d6def Rename tutorial "goals" to "steps"
While it's currently the case everywhere, tutorial "steps" don't
necessarily have to be goals, they could be stuff like tips or info too
in general, if different types of "steps" are added in the future.
2026-07-22 23:51:49 +02:00
Vantha dd396f19b6 Separate handling of tutorial goals and warnings
This is more explicit and makes the code cleaner.
2026-07-22 23:51:49 +02:00
Vantha ca8a0a5611 Move "TutorialPanel" style to session styles
It's not used anywhere else besides there, so that where it belongs.
2026-07-22 23:51:49 +02:00
Vantha 663f5c5ff6 Create designated tutorial class in the GUI
This keeps messags.js shorter, prevents unnecessary GetGUIObjectByName
calls and, most importantly, makes it a lot more extensible for the
future.
2026-07-22 23:51:49 +02:00
Vantha 0e6e0280fc Prevent segfault in CMiniMap::Tick
Oversight in 01476b9836
For example, it could cause a segfault when rendering a frame after
EndGame was called therefore g_Game already deleted.
2026-07-22 23:51:49 +02:00
Ralph Sennhauser adfe6b0c36 Convert wxString using ToStdWstring
Avoid using c-style cast to convert wxString to std::wstring.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-22 16:49:41 +02:00
Ralph Sennhauser eae57d9aab Fix clang-tidy modernize-avoid-bind check
And enable the check in the config.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-21 17:15:07 +02:00
Ralph Sennhauser 91a4b834a8 Add clang-tidy linting script
Add groups we might be interested in and disable failing checks.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-21 17:15:07 +02:00
phosit 9598c6c2e1 Only clone this.position when it's an object
Refs: #8951
2026-07-19 13:01:04 +02:00
phosit e6f75f2c33 Fix displaying errors of map generation scripts
Displaying the error lead to a freeze.

Introduced in d842a134f9.
2026-07-19 11:17:35 +02:00
Ralph Sennhauser 6244d25f90 Don't generate SDL events on Atlas shutdown
WX may still generate mouse events after calling CVideoMode::Shutdown(),
so don't create SDL events triggering assertions.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-19 08:59:06 +02:00
Ralph Sennhauser 63629195ba Wait for work to be finished before shutting down
Stopping the timers isn't sufficient, also wait for in-flight work to be
finished first.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-19 08:59:06 +02:00
Ralph Sennhauser 2fae39df3b Use new WX event macros
Were added in 2010.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-18 13:32:23 +02:00
Ralph Sennhauser f1181bada0 Don't install SDL default signal handler for Atlas
If we catch the signal we'd have to communicate that we terminated by
signal, which might depend on shell. There is also the issue of various
dialogs blocking regular quit which we don't want, so that would need
extra work as well.

As such just let the SIGINT/SIGTERM do there default action and forgo
cleanup and let the OS handle it.

Fixes: #198
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-18 11:50:31 +02:00
Ralph Sennhauser 309ed5ef28 Add fullscreen support to Atlas
Add a fullscreen toggle to the View menu and with a global hotkey,
reusing the default one from the main game.

Unlike the current implementation this one doesn't need the game canvas
to be focused and also works on GTK.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-18 11:33:17 +02:00
Ralph Sennhauser 3c8b7dfa7a Fix Enter key behaviour on Windows
Commit fe192fe58f made it possible for
events to properly propagate to the top window. As on Windows Enter is
also used for navigation, i.e. used to trigger the dialogs default action,
which in our case seems to be quit.

Tell the wxSpinCtrl to fire wxEVT_TEXT_ENTER instead and handle it.

The wxCommandEvent wxEVT_TEXT_ENTER doesn't carry the value, so need to
use dynamic event binding (which is preferred way anyway).

Also show the numPlayerSpinner as a spinner instead of a text field to
match visuals to actual behaviour.

Fixes: #9026
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-18 11:24:36 +02:00
Ralph Sennhauser 32b9713781 Modernize Brush in Atlas
Use dynamic event bindings allowing to bind all events in all sort of
ways. Addionally no need for subclassing wx widgets.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-18 11:24:36 +02:00
Vladislav Belov 7ee476928b Fixes missing window preview on Alt+Tab
There was a crash on Alt+Tab in fullscreen for some specific driver:

https://code.wildfiregames.com/D1212

It was related only to post processing so it's time to try to enable
rendering again (but with provided option to disable it). Also without
rendering we might have some bugs in other components. See:

https://github.com/libsdl-org/SDL/issues/5033#issuecomment-981819661

The issue is reported here (first one):

https://wildfiregames.com/forum/topic/129061-two-vulkan-issues-in-a27-and-unrelated-choppiness-caused-by-control-groups/
2026-07-14 19:54:00 +02:00
phosit b89ab85415 Export functions from startingStrategy.js
The functions were defined on the `Headquarters` prototype. But not all
functions are needed outside of "startingStrategy.js". Also doing it
this way, "startingStrategy.js" and "headquarters.js" had to mutually
import each other.
2026-07-14 10:40:42 +02:00
Ralph Sennhauser c0645c8b90 Fix value of nativewchar in premake5.lua
Available option values or "On" and "Off".

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-14 08:56:36 +02:00
Ralph Sennhauser ca536a8cf1 Bump premake to 5.0.0-dev (2026-07-03)
This adds support for the compilcommands action, which allows to improve
the cppcheck workflow and is a requirement for include-what-you-use.

Also disable unused dependencies like is done for macOS.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-14 08:56:36 +02:00
Ralph Sennhauser df48ad5813 Add support for premake-5.0.0-beta8
"flags" where deprecated and replaced by dedicated functions.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-14 08:56:35 +02:00
Vladislav Belov 2a6f17fbae Uses std::string_view for UTF-8 conversions 2026-07-14 00:14:27 +02:00
Vladislav Belov ef5088e595 Uses std::string_view for Script::Interface::Eval 2026-07-13 23:53:24 +02:00
phosit ad08462626 Remove the first isResourceExhausted
This function is overwritten later.
This redundancy has been introduced in 4e664dd712 before only the
second existed.
2026-07-13 21:15:48 +02:00
Baelish 161da119ba Increase Max Gatherers for 'Small' Ruins
The maximum number of gathers is 1 for small ruins, I change it to 5. It is the issue 8599.
2026-07-13 19:29:03 +02:00
real_tabasco_sauce 60f9737cfb Buff halberdiers by increasing movement speed and adding 1 hack armor. 2026-07-13 09:05:10 +02:00
Vladislav Belov 5778ef6cac Removes std::shared_ptr usages from particles 2026-07-13 01:01:03 +02:00
Vladislav Belov d2375de187 Splits PrepareScene and remove intermediates
We don't need to have intermediate functions as they don't add something
useful.
2026-07-13 00:40:36 +02:00
Vladislav Belov 43dd988ee7 Removes render methods from GameView 2026-07-13 00:40:34 +02:00
Vladislav Belov a2798b733f Splits render frame function 2026-07-13 00:40:32 +02:00
Ralph Sennhauser 38d247467f Handle incompatible mods for Atlas
In case of incompatible mods listed on the command line we can't launch
the mod selector from Atlas. Instead list the offending mods and launch
with the default mods.

Fixes: #8852
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-12 20:16:52 +02:00
Ralph Sennhauser f4bb99094d Stop timers on closing Atlas
Otherwise we might try to render a view when half the infrastructure is
already taken down, which results in segfaults or asserts.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-12 20:04:20 +02:00
Ralph Sennhauser 16188c7305 Add birds eye view toggle to View menu
On request by @nifa add a checked menu item to View menu to set birds eye view.

When game view is focused, the focus which it hogs almost always, then
'B' doesn't propagate properly so use Ctrl+B instead in line with other
main menu shortcuts.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-12 19:45:30 +02:00
Vladislav Belov abf444d91c Reduces vertex maximum stride to 16
https://wikis.khronos.org/opengl/Vertex_Specification_Best_Practices

> The alignment of any attribute's data should be no less than 4 bytes.

But to make it a bit safer for older drivers we prefer to use 16 bytes
alignment (vec4) for now to match std140.
2026-07-12 17:54:26 +02:00
Vladislav Belov db8c05572f Adds Vulkan vertex format verification 2026-07-12 17:09:11 +02:00
Vladislav Belov fd99348d56 Fixes AMD Vulkan drivers crash with GPU skinning
R16G16B16_SFLOAT isn't guaranteed to be supported:
https://docs.vulkan.org/spec/latest/chapters/formats.html
See Table 17. Mandatory Format Support: 16-bit Components

It's safe to use less components:
https://docs.vulkan.org/spec/latest/chapters/fxvertex.html

> The number of components in the vertex shader input variable
> need not exactly match the number of components in the format.
> If the vertex shader has fewer components, the extra components
> are discarded.

The issue is reported here (second one):

https://wildfiregames.com/forum/topic/129061-two-vulkan-issues-in-a27-and-unrelated-choppiness-caused-by-control-groups/
2026-07-12 17:09:09 +02:00
Ralph Sennhauser 9add728945 Don't track fullscreen mode
SDL already does it.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-10 21:37:14 +02:00
Ralph Sennhauser 89c6bd5de6 Remove unused ActionButton
Unused and doesn't add value on top of regular wxButton, just a slightly
different API.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-10 20:24:35 +02:00
Vladislav Belov 92ee2dba9e Removes unused OGL legacy 2026-07-09 22:53:30 +02:00
Vladislav Belov 552d91e92a Removes legacy GL error handling
We have GL_KHR_debug for proper error handling. ogl_WarnIfError isn't
really useful since it doesn't provide per-call granularity and requires
recompilation. So if it'll be really needed we can wrap all GL calls
into a macro like GL_CALL.
2026-07-09 22:53:29 +02:00
Ralph Sennhauser 711a584d3e Remove workaround for old SDL2 on Windows
This removes the workaround for a bug[1] @Stan confirmed was fixed
upstream in SDL2 2.20 in the mentioned bug report. On Windows we are
using 2.32.8 now.

[1] https://github.com/libsdl-org/SDL/issues/5033

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-09 16:24:09 +02:00
Atrik d85cea244e Add projectile count to template viewer & tooltips 2026-07-09 09:25:37 +02:00
Atrik 20d8fdba43 Make onager throw 4 stones per attack 2026-07-09 09:25:37 +02:00
Atrik ec00288b36 Add support for throwing multiple projectils
Fixes #8918
2026-07-09 09:25:37 +02:00
Vladislav Belov 63b4b35bd3 Removes unused code about GL version from OGL 2026-07-08 20:54:11 +02:00
Vladislav Belov 11f78e5c1a Uses GLAD to get GL version 2026-07-08 20:52:23 +02:00
Vladislav Belov cd872e38d7 Removes functions about extension from OGL
We use GLAD directly now.
2026-07-08 20:06:36 +02:00
Vladislav Belov 4ca83fa071 Uses GLAD to check extensions
If GLAD failed to load an extension then we can't use it. Because all
its functions are nullptr.
2026-07-08 20:06:18 +02:00
phosit 2c44b5301c Only clone this.targetPos when it's an object
When writing 55f2d356ff, I didn't know that `clone` only handles
objects. Now there is an extra path for `undefined`.

Fixes: #8951
2026-07-08 17:00:59 +02:00
Ralph Sennhauser 99bbc24265 Remove global g_xres and x_yres
Instead query g_VideoMode where needed. As both g_xres and g_yres aren't
global anymore remove static from UpdateRenderer. While at it use more
desicriptive names: GetXRes -> GetWindowWidth, GetYRes ->
GetWindowHeight.

This reduces the amount of variables tracking width and height by one
each.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-08 11:35:46 +02:00
Ralph Sennhauser b588b62304 Fix Kush main menu background
It looked ok as long as the window had a 16:9 aspect ratio, however
default window size is 4:3 which squishes the balcony.

Add a horizontal alignment support for background layers, which allows
to fix this issue for any aspect ratio.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-08 10:55:24 +02:00
Ralph Sennhauser 173d768087 Fix UB in GUISprite Draw
Using the no args constructor m_RoundCoordinates doesn't get
initialized, meaning the memory can contain whatever. We were lucky in
that in most cases random means true.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-08 09:51:17 +02:00
Vladislav Belov 2bc674cbaa Removes extensions prior 2.1
Since we generate GL headers using GLAD with 2.1 version we don't need
to check extensions prior that.
2026-07-08 09:28:52 +02:00
Ralph Sennhauser 3b9ec75e28 Split out View main menu in Atlas
On suggestion by @nifa add a View menu.

Initially move wireframe, smooth framerate and reset camera actions
there.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-07-08 08:53:02 +02:00
Vladislav Belov eb3f55ae27 Removes unused ogl_SquelchError 2026-07-08 08:13:48 +02:00
Vladislav Belov 0a22bc66f7 Makes GL error handling explicit in report 2026-07-08 08:13:46 +02:00
Vladislav Belov 0168f45a65 Refactors GL device report
It makes the report function easier to read.
2026-07-08 08:13:44 +02:00
Vladislav Belov 46af67b5bd Removes RenderPath
We can render the game only with shaders so we don't need to support
fixed function pipeline as a separate render path. We only need to know
when to warn a user.

Fixes #6244
2026-07-07 23:12:45 +02:00
Vantha fb38c8781b More versatile placement of research buttons
This patch allows techs to optionally define a property "placeBelow"
specifying a combination of class requirements. The selection panel then
tries to place their research button below the training button whose
unit matches these classes -- if there is only and exactly one.
This is useful for techs only affecting a single type of unit: it e.g.
allows always placing the fishing nets research button below the fishing
boats training button.
To prevent duplicating information in "placeBelow" (e.g. from
"affects"), it can also be set to two magic values: "{AffectedUnit}" and
"{UnlockedUnit}". In practice, many techs use those, but class
combination remain useful for granular control in very specific cases.

Regarding tech pairs, as explained in a comment, their two research
buttons can now be placed in three different arrangements (with
descending preference):
1. Vertically below a single training button.
2. Horizontally below two adjacent training buttons.
3. Horizontally adjacent in the bottom row (below no training buttons).

Vertically in the third and fourth rows (below no training button) --
how it was previously -- is no longer done as it'd conflict with and
doesn't fit the new layout and the clear separation between "generic"
and "specific" techs.

Whenever a research button can't be placed in their preferred location
because it is already occupied, the code simply falls back to the default
position in the bottom row.

This patch also adds a new game option to hide the new small arrows above
the research buttons in order to give more experienced players who already
know the techs well the possibility to reduce visual clutter. By
default, the arrows are shown.
2026-07-06 05:01:12 +02:00
Vantha 280a19587f Define technology pairs in an array
This patch renames the "pair" property of paired technologies to
"partOfPair" for clarity and in the pair parent packs the two techs
(previously "top" and "bottom") into an array called "pair".
This makes the hierarchy more clear in the code and pairs might not be
always placed vertically in the future.
2026-07-06 05:01:12 +02:00
Vladislav Belov 8491b7f084 Removes Unattach from emitter
We don't really need that proxy. As the main idea is to move the
ownership from a model to the particle manager.
2026-07-06 01:05:09 +02:00
joeybadz 961dfc9279 Fix the deserialization of game state for AIs
Adjust function arguments to prevent errors when loading/rejoining a game with AI. These occurred due to 2f2cbb96bf not adding arguments for the state/playerID

Fixes: #9001
2026-07-02 21:50:32 +02:00
Dunedan b848e760e4 Re-use XMPP resource GUID for whole app runtime
Instead of using a new GUID as part of the XMPP resource for each XMPP
connection, this keeps the same GUID as long as pyrogenesis is running.

This is meant to make it easier to detect players violating the Terms of
Use by using multiple accounts to smurf or circumvent bans, as after
this change it's not sufficient anymore to connect with another account
to stay anonymous, but instead players have to restart pyrogenesis as
well.
2026-07-01 15:36:51 +02:00
Ralph Sennhauser bc0e043696 Don't allow rotation in atlas bird view
except for rotation around the y axis. This makes the behaviour
consistent with the main game.

Ref: #8931
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-29 20:12:31 +02:00
Vladislav Belov 0538e95793 Makes GameView::GetCamera constant 2026-06-28 17:57:26 +02:00
Vladislav Belov e0d131854d Makes GameView returning reference on camera 2026-06-28 17:57:16 +02:00
Vladislav Belov 0cc07aa209 Removes legacy glEnable of GL_TEXTURE_2D
It needs to bo enabled only for fixed-function pipeline.

https://registry.khronos.org/OpenGL-Refpages/gl2.1/

> If enabled and no fragment shader is active, two-dimensional texturing is performed
2026-06-28 15:56:33 +02:00
Vladislav Belov 74f11d2fd2 Adds const to particle emitter type
Emitter type must not be changed during any emitter update.
2026-06-28 14:30:44 +02:00
Vladislav Belov 7790c0972b Removes legacy timers
Modern profiling tools provide more details and more precise
measurements for more platforms. For simpler cases we have our in-game
profiler.
2026-06-28 13:34:01 +02:00
Vladislav Belov fa0e593669 Replaces virtual by override for particle emitters 2026-06-28 12:01:39 +02:00
Ralph Sennhauser 4967922447 Don't load WGL
Depend on SDL and wxWidgets doing the necessary work.

Also remove WGL from glad.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-28 09:49:26 +02:00
Ralph Sennhauser d58e605992 Remove dependency on X11
Glad GLX was the last consumer of X11 libraries as such we no longer
depend on X11 directly.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-28 09:49:26 +02:00
Ralph Sennhauser a27fe1f8a1 Drop EGL and GLX from glad
Also regenerate files with latest glad and vulkan 1.4.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-28 09:49:26 +02:00
Ralph Sennhauser c5a9d18cfa Drop use of GLX and EGL
Only used for hw-report and only when using GLX which is for X11 only.
The usefulness of those reported properties is questionable and X11 is
becoming rarer.

This allows us to drop a direct dependency on X11 delegating the
handling to SDL and wxWidgets respectively GTK.

Further SDL3 wont expose supported video driver at compile time making
this step more meaningful.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-28 09:49:26 +02:00
Ralph Sennhauser 9baa3bcd62 Drop DGA mouse workaround
Is no longer supported in SDL2, so this workaround does nothing anymore.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-28 09:49:25 +02:00
Ralph Sennhauser 08cd7e9096 Drop vsync workaround for wxWidgets
wxWidgets already sets it's prefered mode.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-28 09:49:25 +02:00
Ralph Sennhauser 0bfd703eda Drop XInitThreads workaround
GTK used by wxWidgets on Unix calls it when creating an X11 window as
does SDL. As such this is no longer needed and we avoid a direct
dependency on X11.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-28 09:49:25 +02:00
Vladislav Belov 1709149740 Adds instancing to particles
We use instancing to provide dynamic data for particle only once and not
for each vertex.
2026-06-22 23:18:29 +02:00
Vladislav Belov 50d82810bc Moves UV coordinates to a separate vertex buffer
UV coordinates are constant so we don't need to upload them each frame.
Ideally we shouldn't have UV coordinates at all as we could use
gl_VertexID but it's not available on all supported GLSL versions.
2026-06-22 23:18:27 +02:00
Vladislav Belov 1380a93077 Packs particle size and angle to axes
We need to have per-vertex data to be constant to use instancing.
Now we have only UV coordinates.
2026-06-22 23:18:26 +02:00
phosit e82f8ac5ac Log instead of crash on compile error in the gui
Refs: #8195
2026-06-21 20:05:39 +02:00
phosit b0af0971e3 Don't crash on compile error of hotloads
Hotload functions aren't expected to throw an error. Instead return the
error to the function who is waiting for the module.
2026-06-21 20:05:39 +02:00
Vladislav Belov db9f60b540 Renders only alive and visiable particles
We don't need to update and render dead or invisible particles. The
code still uploads the whole chunk but I'll improve that later.
2026-06-21 18:40:52 +02:00
Ralph Sennhauser 8bb72251ec Drop use of off_t in soundmanger
The ogg library itself doesn't use off_t, mostly just int and long.

With off_t being problematic as Windows doesn't support _FILE_OFFSET_BITS
replacing this removes a potential headache.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-21 13:27:00 +02:00
Vladislav Belov 45cb592f22 Adds ability to enable smooth framerate in Atlas 2026-06-21 11:30:27 +02:00
Ralph Sennhauser f9af0e571a Mark ownership using unique_ptr in Atlas sections
And remove unused destructors.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-21 09:16:11 +02:00
Vladislav Belov 54b529ddac Fixes crash for too many particles
The maximum number of particles was unbound. It's bound by the
number of maximum vertices per vertex buffer.
2026-06-20 21:45:55 +02:00
vyordan ec8b420abc Move Script* classes to Script namespace
- Rename ScriptEngine, ScriptContext, ScriptInterface, ScriptRequest to
  Script::Engine, Script::Context, Script::Interface, Script::Request
- Remove 'Script' prefix from filenames:
  ScriptContext.* → Context.*
  ScriptInterface.* → Interface.*
  ScriptRequest.* → Request.*
  ScriptEngine.* → Engine.*
  ScriptConversions.* → Conversions.*
  ScriptExceptions.* → Exceptions.*
  ScriptForward.* → ForwardDeclarations.*
  ScriptStats.* → Stats.*
- Update all includes, forward declarations, and friend classes
- Use namespace Script { ... } in .cpp definitions to avoid repetitive
  Script:: prefix (keeping global callbacks outside)
- Rename internal implementation structs:
  ScriptInterface_impl → Interface_impl
  ScriptFunction → Function
- Update copyright year to 2026 in all touched files
- Suppress pre-existing cppcheck warnings (uninitvar, nullPointer, unknown
  macro) by adding them to suppressions-list.txt (these are not caused
  by this refactor)

Fixes #7516
2026-06-20 17:43:00 +02:00
Ralph Sennhauser 310c4bf028 Add staticbox padding style in Atlas
GTK static box doesn't have padding, so add a style variable to allow
adding a custom padding.

Replace implicit padding with explicit padding where needed.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-20 14:38:42 +02:00
Vladislav Belov d23f9e1da3 Adds a storage check for resolve PBR shader
We need to check for storage support because we outpout result into a
storage. Note: it seems we might have a bug inside GL backend or inside
Mesa drivers which prevents us from running resolve on compute.
2026-06-20 13:29:14 +02:00
Vladislav Belov 7a19f38070 Allows floating point textures based on extension 2026-06-20 13:29:13 +02:00
Vladislav Belov f72c0c1c09 Enables fragment PBR resolve shader in PostProc 2026-06-20 13:29:11 +02:00
Vladislav Belov 8c5416e2c5 Adds fragment shader PBR resolve
It allows to have PBR for devices without properly detected compute
shaders.
2026-06-20 13:29:01 +02:00
Ralph Sennhauser 181a29597d Remove helper function FileExists
Use std::filesystem at caller site instead.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-20 12:01:38 +02:00
Vladislav Belov 5ca4c93f55 Reduces canvas2d layout for SPIR-V
It's preferrable to keep push constant under 64 bytes for some vendors.
The layout optimization rule is similar to C++ one.
2026-06-20 11:22:29 +02:00
Ralph Sennhauser 355c068068 Remove helper function FileSize
Use std::filesystem at caller site instead.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-20 09:00:57 +02:00
phosit 364d50e184 Move the gameView input handler to CGameView
`game_view_handler` isn't global anymore. That makes the interface
simpler and might make the compilation and the runtime faster.
2026-06-19 20:53:52 +02:00
phosit 3bf8e92ed4 Move the profileViewer handler to CProfileViewer
`CProfileViewer::InputThunk` isn't global anymore. That makes the
interface simpler and might make the compilation and the runtime faster.
2026-06-19 20:53:52 +02:00
phosit 80d5fd7a52 Move the gui input handler to CGUIManager
`gui_handler` isn't global anymore. That makes the interface simpler and
might make the compilation and the runtime faster.
2026-06-19 20:53:52 +02:00
phosit b2a8f94a20 Move the console input handler to CConsole
`conInputHandler` isn't global anymore. That makes the interface simpler
and might make the compilation and the runtime faster.
2026-06-19 20:53:52 +02:00
phosit 596c0c2ddd Split screenshot from main input handler
This enables the screenshot hotkeys in atlas.
2026-06-19 20:53:52 +02:00
phosit 464d40ab61 Split window from main event handler
Two globals can be removed.
2026-06-19 20:53:52 +02:00
phosit 3af4287f6d Change the return type of event-handler
The return value is more strongly typed.
2026-06-19 20:53:52 +02:00
phosit 47e8a17a41 New input handling system
The new system allows to register all function objects as Input::Handler
not only function pointers.
To not get dangling references a handler is unsubscribed on it's
destruction.
The order in with the handlers are executed has to be specified by the
slot-argument, instead of the reverse order of registration.
2026-06-19 20:53:51 +02:00
Ralph Sennhauser 02d9a083aa Restore visiblity on sim reset in Atlas
The LOS override for all players isn't serialized as such we have to
restore it when resetting a game.

Fixes: #8926
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-19 19:55:42 +02:00
Ralph Sennhauser 628713859f Don't send default setting to engine
Sending default setting on first view of a section/tool to the engine
triggers the "you have changes" mechanism. Sending them just in case
isn't needed unless there is a bug in a different place.

Drop this preemptive measure.

Fixes: #3029
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-19 19:25:09 +02:00
Ralph Sennhauser 52dee75c47 Remove unused helpers from wfilesystem
Were used for mtime conversion. Cpp-20 has std::chrono::file_clock.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-18 20:47:34 +02:00
Ralph Sennhauser 3c0274c7cc Remove unused android filesystem helpers
We don't use neither opendir nor readdir nor closedir. Further there are
no callers for init_libc().

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-18 19:48:05 +02:00
Ralph Sennhauser 62e116340e Remove POSIX rename wrapper
Unused by now, use `<filesystem>` instead.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-18 17:46:00 +02:00
Ralph Sennhauser 792949e812 Remove POSIX mkdir wrapper
Unused by now, use `<filesystem>` instead.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-18 10:53:30 +02:00
Ralph Sennhauser ca3bacf6c1 Update Atlas sidebar layout
Replace the wxBoxSizer with a wxFlexGridSizer so the gaps between main
elements, typically wxStaticBoxSizer, remain uniform across the tools.

Add a style variable to control the wxFlexGridSizer on platform basis.

Also replace the obsolete wxScrolledWindow by inheriting from
wxScrolled<wxPanel> instead.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-17 18:58:02 +02:00
Ralph Sennhauser e3c65841de Replace all uses of POSIX stat
Use `<filesystem>` instead of `stat` and remove wrapper.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-17 13:14:28 +02:00
Ralph Sennhauser fab4a132e1 Fix camera reset under bird view in Atlas
Resetting camera while in bird view should reset birdview flag.

Fixes: 9388692a47
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-16 19:20:53 +02:00
Ralph Sennhauser 8336e679af Replace all uses of POSIX realpath
Use `<filesystem>` instead of `realpath` and remove wrapper.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-16 14:08:02 +02:00
Ralph Sennhauser 6b4ecbdc40 Create dedicated stylesheet for Atlas
This is meant as a central place to tweak layout per platform.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-15 21:27:42 +02:00
Ralph Sennhauser 149baf116b Replace all use of POSIX truncate
Use `<filesystem>` instead of `truncate` and remove `truncate`
portability wrapper.

Add a helper function `StatusFromSystemError` to convert error_code to
`Status`.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-15 15:33:59 +02:00
Ralph Sennhauser 57f5b73458 Remove unused wrapper for POSIX rmdir
std::filesystem::remove can be used instead.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-15 15:33:59 +02:00
Ralph Sennhauser 518ed74496 Replace all use of POSIX unlink
Use `<filesystem>` instead of `unlink` and remove `unlink` portability
wrapper.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-15 15:33:59 +02:00
Vladislav Belov 4259c78150 Removes unused Get/SetDepthTextureBits methods
Methods were added in f903b83674.
Methods became unused in 12e2428495.
2026-06-15 00:35:04 +02:00
Ralph Sennhauser 71400e8045 Drop unused lowlevel functions
and associated types. Aka posix dirent.h abstraction.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-14 21:58:59 +02:00
Ralph Sennhauser 43e7dbc6da Use std::filesystem for filesystem abstraction
Drop the use of lowlevel interfaces and consitently use the cpp
interface decupling it from systm dependent code.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-14 21:58:59 +02:00
phosit 2f2cbb96bf Remove this.isDeserialized from BaseAI
`this.isDeserialized` is only required for AIs which `Deserialize`
function depends on the game state.
2026-06-14 17:52:54 +02:00
phosit a4b580991b Move this.turn to PetraBot
The `BaseAI` shouldn't make assumptions whether the AI runs every turn.
2026-06-14 17:52:54 +02:00
phosit babe9e5c18 Remove this.events from AIs
`this.events` is only valid during one turn. When it is used in the next
turnn it might be outdated. So it makes no sense to keep it alive untill
the next turn.
2026-06-14 17:52:54 +02:00
phosit cbce748b8c Remove moduleName from Petras data.json
It was accidentally re-introduced in 88dc947b6a.
2026-06-14 13:21:26 +02:00
Ralph Sennhauser 1ab55e7f2e Remove leftover code from wxCollapsiblePane use
There is a workaround for an old bug with the use of wxCollapsiblePane.
As the widget itself is no longer in use, just remove the now dead code.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-13 18:34:09 +02:00
Ralph Sennhauser b4fe426963 Replace notebook with choicebook
The terrain selection notebook is painful to navigate with a large
amount of tabs. Further the control is broken on macOS. As such replace
the wxNotebook with a wxChoicebook.

Fixes: #8705
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-13 16:57:32 +02:00
Ralph Sennhauser 8cb4f5e4a3 Fix negative content width GTK warnings in Atlas
Interdependent content width in terrain selection panel results in GTK
throwing warnings. Don't expand the grid cell content.

Also wrap the grid to keep spacing consistent and not variable for the
terrain buttons.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-13 13:38:44 +02:00
Ralph Sennhauser 9388692a47 Add bird view to Atlas
Fixes: #2657
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-12 21:54:01 +02:00
Ralph Sennhauser fa9584fdc0 Fix some Atlas header includes
iwyu 0.26 now want's full declaration of TYPE in case of
std::vector<TYPE>, which is good as it allows the header to be
self standing.

There are some other changes suggested in part of the headers not being
updated when they should have been and some due to changes in iwyu
itself.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-12 21:22:36 +02:00
Ralph Sennhauser 7f4377c086 Treat <wx/defs.h> as private header
Add the header to iwyu mappings as private as the wx documentation
doesn't suggest otherwise.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-12 21:22:36 +02:00
animus 1034b55037 Rename class names postifxed with "Man" to "Manager".
A regex-based
search across the codebase confirms there are no other instances
of "Man" that should be renamed to "Manager".
Variables were not renamed.
2026-06-12 18:35:32 +02:00
animus b1627f5158 Remove redundant virtual keywords
This commit performs code cleanup to improve
code clarity and consistency:

Remove redundant 'virtual' keywords from methods that are already marked
with 'final' or 'override', as well as reducing redundant 'override
final's to 'final'.
2026-06-12 18:35:32 +02:00
Jonny McCullagh 917275d6cb Add more tips incl the Arsenal and Great Hall
Fixes #8914
2026-06-12 10:44:41 +02:00
mehmed-faheim-arslan 50e1f51755 Draw trainer section before tree section
Previously, TreeSection was drawn before TrainerSection.
Reversing the order ensures TrainerSection layout is resolved first,
which fixes scroll state being computed against an incomplete
structree page render.

Fixes #8893
2026-06-10 20:55:52 +02:00
mehmed-faheim-arslan 39b1311fac Allow players to set rally points on allied buildings
Instead of storing a single flat list of positions and data per
building, RallyPoint now stores them keyed by player ID. This lets
mutual allies independently set and display rally points on each
other's structures.

The GUI now allows selecting allied buildings with a rally point
and only shows the viewing player's own rally point data.
GuiInterface gets an OnUpdate handler to keep displayed positions
in sync when rally point targets move.

GetRallyPointCommands now takes raw position and data arrays instead
of a component reference. The network command field is also renamed
from "entities" to "structures".

Fixes #3115
2026-06-10 00:09:48 +02:00
wowgetoffyourcellphone 8a999d63b7 Add missing garrisoned prop point to the Athena Nike mesh. 2026-06-09 01:04:10 +02:00
Ralph Sennhauser 25f920bdb2 Make cxxtest optional
Remove mocks as they are no longer used making cxxtest effectively
optional.

Fixes: #8618
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-08 20:59:45 +02:00
Ralph Sennhauser 2d317d509d Remove unix_ExecutablePathname
The function was used as a fallback for when a platform specific approach
isn't available. Given that it effectively is a roundabout way to derive
it from argv[0] which we use as a generic fallback anyway just remove
it.

This further allows to make cxxtest optional.

Refs: #8618
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-08 20:59:45 +02:00
Ralph Sennhauser ae6d3bfc4e Implement BSD specific sys_ExecutablePathname
This is more reliable than argv[0] which is effectively used via
unix_ExecutablePathname. Also drop the fallback as it effectively is the
same as the generic fallback and blocks making cxxtest optional.

On FreeBSD the procfs is not mounted by default, so use a syscall
instead.

Refs: #8618
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-08 20:59:45 +02:00
Ralph Sennhauser 349478aa6b Remove Linux sys_ExecutablePathname fallback
The fallback is of little value and blocks making cxxtest an optional
build dependency. While at it use realpath instead of readlink.

Refs: #8618
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-08 20:59:45 +02:00
Ralph Sennhauser 6fc47e2997 Cleanup wposix header and source
Remove stale NAN and INFINITY, both have equivalents since C++11 and
cleanup headers in wposix source file.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-08 19:52:53 +02:00
Vladislav Belov 62fcb7e042 Removes requirement to restart the game for V-Sync 2026-06-08 18:27:12 +02:00
Vladislav Belov 7607d6bdd8 Decouples acquire/present from SubmitScheduler
SubmitScheduler doesn't have to know anything about Acquire/Present as
its responsibility to schedule and submit command buffers to a queue.
2026-06-08 18:27:10 +02:00
Vladislav Belov 07e5ad5b23 Fixes acquire and submit semaphores syncronization
I forgot to finish CSubmitScheduler synchronization in
7c84c23114. Even ++m_FrameID was
forgotten. And it worked at the time. A proper synchronization is
described in renderer/backend/Vulkan/SwapChain.h.
2026-06-08 18:27:08 +02:00
Vladislav Belov 4d83aa28e5 Uses SwapChain instead of direct Device calls 2026-06-08 18:27:06 +02:00
Vladislav Belov cf4a4d8fd5 Adds SwapChain as an explicit DeviceObject
It allows us more flexibility on how we control swapchain. That includes
toggling V-Sync in real time.
2026-06-08 18:26:58 +02:00
Ralph Sennhauser dab6e1a37a Fix disabled pathfinder tests
The disabled test are all broken one way or another. The maps used in
the tests got renamed. The pathfinder component got some performance
improvements which now require to call UpdateGrid() once before use.
Finally for the InitAttributes to be deep frozen they need to be an
object, so initialize them.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-07 10:43:32 +02:00
Ralph Sennhauser 296ccc78c9 Fix disabled serializer tests
test_hash depends on modmod for xml schemas. InitAttributes need to be
set as deep freezing expects them to be a valid object. The map used got
renamed at some point. Finally prior to running the sim PreInitGame()
and InitGame() need to be called.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-07 10:00:40 +02:00
Ralph Sennhauser 0599848330 Cleanup Atlas SectionLayout
Don't declare empty constructor and destructor, avoid c-style cast and
remove TODO about a bug that can't be reproduced any longer.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-07 09:36:57 +02:00
Ralph Sennhauser e3afa15966 Cleanup Atlas section headers
Make not otherwise used functions private and use override as
appropriate.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-07 09:36:57 +02:00
Ralph Sennhauser 94f13073ce Remove unused allocator page_aligned
Unused and since C++17 not really valuable with std::aligned_alloc
(_aligned_malloc and _aligned_free in case of MSVC) available. We also
have an other similar interface with "lib/sysdep/vm.h".

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-05 16:57:20 +02:00
Ralph Sennhauser cf5501a35b Support numpad with player hotkey in ActorViewer
KEY_DOWN means we need to check for the "down" values instead of "char"
value which differer for numpad.

Ref: #501
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-05 16:22:28 +02:00
Ralph Sennhauser fcbc3d3f71 Limit max PlayerID in Atlas hotkeys
9 isn't a valid playerID, setting this value causes a JS error
and corrupting the viewport.

Further limit selectable max playerID to what the mapSettings say.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-05 16:22:28 +02:00
Ralph Sennhauser 0c0552a428 Replace M_PI with C++ numbers
C++20 added π (pi) to the standard, replace the C macro globally.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-04 20:29:48 +02:00
Ralph Sennhauser 4379194255 Fix sidepanel layout in Atlas
In many places there are missing gaps/borders and where there are there
are almost random values used (2/3/4/5/8/10/15).

Add missing and standardize on using gaps 5 and 10 pixel only.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-03 19:17:28 +02:00
guerringuerrin 3922a7ee0a Prioritize least busy buildings for hotkey training commands
getTotalQueueTime(queue) calculates total remaining
queue time of a production building.
getBuildingsSortedByQueueTime(entities), sorts building selection
by their queued training time and filter invalid entities
Removes the resource availability guard from the Training selection
panel onPress handler to align mouse interaction with hotkey behavior
2026-05-27 10:29:08 -03:00
Vladislav Belov 1250ca1dac Replaces FALLTHROUGH macro by attribute
It was forgotten during removing the FALLTHROUGH macro in
b41ca5ad78.
2026-05-22 23:25:31 +02:00
Vladislav Belov a0ecfbaa33 Skips UNIFORM buffers for GLES
Currently we don't support UNIFORM buffers for GLES.

Refs 54701868da
2026-05-22 23:14:30 +02:00
phosit 01bd743b30 Correct LoadModal to continue a saved campaign
The `closePageCallback` isn't forwarted to the function calling it. Now
it's possible again to continue a saved campaign.
The error was introduced in 76b6725272.
2026-05-21 21:29:56 +02:00
Ralph Sennhauser a0bb103390 Unwrap SDL_Event
Since C++11 a C typedef'ed union can be forward declared, so the wrapper
is no longer needed.

While at it switch signatures to refs and convert C style casts.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-05-20 19:44:52 +02:00
phosit 34ab0f3938 Disconnect before deleting the session
The session was deleted from `m_Sessions` before disconnecting. Since
e7a583adc0 that also deleted the session.
2026-05-17 17:20:37 +02:00
phosit a95579a046 Fix UI when connecting to a server fails
When the connection fails, it wasn't possible to close the progress
window.
Now `PollNetworkClient` also resolves the previous promise.
2026-05-17 17:20:37 +02:00
guerringuerrin 32e5520507 Add hotkeys for opening GUI pages across the game
Add registerGlobalGuiPageHotkeys() to
common/functions_utility.js to selectively register
GUI page hotkeys
Allow active GUI pages to close using their corresponding hotkey
Move page_hotkeys.xml from gui/hotkeys/ to gui/
Update page_hotkeys.xml references in MainMenuItems and MenuButtons
Add default tipScrolling fallback in TipsPage when no initData is provided
2026-05-16 20:53:54 +02:00
wowgetoffyourcellphone 9df2dc2585 Temple of Athena Nike by @nifa
Temple of Athena Nike by @nifa

SpecificName from @Outis and @Thalatta
2026-05-14 13:38:32 +02:00
Vladislav Belov 017aa3b736 Adds splitted shader effects to materials 2026-05-10 23:57:27 +02:00
Vladislav Belov 59e36be140 Splits shader effects to reuse in material passes 2026-05-10 23:57:23 +02:00
Vladislav Belov 18a16aa135 Moves all rendering to material passes
Now we should use material passes instead of context and defines to
select a needed shader. It allows us to reduce the number of
shader combinations we use and reduce memory consumption.
2026-05-10 23:57:20 +02:00
Vladislav Belov aced56c336 Adds material passes to choose different shaders
All shaders were selected by context (set of defines) which increases
the number of needed permutations. For example: we don't need to know
about shadows when rendering silhouettes.
2026-05-10 23:57:16 +02:00
Vladislav Belov 9aee507e28 Adds wireframe techniques for particle and terrain 2026-05-10 23:57:12 +02:00
Vladislav Belov 75bd640bd8 Removes context of terrain shadows and silhouettes
We were unnecessary passing all combinations of our scene shader context
even if we don't need it as for shadows and silhouettes for terrain
rendering. Since we only need to draw a solid color.
2026-05-10 23:56:57 +02:00
Vladislav Belov 58d3527130 Adds profile table for renderer backend statistics 2026-05-10 19:26:16 +02:00
Vladislav Belov 2e87f6b5aa Adds renderer backend-specific statistics
Different backend have different metrics to watch and debug. So we need
a simple way to collect that.
2026-05-10 19:26:16 +02:00
phosit 3549cc1e6c Remove the hint that ai-rejoin isn't supported 2026-05-10 14:18:52 +02:00
phosit b3552ebccb Clone the position in attackPlan 2026-05-10 14:18:52 +02:00
phosit e2466e9bd5 Consistently sort the ai-queues
When the returned value of the compare function is `0` the order is
preserved. Before the sort, the order between joining clients and
non-joining clients differ.
Additionally sorting by name should make the order consintent.
2026-05-10 14:18:51 +02:00
phosit 6d31e6de89 Serialize the isIdleConfirmed for the AI
The AI only noticed for changes to `isIdleConfirmed`. That is done to
avoid recursions and don't send to many messages. But when the AI is
deserialized it get's `isIdle` from the simulation. Leading to an OOS.
2026-05-10 14:18:51 +02:00
phosit be03605eac Update unitCollection in attackPlan 2026-05-10 14:18:51 +02:00
phosit 86289a89fd Clone the bonuses
Sometimes the same object was serialized.
2026-05-10 14:18:51 +02:00
phosit 53a67e560f Sort templateModifications after inserting
The insertion order might not be consistent when clients join.
2026-05-10 14:18:51 +02:00
phosit b572fed672 Consistently sort the build order
When the returned value of the compare function is `0` the order is
preserved. Before the sort, the order between joining clients and
non-joining clients differ.
Now everything important (which is used later on) is included in the
comparison. If still `0` is returned it's not importent which element is
taken.

Another solution would be to have one array per category.
2026-05-10 14:18:51 +02:00
phosit c4dd0040ee Never serialize an event when it's not owned 2026-05-10 14:18:51 +02:00
phosit 2f86d4a2f8 Don't write entity-metadata when deserializing
The metadata where written every the turn of deserialization. When on
the non rejoining client it was only written when that AI makes a turn
and handles the events.
2026-05-10 14:18:51 +02:00
phosit 55f2d356ff Clone targetPos in attackPlan
On a rejoined client the data isn't the same anymore. But it's equal.
Likely this is because the data isn't aquired at the same turn.

This could also be solved more generally by copying all data which is
pushed to the AI. Or by using the same serializer for AI as for the rest
of the simulation.
2026-05-10 14:18:51 +02:00
phosit 3ddf101a06 Inform the AI about builders when initializing
This wasn't a problem since there are no builders on a fresh match but
now when deserializing there might be builders.
2026-05-10 14:18:50 +02:00
phosit 9aea56e4a2 Also serialize unitCollUpdateArray in AttackPlan
It needs to be serialized so it's known which units to update next.
2026-05-10 14:18:50 +02:00
phosit f35595610a Sort entitycollections when adding entities
On joining clients entitycollections are always sorted. To stay in sync
non-joining clients also have to sort entitycollections.
2026-05-10 14:18:50 +02:00
phosit 130ea06ce8 Don't add queues when deserializing AttackPlans
When deserializing the queues are already there. It was an error to try
to add a queue since sometimes there must not be a queue.
2026-05-10 14:18:50 +02:00
phosit cca2cfe05c Don't updateTerritories when deserializing
Clients which didn't late-join only get a change to `uptadeTerritories`
when the ai playes a turn. When joining clients do it at the turn when
they deserialize the ai they might be ahead of the others. That would
lead to an out of sync.
2026-05-10 14:18:50 +02:00
phosit e9339591c2 Reset turnCach at the begin of the turn 2026-05-10 14:18:50 +02:00
phosit 911285e625 Always update territories 2026-05-10 14:18:50 +02:00
phosit 4b516b336e Get the UnitAI order data directly
The cached data wasn't always up to date. I coudn't figure out when to
update it.
2026-05-10 14:18:50 +02:00
phosit 3afdf64eee Update territories when a construction is finished
Constructions can change the territories. So they should be updated.
2026-05-10 14:18:50 +02:00
phosit f5e926f6fe Remove remanents of entityObj
All uses have been removed.
2026-05-10 14:18:49 +02:00
phosit b6243966f3 Remove usage of entityObj from Destroy event
`entityObj` is not available on clients which just have rejoined. As not
all clients have access to it the data shouldn't be used for anything
elaborate.
2026-05-10 14:18:49 +02:00
phosit 0a2294171e Remove usage of entityObj in VictoryManager
This is done by remembering the ID of the assigned healers and guards.
2026-05-10 14:18:49 +02:00
phosit b59d2c91e3 Remove usage of entityObj in TradeManager
Now `source` and `target` are only entityID. So that we can check
whethero one of them got destroied.
Additionaly it's much simpler to serialize.
2026-05-10 14:18:49 +02:00
phosit d18a6392b3 Reduce usage of entityObj in SharedScript
The information where a unit is and which resource it provides wasn't
available on joining clients. Now the `resourceMap` is reset when a
resource is destroide.

It would be performance intensive when the `resourceMap` would be reset
when any unit would be destroied. To prevent this the `SharedScript`
remembers which entities are resourcesources.
2026-05-10 14:18:49 +02:00
phosit 8d7de7fde7 Remove usage of entityObj in BuildManager
When destroying a builder it might not be known anymore what it was able
to build. Now the entityIDs of the builder is stores. So that it can
easily be looked up and removed.
2026-05-10 14:18:49 +02:00
phosit 4f6b01ccb8 Reduce usage of entityObj in BasesManager
Some functions in the `BaseManager` expect a complete entity but only
the ID is used. When an entity is destroied the entity isn't available
anymore.
2026-05-10 14:18:49 +02:00
phosit 7b50e32b28 Always delete metadata when destroying entities
On newly deserialized clients there is no property for the destroied
entities. Because of that the metadata of the entity wasn't remembered
in the event and wasn't destroied.
2026-05-10 14:18:49 +02:00
phosit 08340ca18a Call GetFullRepresentation only internally
`GetFullRepresentation` doesn't reset `this.changes` to `null`. So when
a message arrives the ai-interface will not be informed.
The ai-interface calls `GetFullRepresentation` and removed the dirty
flag from the ai interface.

This two behaviors lead to the error that the ai never receives messages
from entities which exist at game start.
2026-05-10 14:18:49 +02:00
phosit f81cf7e602 Clear changedEntities on initialization
When initialized all entities get queried. But the set of entities to
query wasn't cleard. This lead to an OOS.
2026-05-10 14:18:48 +02:00
phosit e07b4df6ba Serialize dropsiteSupplies
The assignement has to be done for new dropsite but must not always be
done as it sends a command.

Serialized data shouldn't be too complicated. Because of that the `ent`
property is removed.
2026-05-10 14:18:48 +02:00
phosit 6facc9ee17 Fix AI OOS on rejoin related to random calls
Based on a diff from @Silier: https://code.wildfiregames.com/D2573
2026-05-10 14:18:48 +02:00
phosit 8151e18d51 Enable the ai to be tested with -serializationtest 2026-05-10 14:18:48 +02:00
phosit c042b3ca2c Start the serializationtest at a specivic turn
This enables to only test critical game sections.
2026-05-10 14:18:48 +02:00
vyordan 843f39ba55 Use dynamic budget for progressive load timeout
The progressive load timeout was hardcoded to 10ms, causing the CPU
to be mostly idle during map loading. This commit replaces the fixed
value with a dynamic budget derived from the display refresh rate
when VSync is enabled, or from the configured adaptivefps.menu limit
otherwise.

Fixes: #8774
2026-05-07 19:38:31 +02:00
phosit f38b956eb3 Update code owners 2026-05-04 18:47:53 +02:00
Jonny McCullagh e903506f13 More ai names for the germans
Fixes: #8408

Forum thread: https://wildfiregames.com/forum/topic/140675-more-ai-names-for-the-germans/
2026-05-02 13:13:01 +01:00
wowgetoffyourcellphone 5268cb62a6 Persians -> Achaemenids
Persians -> Achaemenids
Pers -> Achae

Addressing Checkrefs

Internal Achaemenid and Persian references

Reported by @Stan`

Update unit_tables.py
2026-05-02 02:50:39 +02:00
Ralph Sennhauser 6514230330 Allow building without lobby
Commit 6a8366b99a added additional
libraries to the report but didn't consider gloox be optional. Address
this false assumption allowing to build pyrogenesis without lobby
support.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-05-01 08:20:38 +02:00
Vladislav Belov a7967d4ad9 Adds PBR output texture to PostProc 2026-04-29 19:25:14 +02:00
Vladislav Belov 25df2d8a02 Adds resolve PBR compute shader
Also fixes sky shader as it was writing negative values for -Y
direction.
2026-04-29 19:25:12 +02:00
Vladislav Belov 1a277269d3 Adds floating point textures to backends
R8G8B8A8_UNORM isn't enough to store HDR data as the scene can brighter
than 1.0 especially when looking into sun speculars.
2026-04-29 19:25:11 +02:00
Vladislav Belov c4fb0eed3a Adds slider to developer overlay
Also adds PBR config values. Refs #8535
2026-04-29 19:25:03 +02:00
phosit 0f7417bb47 Remove Engine.SwitchGuiPage
This function isn't used by JavaScript anymore.

Fixes: #6929
2026-04-26 12:44:41 +02:00
phosit bb714c89ef Remove Engine.SwitchGuiPage from summary 2026-04-26 12:44:41 +02:00
phosit 2415b41438 Remove Engine.SwitchGuiPage from session 2026-04-26 12:44:41 +02:00
phosit 76b6725272 Remove Engine.SwitchGuiPage from campaigns 2026-04-26 12:44:41 +02:00
phosit 434a1a1905 Remove Engine.SwitchGuiPage from mod 2026-04-26 12:44:41 +02:00
phosit 3126a249d2 Remove Engine.SwitchGuiPage from locale 2026-04-26 12:44:41 +02:00
phosit 340a4d64ca Remove Engine.SwitchGuiPage from lobby
Since the page now isn't closed immediately, the `onTick` has to be
cleared.
2026-04-26 12:44:40 +02:00
phosit 3edda64566 Remove Engine.SwitchGuiPage from gamesetup 2026-04-26 12:44:40 +02:00
phosit 2f1bf9531b Remove Engine.SwitchGuiPage from replay menu 2026-04-26 12:44:40 +02:00
phosit d842a134f9 Remove Engine.SwitchGuiPage from loading 2026-04-26 12:44:40 +02:00
phosit 02a4cf6aff Remove Engine.SwitchGuiPage from autostart 2026-04-26 12:44:40 +02:00
phosit 5b5a7f9dc8 Remove Engine.SwitchGuiPage from gamesetup_mp 2026-04-26 12:44:40 +02:00
phosit 4ff3abf203 Remove Engine.SwitchGuiPage from prelobby 2026-04-26 12:44:40 +02:00
phosit c1a50c7012 Remove Engine.SwitchGuiPage from main menu 2026-04-26 12:44:40 +02:00
phosit 3d8971daca Remove pageLoop
That functionality is now built in to the engine.
2026-04-26 12:44:39 +02:00
phosit 6ead0d2f92 Add Engine.openRequest
Pages can replace themselfe by another (continuation) page.
2026-04-26 12:44:39 +02:00
Vladislav Belov 456e2a0b56 Removes dummy GL functions as replaced by core 2026-04-25 17:47:06 +02:00
Vladislav Belov 9b79fb3793 Fixes particle solid axes after aae957ec7b 2026-04-25 15:58:25 +02:00
Vladislav Belov dd9124ae99 Fixes Vulkan uniform buffer size after 9e371824c2
32 was accidentally added during debugging.
2026-04-25 11:55:12 +02:00
Atrik 68d8604c51 Do not follow rally point commands for observers
When observing a player with camera follow enabled, the camera would
jump to newly trained units as they executed their
rally point commands, which were just rendering the "Follow Player"
feature frustrating.
2026-04-22 10:19:44 +02:00
joeybadz 77a53121e0 Handle module attributes in checkrefs
Prevents GUI modules from being incorrectly reported as unused files

Fixes #8147
2026-04-20 21:09:25 +02:00
Dunedan 10d8269365 Remove TLS option from in-game settings
This removes the `lobby.tls` option from the in-game settings, as
connecting to the official lobby without TLS isn't possible anymore. The
`lobby.tls` setting itself stays available for debugging purposes and
can still be set via the command line or in the user.cfg configuration
file.
2026-04-19 21:07:58 +02:00
Stan b63d0a546b Add vcs browser to appdata 2026-04-19 19:28:40 +02:00
phosit 6f82cec51f Use std::unique_ptr for stats-table 2026-04-18 14:38:38 +02:00
phosit b71c1c3e8c Use std::unique_ptr for ENetPeer 2026-04-18 14:38:38 +02:00
phosit e7a583adc0 Use std::unique_ptr for server-session 2026-04-18 14:38:38 +02:00
phosit 0642153abc Use std::unique_ptr for ENetHost 2026-04-18 14:38:38 +02:00
phosit 74255b49c0 Use std::unique_ptr for the server turn manager 2026-04-18 14:38:38 +02:00
phosit 2b1b1dc1e3 Store the server-worker inside the server
This becomes possible by reordering the class definition.
2026-04-18 14:38:38 +02:00
Atrik 0171a58f26 Handle empty Auras reference in checkrefs 2026-04-17 12:32:08 +02:00
Atrik eb2ff98883 Display aura range overlay during building preview
Fixes #8868
2026-04-17 12:32:08 +02:00
phosit 7758c98e7c Remove IXmppClient.h
This is now possible after 0a455fbe2d.
2026-04-14 19:38:05 +02:00
phosit 1da954d455 Store the glooxRegistration inside the XmppClient 2026-04-14 18:58:57 +02:00
phosit 4a5b5ddfad Store the gloox::MUCRoom inside the XmppClient 2026-04-14 18:58:57 +02:00
phosit 783525dd73 Store the SessionManager inside of XmppClient 2026-04-14 18:58:57 +02:00
phosit b1b31b0929 Store the gloox::Client inside the XmppClient 2026-04-14 18:58:57 +02:00
phosit 5a5c7b4f12 Use unique_ptr for glox::Tag in XmppClient 2026-04-14 18:58:57 +02:00
phosit 09c1cc4ec7 Use RootedValueVector in XmppClient
This removes the manual tracing.
2026-04-14 18:58:57 +02:00
phosit 3d866fe7a1 Move ComputeTimestamp to XmppClient.cpp
It is only used there.
2026-04-14 18:58:57 +02:00
phosit 13a0dc4859 Move the gloox conversion to a dedicated file
"GlooxScriptConversions.cpp doesn't need the whole "XmppClient.h". This
will decrease build time.
2026-04-14 18:58:57 +02:00
Vantha 5a92c22d90 Compute actual size of GUI objects lazily
This shifts the responsibility of updating the actual size more towards
IGUIObject, and enables only ever doing it when the value is actually
needed. This allows us to remove the delay of size changed
notifications, since the value is now already recalculated as
infrequently as possible anyways.

All of that ensures that the actual size (returned by GetActualSize) is
always up-to-date e.g. when reading it from the parent, which was
previously broken.

Fixes #8200
2026-04-12 00:17:02 +02:00
phosit d5384ad742 FindPublicIP in the CNetServer constructor
When using the lobby, after constructing `CNetServer` the public IP has
to be queried. The consructor knows whether the lobby is used, so do it
in the constructor.
2026-04-11 13:46:34 +02:00
phosit bc17e212bb Launch session at construction of Net*
This way it's statically assured that the session aren't launched
multiple times.
2026-04-11 13:46:33 +02:00
phosit 314e2a58cf Remove UpdateInitAttributes from CNetClient
The init-attributes can only be changed before the worker runs. It isn't
used before the worker runs. This changes it so that it has to be passed
when the server starts.
With this the `m_InitAttributesQueue` can be removed.
2026-04-11 13:45:00 +02:00
phosit 578aea3b09 Remove CNetClient::SetupServerData
It has to be called before `SetupConnection` is called. Now the
server-data is setup during the constructor.
When connecting using the lobby, the data isn't known at construction
time. Then it is done at the start of  `TryToConnectWithSTUN`.
2026-04-11 13:41:43 +02:00
phosit 19c6977872 Request connection-data in the client constructor
This way it doesn't has to be requested manually and it can't be
requested to late.
2026-04-11 13:41:43 +02:00
phosit dbe89d10ae Pass the controllerSecret to the CNet* constructor
It wasn't clear when to call `SetControllerSecret` now it can't be done
wrong. Also the mutex has to be locked less often.
2026-04-11 13:41:23 +02:00
phosit d33fb147bc Pass the game password at construction to Net*
CNetClient and CNetServer are constructed for a single match. The
password of a game can not be changed after creating the match. When the
password is passed to the constructor it's not possible to invoke the
functions in the wrong order and the `ENSURE` can be "checked at
compile-time" so to say.
2026-04-11 13:38:58 +02:00
phosit 040e0b29a2 Initialize members in the class of CNet*
Sometimes the order was wrong.
2026-04-11 13:38:53 +02:00
emholt1 96c0d45b14 Fixes for the proto-Germanic names of some units
Fixes #8870
2026-04-11 11:01:22 +02:00
Vladislav Belov cb1fe07540 Removes GetDeviceCommandContext call from CFont
We need remove all occurences of GetDeviceCommandContext to be able to
add multithreading support in the future.
2026-04-10 23:53:23 +02:00
Vladislav Belov 68091177ac Removes ArrayDeleter 2026-04-10 23:03:00 +02:00
phosit 6893654cfc Do the gamestate compression in the task-manager
This reduces the stutter when a client joins.
The decompression isn't put on the task manager. As the client would
have to wait for that either way. Also a new polling loop would have to
be introduced.

The compression code is moved to the file transferer so all data send
through it gits compressed.

Refs: #4210
2026-04-09 19:03:46 +02:00
Rodrigo Vegas Sánchez-Ferrero 6a3da535f3 Remove wrong newline in splashscreen.xml
The last new line character is not needed and is in conflict with the translation texts.
2026-04-08 11:21:12 +02:00
Atrik 17b9b6af2a Remove trainer from wagon
This was creating an entity that had a trainer component
without production queue. Which is hazardous.
2026-04-07 10:55:50 +02:00
Vantha 8a2a450686 Align text as usual if the scrollbar is invisible
Previously, while `scrollbar` was set to true, the text was always
vertically aligned to the top, no matter what its `text_valign` was, by
the scrolling logic. However, this was done even when the text's caption
was so short that no scrollbar was required in the first place (and not
rendered). Falling back to the specified `text_valign` value in that case
instead seems like the expected behavior.

On a few occasions in the GUI, the text was supposed to be aligned to
the top in either case, but still set `text_valign` to a different value
(for whatever reason), which didn't have any effect previously. But
now since it does, the values have to be corrected to specify what is
actually desired.
2026-04-06 21:39:18 +02:00
wowgetoffyourcellphone 15cabcf8fc Add waypoint/rally point feedback sound
Update unit_actions.js
Add author of rally sound to credits
Two rally click options
Use new rally_click sound.
2026-04-04 03:49:55 +02:00
Vantha 56a98fa5ee Fix error when toggling session GUI
A typo caused errors when toggling the in-game UI with the hotkey,
because GetGUIObjectByName failed. The issue was introduced in
64de934dd3.
2026-04-03 11:01:22 +02:00
Vantha 9ff42ccae6 Fix unresponsiveness after campaign game ends
Presumably since 094a7c2268, when a game played as part of a campaign
ended (by the player winning or loosing), after closing the victory
dialog by pressing "Stay", the session UI became completely unresponsive,
so that no buttons could be clicked. The cause for this was that the
child page campaigns/default_menu/endgame/page.xml was never closed, so
remained invisibly open above the session GUI and blocked all of the
inputs.
Additionally the Campaign session class tried to close the
page_session.xml page, which was not supposed to happen, it was
introduced by mistake in 094a7c2268 replacing the logic to close the
campaigns/default_menu/endgame/page.xml child page again.
2026-04-01 13:03:56 +02:00
obelix 54764733dd Fix incorrect Germ tech tooltip
Since ec19e5d663 German Support Wagons cannot train Units anymore so 
that Wagon Trains cannot unlock this ability as well.

Reported by @xordspar0
Fixes #8799
2026-03-31 20:43:33 +02:00
obelix dec3f9ab62 Add Generic name for German Catafalque
The Catafalques of the other Civilizations have proper Generic names.

Refs. #8755
2026-03-31 10:01:03 +02:00
obelix 7af2210a4f Fix incorrect Spart CivBonus description
Introduced with 3592814aa8, reported by forum user Emacz
2026-03-31 01:47:12 +02:00
Stan b23c0794a5 New song for the germans.
Song by: @skymx
Reviewed by: Omri Lahav, @samulis
2026-03-29 22:30:24 +01:00
Vantha e0db65ba1b Remove pointless const's from ICmpCinemaManager.h
Were mistakenly introduced in d882ab74a1
2026-03-24 11:15:27 +01:00
Atrik 73f7884b4a Fix oversight from 832501fc9b and b93634fb28
When merging twin formations, the calls to AddMembers()
and RemoveMembers() got inverted. RemoveMembers()
calls UnsetFormationController() on each member, which overwrites
the formation controller reference just set by AddMembers() to
INVALID_ENTITY.
2026-03-23 14:50:12 +01:00
Daniel Richard G. 8a9dd76bc0 Add "iskunk" (myself) to the list of contributors 2026-03-23 08:20:10 +01:00
Daniel Richard G. 4050c645ac Avoid SIGBUS error in the MD5 implementation on ARMv7 (armhf)
Encountered in the test-suite run. This is just a workaround; the
implementation needs to be reworked/replaced to accommodate
alignment-sensitive architectures.
2026-03-23 08:20:10 +01:00
Daniel Richard G. eab11c247c Add nominal support for LoongArch64 and RISC-V 64
Fixes #6584, #6834
2026-03-23 08:20:10 +01:00
Vladislav Belov b52fbb7c62 Fixes particle shader compilation
The problem was only in case of USE_DESCRIPTOR_INDEXING. Because it adds
additional data for textures to the end of draw uniforms.

Fixes #8780
2026-03-22 00:53:30 +01:00
DesertRose 19fe52f328 Allow Romans to produce civilian_house from start
Fix that Romans to produce Civilians from the start of a match

Fixes: #8735
2026-03-20 10:14:35 +01:00
DesertRose a6a634c7ae Fix Ptolemies Military Colony inability to produce Civilians
The Ptolemies Military Cololy can now produce Civilians as intended

Fixes: #8802
2026-03-20 10:14:06 +01:00
phosit 46b27f22ca Wait for autostart by promise
Since the completion is checked using the promise the `onTick` function
can be removed.
This replaces the `AutoStart` `AutoStartClient` and `AutoStartHost` by
async functions.
The functions can now return something to the engine. That is used to
inform the engine which page to open. That was previously done in
JavaScript. Which is ugly because it doesn't know whether it's in
visual-mode.
2026-03-19 18:44:52 +01:00
DesertRose 6805efc08a Correct Germans Cimbrian Clubman visible classes
In-Game the Germans Cimbrian Clubman unit is erroneously declared
Builder and Worker

This removes these two Classes from the visible Classes

Fixes: #8806
2026-03-19 00:00:43 +01:00
Ximirun 5104c81e9d Introduce Boundary & Adjust Height Properly
Code is implemented relating to selecting the building starting from the surface and making Height functional.
Inbefore Height does not do anything and it is set by how tall the building is 3D wise.

Fixes: #8781
2026-03-16 20:22:37 +01:00
wowgetoffyourcellphone 67ee5aaeb5 Erechtheion & Caryatids by @nifa
Hence, my suggested title for Release 29 is "Caryatid"
2026-03-15 22:12:15 +01:00
Atrik 6f645fa48f Fix formation ordering oversight
Fixes #8827
2026-03-13 22:59:59 +01:00
phosit 262c5c037e Use promises to fetch net messages
Refs: #5585
2026-03-13 18:07:56 +01:00
Atrik 56107e4e39 Fix formation controller flag reset during patrol
0ace1b44b2 added setting some animation into a controller state,
but formation controllers don't have any animations.
Probably some code intended for individuals has been copied there
by mistake.

This likely caused the visual system to reevaluate the actor somehow
because the animation didn't exist.

Fixes #8817
2026-03-13 12:22:31 +01:00
phosit d29890efb0 Split NetSession into two files
Refs: #5212
2026-03-11 21:03:52 +01:00
phosit 789d24aa1c Initialize members net-sessions in the class
With this members of `CNetClientSession` and `CNetServerSession` get
initialized within the class instead of the constructor.
2026-03-11 21:00:05 +01:00
ShadowOfHassen 0c4bcd9139 Update gitignore to add rules.json
Fixes #7133
2026-03-11 19:24:17 +01:00
Lancelot de Ferrière 25fd3aa93c Small optimisation for VertexPathfinder edge handling.
Previously, edges where bundled collected first then sorted in 4 AA and 1 unaligned bucket. We can separate the unaligned edges right away, which is a little faster.

Also make sure Vertex::pred is initialized.
2026-03-11 18:45:23 +01:00
Lancelot de Ferrière a6e0a623b4 Avoid constructing temporaries for Edge objects in VertexPathfinder 2026-03-11 18:45:20 +01:00
wowgetoffyourcellphone 666685645b Athēna Parthenos by @nifa
Athēna Parthenos by @nifa
2026-03-10 21:58:17 +01:00
phosit e2dbcea487 Remove INetSession
This was only used in the `CNetFileTransferer`. Only one function is
called. That can also be a `std::function`.
2026-03-05 21:09:14 +01:00
phosit e0c189a43e Fix string format in economy walkthrough
This has been introduced in 29ac569511.

Fixes: #8788
2026-03-05 20:20:19 +01:00
trompetin17 15076a4504 Relax font alias pattern to allow custom font families
Update the font alias regex pattern from:
    (mono|sans)-(bold-|italic-)?(stroke-)?[0-9]{1,3}
to:
    [a-z]+-(bold-|italic-)?(stroke-)?[0-9]{1,3}

Previously the pattern only allowed the `mono` and `sans` font families.
This change generalizes the pattern to accept any lowercase font family
name, making it compatible with the font alias convention described in:

https://gitea.wildfiregames.com/0ad/0ad/wiki/Adding_font_support

This allows new fonts to be registered through aliases without modifying
the regex each time a new family is introduced.
2026-03-05 11:58:52 -05:00
Vantha 01476b9836 Only render the minimap texture if it'll be displayed
This patch implements a way for minimap-type GUI objects to request the rendering
of the minimap texture each frame. If it wasn't requested the minimap
texture isn't rendered at all and the objects only request it while they are
being displayed. This saves unnecessary work and fixes a bug where the
minimap briefly showed the revealed map after a cinema path ended
playing, since it isn't updated every frame (only 2x per second).
2026-03-03 11:25:52 +01:00
Vantha 67c96094f0 Disable smooth LOS during cinema paths
The whole map is revealed when starting to play a cinema path and
then hidden again when it finished (if necessary).
This patch fixes the ugly fade in at the start and fade out after
the end previously caused by this.
2026-03-03 11:25:52 +01:00
Vantha 004fdfdb58 Initialise m_DrawPaths inside the class
Default values like this are better set inside the class already rather
than in the constructor.
2026-03-03 11:25:52 +01:00
Vantha 64de934dd3 Revamp the cinema GUI code
This patch introduces a new class for managing the cinema overlay (two
black bars) and cutscene mode. This makes it more extensible for the
future, e.g. allowing to display text on the bars.
Since <include> elements can only be placed inside an <object>, this
patch needs to restructure session.xml a bit and also adds some
explanation comments while at it.
2026-03-03 11:25:52 +01:00
Vantha d882ab74a1 Revamp CinemaManager component
Clean up the the implementation, improve the naming, and
add some more documentation as well as more in-depth tests.
2026-03-03 11:25:52 +01:00
Vantha 1d3cdec48d Move cutscene mode to renderer
This patch splits "cutscene mode" (disabling silhouttes, territory
borders and other visual overlays) from the cinema manager component
and moves it to the renderer, since it doesn't influence the simulation
anyway. The mode can now be independently controlled by the GUI. This
is done so it can also be used for other narrative elements like speech
or dialogue in the future. Cutscene mode is still always enabled while
cinema paths are playing, though.
By design, this also fixes the issue that range overlays weren't hidden
during cutscene mode.
2026-03-03 11:25:52 +01:00
Vantha c7247936bf Introduce separate LosRevealWholeMapForAll flag
It was previously stored at the end of the array of per-player flags and
set by calling SetLosRevealWholeMap with the player ID -1. However, ever
since the introduction of observer mode in 883f307b40, -1 is the player
ID of observers everywhere else including for GetLosRevealWhole:
GetLosRevealWhole(-1) always returns true in order to reveal the map to
observers, however, the cinema manager, for example, called it meaning
to find out whether the whole map is revealed to all players.
To fix this and avoid confusion about this in the future, this patch
splits this flag from the per-player flag array and introduces new
functions to set and retrieve it.
2026-03-03 11:25:52 +01:00
Vantha 21a61721a7 LosRevealAll -> LosRevealWholeMap
This name is more descriptive.
And the plan is to split off the extra player value of the vector into
an own flag in the future, and LosRevealAllForAll would have been a poor
name for that.
2026-03-03 11:25:52 +01:00
Vantha d7eafb8c5d Fix wrong cinema path duration at nondefault sim rates
For example, at 2x, the cutscenes were cut off in half -- by the cinema
manager disabling itself to early.

Refs #3814
2026-03-03 11:25:52 +01:00
Vantha ab378c016e Disable Han stockades in Survival of the Fittest
The other civs use structures/wallset_palisade, but the Han have a
special one, structures/han/wallset_palisade, which the trigger script
didn't disable.

Fixes #8763
2026-03-03 11:24:59 +01:00
guerringuerrin 6ca52a0b23 Reassign default hotkeys and add unit/building selection shortcuts
Add default hotkeys for unit selection by class and for placing common buildings,
building on the previous buildings and units hotkeys work.
Several existing bindings are reassigned to avoid conflicts and group related actions
on consistent key combinations.
2026-02-27 10:54:04 +01:00
ShadowOfHassen 9caaa37482 Update Splashcreen Message
Reword the text on the splashscreen to sound more inviting and increase
the dialog size to ensure there's enough space for the message in all
languages.

Fixes #8682
2026-02-25 10:18:34 +01:00
Vantha c799e4221a Add SpecificNames for the phases of the Germans
Sources:
https://en.wiktionary.org/wiki/Reconstruction:Proto-Germanic/w%C4%ABhs%C4%85
https://en.wiktionary.org/wiki/Reconstruction:Proto-Germanic/burgz
https://en.wiktionary.org/wiki/Reconstruction:Proto-Germanic/haimaz

See https://wildfiregames.com/forum/topic/140596-specific-phase-names-for-the-germans

Fixes #4667
2026-02-23 23:17:09 +01:00
obelix ed6075c222 Fix wrong value for the Aura of Kush Hero Arakamani
The wrong value leaded to the aura having no effect.
Reported by @Atrik
Investigated by @Vantha

Fixes #8725
2026-02-21 13:16:16 +01:00
Atrik adb435b405 Fix inconsistent chat line spacing
Chat lines with different text heights were being positioned incorrectly
because each line's position was calculated using its own height rather
than the cumulative height of all previous lines.

This caused overlapping text and inconsistent vertical spacing when
messages had varying font sizes or line counts.

Now properly track cumulative height as we iterate through lines to
ensure each message appears at the correct vertical position regardless
of individual line heights.
2026-02-21 08:48:17 +01:00
Vladislav Belov 975d1cb5fa Makes default rain a bit more natural 2026-02-20 22:46:50 +01:00
Vladislav Belov f1d62f348c Adds simple samples for new particle features 2026-02-20 22:46:50 +01:00
Vladislav Belov aae957ec7b Adds fixed orientation to particles
New features:

* Relative position
* Relative and absolute fixed axis
* Local space
* Axis along velocity vector
2026-02-20 22:46:49 +01:00
Vladislav Belov 4dff44ac9b Removes GL extensions for ARB backend 2026-02-20 22:07:40 +01:00
Vladislav Belov 6e9b94d3fc Removes ARB backend from options 2026-02-20 22:07:39 +01:00
Vladislav Belov 145e1c116d Removes ARB shaders 2026-02-20 22:07:39 +01:00
Vladislav Belov 0432b86de7 Removes ARB (legacy OpenGL) backend
ARB is a legacy backend which uses old assembly shaders. It makes
writing shaders more complex. According to the stats
https://feedback.wildfiregames.com we small amount of players with
ARB.

Fixes #8533
2026-02-20 22:07:38 +01:00
Vantha 963fed0036 Fix request timeout error dialog
The error dialog only showed "Failed to connect to server. The
connection request timed out." while since 78900842b1 it was supposed to
display a longer, more detailed message with a link to the FAQ. But this
never worked.
2026-02-20 21:26:52 +01:00
Vantha 0168ad9cbe Support setting multiply and add to 0 in techs
Previously (only) setting `multiply` and/or `add` to zero in a tech
modification caused warnings saying the format wasn't recognised.
With this patch, those cases are now handled as one would expect.
2026-02-20 21:26:19 +01:00
phosit 38eb999ff9 Use a slider for population cap
To allow Unlimited / Infinity the slider can't be linear.

Refs: #2593
2026-02-20 20:02:37 +01:00
phosit e79f8ea327 Without entities, don't require a simulation
Since 067a7abc72 a simulation is required when loading a non generated
map.
This breaks the serializationtest as it doesn't pass the simulation to
the secondary map-reader.
2026-02-17 20:37:21 +01:00
Atrik 0ad6d36049 Fix Trainer-ProductionQueue sync OnOwnershipChange
Use ProductionQueue.RemoveItem() instead of direct StopBatch() calls
to ensure both components stay in sync when entity training lists
change due to ownership changes.

Fixes #8691
2026-02-17 16:07:24 +01:00
Ralph Sennhauser 38939040e5 Set indent value for switch statement
Old and documented default is 0, tho the implementation changed at some
point to 1 in it's default config. As such explicitly set it to 0 so it
stays as is independent of stylistic version.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-02-16 14:19:19 +01:00
Ralph Sennhauser d4ec54a461 Update LICENSE files for cpp-httplib
Drop mongoose and add cpp-httplib instead.

Refs: #7140
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-02-15 19:47:30 +01:00
phosit a2c59cf87f Update appdata for next RC 2026-02-15 17:31:57 +01:00
Vladislav Belov 2e0c34d479 Adds sort mode to particles 2026-02-09 21:29:42 +01:00
ShadowOfHassen 88dc947b6a Update Petra Description
Update Petra Description to be more generic

Fixes #7545
2026-02-09 15:52:06 +01:00
wowgetoffyourcellphone eba1fb0e10 A Mild Edit to the White Cliffs of Dover description
Adds historical clarification and removes language that sounds a bit right-wingy to modern ears.
2026-02-09 00:06:01 +01:00
phosit 00f173685a Use std::optional for m_RejoinTestTurn
This removes a `-1` from #8468.
2026-02-08 19:56:01 +01:00
phosit df18e22277 Remove Script::CreateArray
It's better to construct a js-array from a `JS::RootedValueVector`.
Because it is more strongly typed and the index doesn't has to be
specified when appending an element.
Some usages are replaced with `JS::RootedValueArray`.

Fixes: #8702
2026-02-08 19:27:50 +01:00
obelix fe9c0f6c2f Fix the SpecificName for Athenian Hero Hippocrates
The SpecificName was a copy of GenericName.
2026-02-07 23:28:03 +01:00
Vladislav Belov 70c15abadb Fixes Atlas Terrain panel in dark mode 2026-02-06 15:21:15 +01:00
ShadowOfHassen 81e5b973c8 Fix spelling of Philip II of Macedon 2026-02-06 10:41:28 +01:00
ShadowOfHassen 2b4e0c46f0 Fix mixed up date
Reported by @Dunedan on the forum in
https://wildfiregames.com/forum/topic/137892-release-28-branch
2026-02-06 10:41:28 +01:00
phosit 45c3a03a2e Update appdata for next RC 2026-02-04 19:12:52 +01:00
guerringuerrin 1b814afd6c Integration of AutoCiv hotkeys for placing buildings, cycling through buildings, and selecting all units of certain class.
Simplify building selection hotkeys to use template basename instead of full path
Allow Shift hotkey to add buildings in cyclic selection hotkeys and also units in unit class selection hotkeys
Add support for remove unit class from selection
2026-02-04 08:09:45 -03:00
guerringuerrin 8c917ad240 Added myself to the programming credits 2026-02-04 11:09:58 +01:00
Atrik 498e7c896a Remove non-existent animation variant references
Fixes #8676
2026-02-04 11:05:07 +01:00
Atrik 99e3799883 Fix formation reshuffling after entity rename
When entities in formations were renamed (e.g., during promotion),
the formation would immediately recalculate all member positions,
and queue movement orders causing visible shuffling.

Changes:
1. Transfer existing offsets movement to the renamed entity
   to maintain current formation structure
2. Schedule offset recalculation for the next tick to allow proper
   reordering after all systems have updated

This preserves formation integrity during renames while allowing
eventual optimal position recalculation.

Fixes #8656
2026-02-04 11:05:07 +01:00
Atrik 6cdbdae87c Add tolerance to offset destination checks
The 0 tolerance to prevent the "waltzing" that was set before this
cannot happen anymore as we now since check for being at destination
before sending a move request in UnitAI. Adding a new small tolerance
now prevents some small movement adjustments of formation members
near their destination.

Fixes #8592
2026-02-04 11:05:07 +01:00
Atrik 8e15b9c000 Fix unit acceleration reset on upgrade
Fixes #7625
2026-02-04 11:05:07 +01:00
Atrik fb1c0d2a82 Fix renamed entities on TurretPoint
Some units would retain an undue HeightOffset after renaming
while being on a TurretPoint.

Fixes #8651
Fixes #2004
2026-02-04 11:05:07 +01:00
real_tabasco_sauce 87ed9c8092 German balance emergency changes
-Seeresses "Soldier" class removed as they are support units.
-Seeresses given correct vision value.
-Seeresses are unaffected by healer discount.
-germans no longer access archery spread tech since they have no archers.
2026-01-31 18:38:08 -07:00
phosit 72591b7608 Update appdata for next RC 2026-01-29 20:51:48 +01:00
Ralph Sennhauser 958e6de9d3 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>
2026-01-29 20:03:56 +01:00
Ralph Sennhauser 0d60bdfd2e 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>
2026-01-29 20:03:56 +01:00
Vantha b5c4a4635c Revert temporary workarounds for font baseline issues
Those workarounds were added in order to hide issues with the font
rendering in the short term for R28 and will hopefully be properly fixed
for R29.
2026-01-29 19:05:34 +01:00
Vantha 2483e7172b Temporary workaround for font baseline issue
Quick temporary fix for #8505 for the release of R28.
2026-01-29 19:05:34 +01:00
Vantha 7fd788af0f Temporary workaround for icon misalignment
Quick temporary fix for #8194 for the release of R28.
2026-01-29 19:05:34 +01:00
Atrik 68e625ab7a 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
2026-01-29 11:47:16 +01:00
obelix 8129b8ffc1 Fix a typo in Seleucid team bonus description
reported by @GurkenKhan in the forums on January 9:
https://wildfiregames.com/forum/topic/137892-release-28-branch
2026-01-27 17:55:11 +01:00
Ralph Sennhauser 0691e7f0ff 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>
2026-01-26 08:57:42 +01:00
Vladislav Belov cce01f4d6c Fixes compilation after #8621
Fixes #8685
2026-01-25 16:29:16 +01:00
Olivier Tilloy 6436ba3af9 Spidermonkey build: cherry-pick an upstream commit to create thin archives
This saves a sizeable amount of disk space during the build, by not creating
a very large libjs_static.a (~1.5 GB) that contains a copy of all the symbols
in the object files generated during the build.

Upstream bug: https://bugzilla.mozilla.org/show_bug.cgi?id=2008085
Upstream commit: https://hg.mozilla.org/mozilla-central/rev/a924182c4e55

Note that the upstream commit doesn't apply cleanly to Spidermonkey 128.13.0,
it had to be rebased.
2026-01-25 10:58:33 +01:00
phosit 13453a3c7b Remove ScriptContext::CreateContext
This function nudges one into using it instead of the constructor. Even
though a `std::shared_ptr` isn't required.
2026-01-24 12:03:05 +01:00
Chrzanof 5daae13525 Pass device command context by reference in DebugRenderer
Improve the DebugRenderer API by passing the IDeviceCommandContext
as a reference instead of calling g_Renderer.

Fixes: #6650
2026-01-24 11:54:01 +01:00
Ralph Sennhauser 8962e066c9 Remove mongoose
Remove sources and references in premake build script as it's no longer
used.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-01-24 10:45:48 +01:00
Ralph Sennhauser ba4ef61c15 Use cpp-httplib instead of mongoose
Use cpp-httplib for Profiler2 and RLInterface instead of mongoose.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-01-24 10:45:48 +01:00
Ralph Sennhauser 7e575aa855 Enable use of cpp-httplib
Add cpp-httplib to library build scripts and enable it's use in premake.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-01-24 10:45:48 +01:00
Ralph Sennhauser 9c1f133118 Package cpp-httplib
Intended as replacment for mongoose, which due to license change can't
be updated anymore.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-01-24 10:45:48 +01:00
phosit 03a5198ed3 Remove g_GUI usage in simulation2/*
This is the last remaining inclusion of a gui file in simulation2/.
2026-01-23 21:05:18 +01:00
phosit 153dfe7ef1 Don't use g_GUI in TurnManager
The turn-manager shouldn't know about the gui.
2026-01-23 21:05:14 +01:00
Atrik 2735cdc156 Add unit tests for multi-level class sorting 2026-01-23 17:20:11 +01:00
Atrik be2de39238 Use multi-level sorting in the default formation 2026-01-23 17:20:11 +01:00
Atrik 065ecdbdf8 Implement level class sorting for formations
Add support for multi-level priority sorting of entity classes
in formations.

fixes #7547

Change formation template's default sorting order
using multi-level sorting.

fixes #6873
2026-01-23 17:20:11 +01:00
Vantha 40dfde9890 Add the Germans to the fireship tip
Fixes #8660
2026-01-22 12:55:03 +01:00
phosit a6357322e9 Serialize canPlay property in Petra
This was forgotten in 7b1d4426aa.

Fixes: #8674
2026-01-21 19:40:38 +01:00
Vantha b93634fb28 Clean some rebase oversights of 832501fc9b 2026-01-21 19:05:58 +01:00
Dunedan f4c52e49a7 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.
2026-01-14 22:02:02 +01:00
Vantha 6a5baa1a68 Remove unused pop cap type appendage
Unused ever since they were added in 5741f77c6e.
2026-01-14 11:22:31 +01:00
Dunedan 93ce94655d Use @stylistic/brace-style for eslint
Up to now `eslint-plugin-brace-rules` was used to enforce a common brace
style for JavaScript code. This plugin was however updated the last time
over 9 years ago and will be incompatible with ESLint v10, as that
[removes `context.getSourceCode()`][1], the plugin relies on.

To keep the eslint config working with ESLint v10, this replaces
`eslint-plugin-brace-rules` with the [`@stylistic/brace-style`][2] rule
from `@stylistic/eslint-plugin`, a package we already use.

While `@stylistic/brace-style` doesn't offer an option to format braces
in exactly the same way as before, the "allman" style seems to be the
one closest to the existing code.

[1]: https://eslint.org/blog/2025/11/eslint-v10.0.0-alpha.0-released/#removed-deprecated-rule-context-members
[2]: https://eslint.style/rules/brace-style
2026-01-12 21:33:52 +01:00
Dunedan 8f8d1195c2 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
2026-01-12 07:59:59 +01:00
Ralph Sennhauser d070bf66b3 List reason for role change in MUC
Shows the reason for the role change in the status message. This is
mostly relevant for communicating the reason and possibly duration for a
moderator or bot muting a user.

Refs: #5679
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-01-09 19:07:45 +01:00
phosit 5255b919d9 Remove g_ServerId in gamesetup_mp.js
This variable was unused.
2026-01-08 20:23:42 +01:00
phosit 5325e6d00d Use exceptions in gamesetup_mp.js
In some places `false` was used to represent an error. In other places
`true` was used for that. With exceptions it's obvious which is the
error.
2026-01-08 20:23:42 +01:00
Cayleb-Ordo 4536190ab4 Update Icon handling of ActorEditor
Previously on non Windows Platforms the Programm would not get its
icon, as the *.rc is not used on e.g. Linux.
Use an xpm File for non Windows Platforms. Use the convenience macro
from wxWidgets to load the icon in a single call.

The icon was converted using GIMP 3.0.6. To avoid `-Wwrite-strings` the
static char* was converted to a const char*.
2026-01-08 11:12:24 +01:00
phosit b77ee3c5dc Update appdata for next RC 2026-01-05 20:48:20 +01:00
Ralph Sennhauser e92972d51c Simplify exchange in XMPPClient
Prime usecase for std::excahnge.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-01-03 20:30:31 +01:00
Ralph Sennhauser dcd12183e4 Label XMPP debug output
Prefix output of DbgXMPP so it is clearly assosiated. Furhter avoid
newlines in debug statements.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-01-03 20:30:31 +01:00
Vantha bb31e6b6b1 Prevent invalid GetEntityState GuiInterface calls
As long as there's no entity under the cursor, 11 calls were made per
tick with an undefined entity ID, which are now caught.

In general, an "entity state" can very well be null if the passed ID
is undefined, invalid or no entity with the ID exists (anymore). This
last case is only noticed by the GuiInterface and currently used to
detect destroyed entities.
2026-01-02 11:49:28 +01:00
phosit ba2351611c Remove LoadScripts from CSimualation2
`LoadScripts` and `LoadDefaultScripts` have to be called imediately
after the `CSimulation2` constructor.

By doing the necesarry work in the constructor and removing
`LoadScripts` and `LoadDefaultScripts` the interface of `CSimulation2`
is simplified.
2026-01-01 17:27:54 +01:00
phosit 0b83e24065 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.
2026-01-01 14:53:45 +01:00
Ralph Sennhauser bc021863af Query XMPP client for connection state
Instead of tracking the connection state separately just query the
client directly.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-01-01 11:42:23 +01:00
Olivier Tilloy 7f0486e18e Add myself to the community credits (for packaging work) 2025-12-31 13:35:03 +01:00
Olivier Tilloy 8bd0d0b84f 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).
2025-12-31 13:34:09 +01:00
Itms d1319179f8 Build the Actor Editor during the nightly build
This is a regression of a fix in 7e481b73cd,
lost during the git migration. Refs #1819
2025-12-30 22:23:12 +01:00
Vantha 9b8ff77265 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
2025-12-29 21:29:34 +01:00
Vantha 3a73dffc1c Add fallback values for pop cap and pop cap type
Make InitGame.js responsible for providing proper (defined) values.

Refs #7850
Fixes #7695
2025-12-29 21:29:34 +01:00
Atrik f856565de9 Add formations paths to UnitMotionDebugOverlay
Formation controllers now display their movement paths when enabling
UnitMotion debug overlay.

Key changes:
- Formation controllers show long paths in blue and short paths in green
- Formation controllers path are rendered if selecting
  some of the formation's members
- Prevent the gui from making redundant calls to SetMotionDebugOverlay

Existing limitations (not regressions):
- Paths are often cleared before entities complete them
- Formation members have short paths that rarely get rendered
2025-12-29 14:30:14 +01:00
Vantha 2e450f0f52 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).
2025-12-29 13:46:47 +01:00
trompetin17 8e820a988e 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
2025-12-28 20:35:20 +01:00
Vladislav Belov df9c6f510c 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
2025-12-28 17:36:36 +01:00
Itms 771bf0ba08 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.
2025-12-28 16:26:41 +01:00
Vladislav Belov cea77c497c Fixes TerrainTextureManager after refactoring
In fb98f5059a the manager was refactored
and the order of deinitialization was incorrectly changed.
2025-12-28 12:34:26 +01:00
real_tabasco_sauce 621b4f96cc update scenario map to account for changed template name for clubman 2025-12-27 23:25:07 +01:00
real_tabasco_sauce ec19e5d663 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.
2025-12-27 23:25:07 +01:00
Vladislav Belov f43e98da09 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
2025-12-27 21:02:48 +01:00
phosit e62eb96092 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.
2025-12-27 18:21:18 +01:00
phosit 426ec45751 Don't suspend loader after each finished task
By moving the common `goto done;` ouf of the if-block 5586802b86 changed
the code so that the loader suspend after each task.
This normally isn't a problem as it will continue in the next frame. But
when entering atlas it is treated as an error.
2025-12-27 17:17:06 +01:00
obelix b7247ae7fb Rename Neareastern Badlands to Cappadocian Badlands
A discussion on the forums had the result, that the name Neareastern
Badlands should be changed as it contains an eurocentric view on Anatolia.

Fixes #8590
2025-12-27 15:49:44 +01:00
Vantha 832501fc9b Remove columnar walking behavior of formations
This behavior is a remnant of the very first implementaion of
formations, when there weren't different types of yet, only
box for fighting and column for walking.
Now that we have different types of selectable formations, however, this
behavior is no longer desired, it also caused a lot of ugly reordering
when giving walk commands. See the issue for more details.

Fixes #8580
2025-12-26 10:54:00 +01:00
Vantha 4d08446285 Improve Engine.GetTextSize deprecation message 2025-12-23 14:37:23 +01:00
Vantha 670f1e5d42 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
2025-12-23 10:28:22 +01:00
Vantha fbb6052c30 Fix oversight in 83f4d8789b 2025-12-23 10:28:22 +01:00
phosit 067a7abc72 Don't use PS::Loader::Task outside of Loader
PS::Loader::Task is made for the Loader and it's combersome to use it
outside. Also there is an overhead.
2025-12-21 15:51:58 +01:00
phosit 2fc61dd172 Remove ProgressiveLoadEntities
It's a coroutine. The resumer can decide whether it's loaded
progressively or not.
2025-12-21 15:51:58 +01:00
phosit 5586802b86 Use a coroutine for Loader tasks
Some tasks are invoked multiple times. Normally those tasks are broken
up inside a loop and had to be continued there. With coroutines that is
easier as it's possible to suspend inside a loop.

Coroutines which are lambdas should not capture anythig as the lifetime
of the captured values might end before the coroutine completes. For
that purpose `std::bind_front` is used.
2025-12-21 15:51:46 +01:00
phosit b67faf35c3 Switch main branch to Release 29 2025-12-18 18:16:11 +01:00
Atrik d14ee373bf Remove PostMessage for transitions IDLE to IDLE
Co-authored-by: @Vantha

Add 'isIdleConfirmed' flag to distinguish between
entering IDLE state and being confirmed idle.
Only send 'MT_UnitIdleChanged' messages after the
100ms timer elapses while still idle,
preventing spurious notifications for units
that instantaneously enter and leave IDLE.
This prevent the GUI to display a flickering idle count
in most cases, for example.

Refs : #8591
2025-12-18 10:22:27 +01:00
Atrik a670656212 Add Atrik to Programming Credits 2025-12-18 10:22:27 +01:00
Atrik 0f58a8511c Add a test for IsRearrangementAllowed 2025-12-18 10:22:27 +01:00
Atrik 45fd632cef Add a test for AttemptObstructionMitigation 2025-12-18 10:22:27 +01:00
Atrik b98e7f3b5b Fix formation combat stop command bug
Remove the ResetIdle method that was causing issues with the
'Stop units' command in formation combat

The method was originally added to prevent formation members
from appearing idle during patrol waypoints, but formation
controllers or its members no longer enter idle states
even without it

The ResetIdle method was sending MT_UnitIdleChanged messages
causing formation members to bug when using stop commands

Fixes: #8546
2025-12-18 10:22:27 +01:00
Atrik be6670df89 Add a test for GetClosestMemberFunctions 2025-12-18 10:22:27 +01:00
Atrik 06c40946eb Simplify calls for moving units into formation
Co-authored-by: @Vantha

Centralize all calls to move units into formation in UnitAI
Allowing additional checks to be done
before calling members to reform formation

Fixes : #8545

Revised Formation methods and when they do call
on reforming formation

Fixes : #7328

Don't order formation members to go to a point
if the controller is stuck
Instead make the controller jump to the member
who is closest to the destination

Fixes : #8543

Correct 'filter(member)' instead of 'filter(ent)'
in GetClosestMemberToPosition (ex GetClosestMember)

Fixes :	#5120
2025-12-18 10:22:27 +01:00
phosit cfb742c914 Return the value from GuiPoll 2025-12-17 13:39:17 +01:00
phosit f23dde2f73 Use StructuredClone in m_GuiMessageQueue
The elements have to be cloned either way. Now they don't have to be
traced when they are in the queue.
2025-12-17 13:39:16 +01:00
phosit 2a2d5de350 Replace LDR_* with PS::Loader::* in comments
This has been forgoten in 1917d034fd.
2025-12-16 19:35:25 +01:00
phosit ca0d6d3768 Remove references to InitEverything in Loader.h
This function seems to be removed a long time ago.
2025-12-16 19:29:05 +01:00
phosit 14a5ccee52 Propagate error from autostart
The JavaScript error wasn't propagated leading to an infinite loop.

Fixes: #7967
2025-12-14 19:07:01 +01:00
phosit f03be7b568 Initialize more members of CNetClient
The username and the jid have to be set before the client is connected.
With this commit it's not possible to initialize them to late.
2025-12-14 17:23:05 +01:00
phosit b686dfa047 Use range based for loop in TestSerializerPerf
CppCheck warned that `i` might be out of bound.
2025-12-13 18:58:17 +01:00
phosit 9911615e62 Always set scenario members in rl-interface reset 2025-12-13 18:58:17 +01:00
phosit 1917d034fd Introduce a namespace in Loader
All functions had a `LDR_` prefix. The prefix is removed.
Functions and globals which are only used in Loader.cpp are now
contained in an anonymous namespace.
2025-12-13 18:58:17 +01:00
phosit f257ce8f9c Remove the unused time_left parameter
The `time_left` was passed to the registered functions but it was never
used.
2025-12-13 18:58:17 +01:00
phosit de841d30e4 Return description and progress from loader
There was a comment implying that `wchar_t*` is more iteroperable then
`std::wstring`. When there is no allocator `std::wstring` won't work,
sure. But when there is no allocator other things in Pyrogenisis will
also not work.

And for the progress there was just no reason to use a return parameter.
2025-12-13 18:58:17 +01:00
phosit 873b91774b Use std::unique_ptr for xml_reader in CMapReader
With this the destructor can be defaulted. Also the `SAVE_DELETE` can be
changed to a `.reset()` with that it's header doesn't has to be
included.
2025-12-13 18:58:17 +01:00
phosit efe0ed598f Apply rule of five to CMapReader 2025-12-13 18:58:17 +01:00
Itms ac36758b21 Do not use Jenkins custom SVN client on Windows
It is extremely prone to timeouts and failures in this environment.
2025-12-13 11:00:09 +01:00
phosit c02764e17a Increase home island size on River Archipelago
With some settings mines weren't able to be placed.
Refs: #8579
2025-12-09 18:49:34 +01:00
real_tabasco_sauce e96d981319 buff new carthage unique mercenary slinger with increased crush damage and greater accuracy. 2025-12-06 19:24:09 +01:00
cube002 cb3fecfce9 Update binaries/data/mods/public/simulation/data/technologies/civbonuses/cart_stone_01.json 2025-12-05 18:10:46 +01:00
cube002 91baeeb94e Update binaries/data/mods/public/simulation/data/technologies/civbonuses/cart_stone_02.json 2025-12-05 18:10:46 +01:00
cube002 9c836d39e6 Update binaries/data/mods/public/simulation/data/technologies/civbonuses/cart_stone_03.json 2025-12-05 18:10:46 +01:00
cube002 f30271e955 Update binaries/data/mods/public/simulation/data/technologies/civbonuses/cart_stone_03.json 2025-12-05 18:10:46 +01:00
cube002 a03b01c935 Update binaries/data/mods/public/simulation/data/technologies/civbonuses/cart_stone_02.json 2025-12-05 18:10:46 +01:00
cube002 8d38ecda26 Update binaries/data/mods/public/simulation/data/technologies/civbonuses/cart_stone_01.json 2025-12-05 18:10:46 +01:00
phosit 759406dd77 Update appdata for the next RC 2025-12-02 18:49:14 +01:00
Ralph Sennhauser 31a262ff7e 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>
2025-11-30 15:30:46 +01:00
phosit a1ba9e34c4 Remove unused m_DeltaTime
Seems to be unused since c684c211a2
2025-11-30 13:49:31 +01:00
Dunedan 0086f005d4 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.
2025-11-29 15:59:07 +01:00
Dunedan ed1bd1d75b 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.
2025-11-29 09:20:24 +01:00
Atrik 426693ebef Default hotkeys changes
Reassign 'Toggle mouse grab' to F3 to avoid conflicts with gameplay hotkeys

Unassign 'Show status bars' often toggled by mistake by new players and confused for a selection bug

Assign 'Bird eye view' to Shift+Tab
2025-11-26 16:42:18 +01:00
Vantha ccd1046d67 Parallelize the execution of range queries
Use futures to spawn several threads that concurrently work through the
active range queries each turn instead of doing everything serially on
the main thread -- similar to how the pathfinder computes pathfinding
requests asynchronously. This significantly increases performance.
Note: It still can't run in parallel to the rest of the simulation update since
the range computations depend on the state of the simulation (like the
position of units).
2025-11-26 16:10:29 +01:00
real_tabasco_sauce a32a28a5e3 Add capture animations for citizens
Fixes #8557
2025-11-25 17:41:55 +01:00
Vantha ab49af1b1c Correct the name of the Germans' sandbox map 2025-11-25 10:52:37 +01:00
Vantha 36e93989d4 Correct some settings of the Germans' sandbox map 2025-11-25 10:29:30 +01:00
Ralph Sennhauser 7452bf882f Add test for loading players templates
Checks that those templates can be loaded, i.e. are adhering to the
schema.

Refs: #8540
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-11-22 08:41:02 +01:00
phosit 9a526bcae1 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
2025-11-20 19:38:36 +01:00
phosit 977bf5c0d1 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.
2025-11-20 19:38:33 +01:00
phosit b17c2fb80f Use designatet initializers for AppHooks
CppCheck wasn't able to handle `{0}`. C++20 allows to use designated
initializers.
2025-11-20 19:37:50 +01:00
phosit 3c9b4b922e Make getCameraProperty a lambda
A lambda is more explicit which argument it takes.
2025-11-18 20:02:06 +01:00
phosit 5b1ce0957d Make getEnvironmentProperty a lambda
A lambda is more explicit which argument it takes.
2025-11-18 20:02:06 +01:00
phosit 3d26b9123a Make getTerrainProperty a lambda
A lambda is more explicit which argument it takes.
2025-11-18 20:02:06 +01:00
Vantha 44984699f1 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.
2025-11-18 11:34:10 +01:00
Vantha 7032293207 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
2025-11-18 11:34:10 +01:00
Stan 84d4dbc506 Use Future for the userreporter
Previously we relied on a raw thread.
Pull Request: #8537
Reviewed by: @phosit
Refs: #5874
2025-11-17 21:45:00 +01:00
Ralph Sennhauser 5609492731 Add Atlas support to Appimage
Include the shared library libAtlasUI.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-11-15 16:29:01 +01:00
Vantha faa049fe4b Don't set up command and selection panels twice
In the (common) case that the player controls all selected units or is
an observer, the 'Selection' and 'Command' panels were set up ahead and
then in the for loop again, which was wasteful.
2025-11-14 10:59:45 +01:00
Vantha 83fc0dbca8 Only load command buttons that will be displayed
There are currently 19 entity commands in total, but only the first 6
possible (depends on the active selection, e.g. patrolling isn't
possible if no units are selected) ones are ever displayed as buttons
(defined by g_SelectionPanels.Command.getMaxNumberOfItems)  However,
when updating (once per turn or whenever the selection changes),
g_SelectionPanels.Command.getItems always called `getInfo` on all of
them, even though all data computed after the first 6 wasn't read or
used anywhere later. So, stopping immediately after the 6th and never
returning an array longer than 6 saves all of the dead time without
affecting the outcome in any way.

It's important to mention, that this issue isn't exclusive to the
'Command' selection panel: the getItems methods of the other panels can
also return an array longer than their getMaxNumbertOfItems value
(that's why they specify it in the first place). However, for the
command panel this happens for many common selections and seemingly to
by far the largest extent. For the other panels it happens much more
rarely, only for especially large and obscure selections, and even then
does not have nearly as big of an impact. So, modifying the other
getItems methods as well (to never return too many items) is probably
not worth it, and the more robust solution is to instead keep the
safeguard system of getMaxNumbertOfItems.
2025-11-14 10:59:45 +01:00
phosit 6bdcab11b9 Don't forward declare CompiledModule
When using `std::unordered_map` it's types have to be complete.
2025-11-13 19:50:38 +01:00
Ralph Sennhauser 68a7abb3b3 Add C++ feature test pipeline
This adds the feature check code found on cppreference [1] and a Jenkins
pipeline to generate a feature status list for all platforms.

Aggregate a summary and upload it to docs.wildfiregames.com

[1] https://en.cppreference.com/w/cpp/experimental/feature_test.html

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-11-12 18:28:59 +01:00
Ralph Sennhauser 9ffbf15ee1 Fix -Wunnecessary-virtual-specifier warnings
Commit 3eee3a444d added final keyword to
simulation classes but left virtual keywords in place.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-11-11 21:35:01 +01:00
Ralph Sennhauser 66738c12a1 Suppress false positive in cppcheck
```
source/simulation2/components/CCmpRangeManager.cpp:1953:18: error: Out of bounds access in 'm_LosRevealAll[MAX_LOS_PLAYER_ID+1]', if 'm_LosRevealAll' size is 16 and 'MAX_LOS_PLAYER_ID+1' is 17 [containerOutOfBounds]
   m_LosRevealAll[MAX_LOS_PLAYER_ID+1] = enabled;
                 ^
source/simulation2/components/CCmpRangeManager.cpp:1967:21: error: Out of bounds access in 'm_LosRevealAll[MAX_LOS_PLAYER_ID+1]', if 'm_LosRevealAll' size is 16 and 'MAX_LOS_PLAYER_ID+1' is 17 [containerOutOfBounds]
  if (m_LosRevealAll[MAX_LOS_PLAYER_ID+1] || player == -1)
                    ^
```

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-11-11 21:35:01 +01:00
Ralph Sennhauser 9ea5a789a7 Fix EntityMap::iterator
Fixes cppcheck error
```
source/simulation2/system/EntityMap.h:104:11: error: Reference to local variable returned. [returnReference]
   return ptr;
```

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-11-11 21:35:01 +01:00
phosit 354ed957dc Extend appdata.xml for 0.28.0 2025-11-11 18:09:41 +01:00
joeybadz c6b8593bdf Remove duplicate fertility festival tech in German tech tree 2025-11-11 02:50:33 +01:00
Vladislav Belov c0ea17f06e Replaces choosedDeviceIt by chosenDeviceIt 2025-11-11 01:51:16 +01:00
Vladislav Belov 485200342d 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
2025-11-11 01:50:58 +01:00
obelix 479995bc6f Change BuildTime of Gaul Arrow Ship 2025-11-11 00:14:34 +01:00
obelix 90847e0591 Change BuildTime of Brit Arrow Ship 2025-11-11 00:14:34 +01:00
Vantha 19f6dd031d 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.
2025-11-10 22:55:42 +01:00
Ralph Sennhauser 4f6d4a91b0 Fix -Wtautological-overlap-compare in stun test
Fix the minimal check for an invalid IP returned.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-11-10 11:41:52 +01:00
Ralph Sennhauser 32edc28cda 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>
2025-11-10 06:45:24 +01:00
Vladislav Belov c4bc6c9627 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.
2025-11-10 00:06:52 +01:00
Vladislav Belov 8a64182ca2 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.
2025-11-10 00:06:51 +01:00
Vladislav Belov de36c75023 Deletes Vulkan resources on swapchain recreation
The change tries to minimize a memory peak during a window resizing.

Refs #6864
2025-11-10 00:06:41 +01:00
Vantha be83ba4029 Provide context for the translation of "Germans" 2025-11-09 22:52:32 +01:00
Vantha 5d4eab73f9 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.
2025-11-09 22:52:32 +01:00
Vantha f38bc89611 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ô")
2025-11-09 22:52:32 +01:00
Vantha 05b1ac4559 Correct an overlooked 'Women' to 'Workers' 2025-11-09 22:52:32 +01:00
Vantha a71688fc2c 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.
2025-11-09 22:52:32 +01:00
Vantha 4d9fc0bb53 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.
2025-11-09 22:52:32 +01:00
Vladislav Belov 8b1b1d28f8 Fixes missing Vulkan application version
Missing after dc830ccf55.
2025-11-09 12:58:16 +01:00
Stan 93706ae37c Add credits for Obskurias 2025-11-07 21:42:00 +00:00
phosit 2748a45fc6 Remove ScriptEvent with only one parameter
The effect is the same when the second parameter is defaulted.
2025-11-05 14:39:44 +01:00
phosit 7ccea4ace9 Remove *WithReturn duplication
This has been introduced in 1ed64439ea.
2025-11-05 14:39:44 +01:00
Vantha 75feace618 Add a sandbox map for the Germans 2025-11-04 11:09:34 +01:00
phosit 9588da1d94 Add Boiorix as the codename for Release 28 2025-11-02 21:18:44 +01:00
phosit d786ac2dce Suppress wrong positive of cppcheck in Game.cpp 2025-11-01 17:52:35 +01:00
phosit ef016884ab Pass debugOptions on construction of CSimulation2
The functions to set them explicitly are removed. This makes the
interface of `CSimulation2` smaller.

Also serializationtest and rejointest can't be active at the same time.
Add a warning about that and use a `std::variant`.
2025-11-01 17:31:54 +01:00
phosit 10afb7d856 Pass ooslog-activate flag on construction
This deduplicates the activation logic and removes the only
`m_EnableOOSLog` mutation.
2025-11-01 16:35:39 +01:00
Ralph Sennhauser 0fe18e1d84 Enable test loading all templates
The test takes about 0.5s in release build and about 2s in debug build,
hardly qualifying as slow. As such enable it.

About the noise, it's of little interest anyway so don't spam.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-11-01 16:15:31 +01:00
real_tabasco_sauce 83dba854e5 adjust corsica vs sard 2025-11-01 15:16:48 +01:00
Ralph Sennhauser 16c9795cd1 Remove generic cache
The removal of the VFS cache in 89e339dd16
meant there is no longer a user. As such also clean out the generic
parts with the Landlord and a LRU policies.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-31 17:03:34 +01:00
real_tabasco_sauce c79cd4c733 allow Ashoka to build edict pillars quickly. 2025-10-30 07:18:50 +01:00
real_tabasco_sauce 2306140192 allow pillars of ashoka to be built in allied territory. 2025-10-30 07:18:50 +01:00
real_tabasco_sauce 94d3699ce4 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
2025-10-29 15:29:28 +01:00
Ralph Sennhauser eba8439295 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>
2025-10-29 09:56:32 +01:00
Ralph Sennhauser 618ffc7bf9 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] https://github.com/boostorg/system/commit/7a495bb46d7ccd808e4be2a6589260839b0fd3a3
[1] https://github.com/boostorg/system/commit/2fa0a00583a3a791092568d2ade793314181926e

Fixes: #8471
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-29 09:56:32 +01:00
Ralph Sennhauser e97f43b692 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>
2025-10-29 09:08:12 +01:00
phosit 75805f4b23 Remove the relaypoint before training units
While not as efficient this order is easier to reason and let's player
pause.
2025-10-28 09:52:53 +01:00
phosit e195c52e30 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.
2025-10-28 09:52:53 +01:00
phosit c3727a6a79 Rewrite the phrase about building multiple houses
It was hard to understand.
2025-10-28 09:52:53 +01:00
phosit 727be2fb45 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.
2025-10-28 09:52:53 +01:00
phosit a6e4e22ca2 Replace civ by player in phrase about color
The color is not specivic to the civ but to the player.
2025-10-28 09:52:53 +01:00
phosit 29ac569511 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.
2025-10-28 09:52:53 +01:00
phosit 4f38600c39 Replace "I" with the hotkey in eco walkthrough 2025-10-28 09:52:53 +01:00
phosit e0481b283b 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
2025-10-28 09:14:28 +01:00
fahad-accordion-19 56d7be5334 Remove <type> from minimap schema and templates
The <minimap> element in resource templates previously included a <type>
child element that was required by CCmpMinimap.cpp. This commit removes
the <type> field from the minimap schema in CCmpMinimap.cpp and from all
affected templates, making the minimap component resource-agnostic and
simplifying template definitions.

Refs: #8170
2025-10-26 21:43:25 +01:00
Itms 4716a230ab Store NSIS registry keys under a consistent root
Reviewed-At: https://gitea.wildfiregames.com/0ad/0ad/pulls/8476
2025-10-26 20:58:55 +01:00
Itms 18df61517c 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
2025-10-26 20:58:54 +01:00
Itms f772181501 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
2025-10-26 20:58:49 +01:00
Itms 866d6f0527 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
2025-10-26 09:16:46 +01:00
Itms 50f6da2a13 Use the PYROGENESIS_VERSION macro instead of a global
Reviewed-At: https://gitea.wildfiregames.com/0ad/0ad/pulls/8222
2025-10-26 09:16:44 +01:00
Itms f0c8db6422 Address cppcheck uninitialized warning
Reviewed-At: https://gitea.wildfiregames.com/0ad/0ad/pulls/8222
2025-10-26 09:16:43 +01:00
Vladislav Belov cb58116270 Fixes lseek for big files on Windows
It was broken in ef69c37f66, before that we were using _lseeki64.

Fixes #8459
2025-10-25 13:35:59 +02:00
Vantha 7b1d4426aa 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.
2025-10-23 22:09:30 +02:00
Vantha a25750f62d Fix a crash when the Petrabot region analysis fails
When the region analysis fails, that's usually because the AI doesn't
have any units or CCs at all.
Previously, the whole game crashed when serializing because this.noBase
was still undefined.
2025-10-23 22:09:30 +02:00
Vantha ce512e383f Move PlayerRemoved.js to gamesettings/attributes/
All other gamesettings are placed in that directory already.
Having one script somewhere else risks breaking stuff like autostart.
2025-10-22 09:54:34 +02:00
Itms 59d28fed9b Lock Linux CI cbindgen version and dependencies
This allows us to keep testing building with the minimal supported
Rust version.
2025-10-21 21:12:12 +02:00
abian 95467c2327 Hide Abort Unit Order button when idle or guarding
Reviewed-By: bb
Fixes #6854
2025-10-18 09:35:58 +02:00
Timothy Pearson 2c9928e4cb Fix FTBFS on ppc64le systems
Tested to compile and function normally under Debian Trixie ppc64le / POWER9

Signed-off-by: Timothy Pearson <tpearson@raptorcs.com>
2025-10-16 20:53:14 -05:00
Vladislav Belov 99bf50cd4e Reduces boost usage for strings 2025-10-16 09:17:05 +02:00
Vladislav Belov e8d9a8db67 Adds Vulkan timestamp limits to report 2025-10-16 00:36:02 +02:00
Ralph Sennhauser 0b55f44c5e Use return instead of exit in testrunner
On request by phoist replace exit with return statements.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-15 18:17:24 +02:00
Ralph Sennhauser a7d65d4a34 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>
2025-10-15 18:17:24 +02:00
phosit 019374d5c7 Bump copyright year for windows build 2025-10-15 12:36:00 +02:00
Vladislav Belov 1441c971f5 Uses SDL workaround only for GL 2025-10-15 00:52:25 +02:00
Vladislav Belov f2752f7230 Removes ARBShader capability 2025-10-14 13:04:16 +02:00
2617 changed files with 51134 additions and 58927 deletions
+2 -2
View File
@@ -28,9 +28,9 @@ source/tools/spirv/.* @vladislavbelov
## == Scripts
## GUI
binaries/data/mods/public/gui/.* @Phosit @wraitii
binaries/data/mods/public/gui/.* @Vantha @wraitii
## AI
#binaries/data/mods/public/simulation/ai/.*
binaries/data/mods/public/simulation/ai/.* @Phosit
## Balancing
binaries/data/mods/public/simulation/(data|templates)/.* @real_tabasco_sauce
+4 -2
View File
@@ -14,6 +14,7 @@ libraries/macos
libraries/win32
libraries/win64
libraries/source/cpp-httplib/*
libraries/source/cxxtest-4.4/*
libraries/source/fcollada/*
libraries/source/nvtt/*
@@ -28,11 +29,12 @@ libraries/source/spirv-reflect/*
appimage-build/
archives/
build/bin/
source/tools/spirv/rules.*.json
source/tools/spirv/rules.json
# Linting
cppcheck-error.log
compile_commands.json
copyright-check-error.log
cppcheck-error.log
# Files generated by running premake5
build/premake/.gccmachine.tmp
+2 -3
View File
@@ -83,13 +83,12 @@ repos:
args:
- --strict
- repo: https://github.com/eslint/eslint
rev: v9.33.0
rev: v9.39.2
hooks:
- id: eslint
language_version: 22.14.0
additional_dependencies:
- eslint-plugin-brace-rules@0.1.6
- "@stylistic/eslint-plugin@4.4.0"
- "@stylistic/eslint-plugin@5.6.1"
args:
- --max-warnings=0
- --no-warn-ignored
-3
View File
@@ -81,9 +81,6 @@ 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
+68 -27
View File
@@ -107,6 +107,10 @@ shadowscovermap = false
renderer.scale = 1.0
renderer.upscale.technique = "fsr"
; Allows to disable rendering when the game window is out of focus. It might
; save some performance or fix old driver crashes on out of focus.
renderer.renderwhenoutoffocus = "true"
vsync = false
particles = true
fog = true
@@ -148,9 +152,6 @@ renderer.backend.vulkan.debugwaitidlebeforeacquire = false
renderer.backend.vulkan.debugwaitidlebeforepresent = false
renderer.backend.vulkan.debugwaitidleafterpresent = false
; Should not be edited. It's used only for preventing of running fixed pipeline.
renderpath = default
; (0 - low, 1 - medium, 2 - high), higher quality means worse performance.
textures.quality = 2
@@ -160,10 +161,19 @@ 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
; Use screen-space postprocessing filters (HDR, bloom, DOF, etc). Incompatible with fixed renderpath.
; Use screen-space postprocessing filters (HDR, bloom, DOF, etc).
postproc = true
; Use anti-aliasing techniques.
@@ -216,13 +226,19 @@ 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 = "Ctrl+Alt" ; Toggle mouse grabbing mode
mousegrabtoggle = F3 ; 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
@@ -230,7 +246,7 @@ paste = "Ctrl+V" ; Paste from clipboard
cut = "Ctrl+X" ; Cut selected text and copy to the clipboard
; > CONSOLE SETTINGS
console.toggle = BackQuote, F9 ; Open/close console
console.toggle = F9 ; Open/close console
; > OVERLAY KEYS
fps.toggle = "Alt+F" ; Toggle frame counter
@@ -251,8 +267,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 = "Space" ; Focus the camera on the last notified attack
togglebirdseyeview = "" ; Toggle bird's eye view
lastattackfocus = BackQuote ; Focus the camera on the last notified attack
togglebirdseyeview = "Shift+Tab" ; 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)
@@ -268,12 +284,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+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
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
[hotkey.camera.jump]
1 = F5 ; Jump to position N
@@ -318,6 +334,12 @@ 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"
@@ -351,9 +373,27 @@ singleselection = "" ; Modifier to select units individually, opposed to per for
8 = 8, Num8
9 = 9, Num9
10 = 0, Num0
[hotkey.selection.structures]
barracks = "Ctrl+X"
stable = "Ctrl+Z"
civil_centre = "Ctrl+C"
[hotkey.gamesetup]
mapbrowser.open = "M"
[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.session]
kill = Delete, Backspace ; Destroy selected units
@@ -392,14 +432,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 = 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
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
[hotkey.session.gui]
toggle = "Alt+G" ; Toggle visibility of session GUI
@@ -477,6 +517,7 @@ defaultformation = "special/formations/box" ; For walking orders, automatically
formationwalkonly = "true" ; Formations are disabled when giving gather/attack/... orders.
howtoshownames = 0 ; Whether the specific names are show as default, as opposed to the generic names. And whether the secondary names are shown. (0 - show both; specific names primary, 1 - show both; generic names primary, 2 - show only specific names, 3 - show only generic names)
selectformationasone = "true" ; Whether to select formations as a whole by default.
techarrows = true ; Whether to show an arrow above some techs that indicates which unit they affect or unlock.
[gui.session.minimap]
; Icons that are displayed for some entities on a minimap.
@@ -516,7 +557,7 @@ extended = true ; Whether to display the chat history
[lobby]
history = 0 ; Number of past messages to display on join
room = "arena28" ; Default MUC room to join
room = "arena29" ; 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
@@ -524,8 +565,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 = "wfgbot28" ; Name of the server-side XMPP-account that manage games
echelon = "echelon28" ; Name of the server-side XMPP-account that manages ratings
xpartamupp = "wfgbot29" ; Name of the server-side XMPP-account that manage games
echelon = "echelon29" ; 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
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<objects>
<script file="gui/OpenRequest/Continuation/Script.js"/>
</objects>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<page>
<include>OpenRequest/Continuation/Object.xml</include>
</page>
@@ -0,0 +1,4 @@
async function init(arg)
{
return arg + " Continuation";
}
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<objects>
<script file="gui/OpenRequest/Entry/Script.js"/>
</objects>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<page>
<include>OpenRequest/Entry/Object.xml</include>
</page>
@@ -0,0 +1,7 @@
async function init()
{
return { [Engine.openRequest]: {
"page": "OpenRequest/Continuation/Page.xml",
"argument": "Entry"
} };
}
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<objects>
<script file="gui/OpenRequest/Root/Script.js"/>
</objects>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<page>
<include>OpenRequest/Root/Object.xml</include>
</page>
@@ -0,0 +1,13 @@
async function init()
{
const result = await Engine.OpenChildPage("OpenRequest/Entry/Page.xml");
await new Promise(closePageCallback =>
{
globalThis.closePageCallback = () =>
{
closePageCallback();
return result;
};
});
}
@@ -6,7 +6,8 @@ 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;
@@ -0,0 +1 @@
testObject.getComputedSize();
@@ -2,7 +2,7 @@ try
{
Engine.callback();
}
catch (e)
catch(e)
{
log(e.message);
}
@@ -13,7 +13,8 @@ async function waitAndIncrement(promise)
{
let resolve;
const promise = new Promise(res => {
const promise = new Promise(res =>
{
incrementTest();
resolve = res;
});
@@ -2,11 +2,13 @@ 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;
};
@@ -1,15 +1,20 @@
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;
@@ -1,6 +1,7 @@
function TestScript1_Helper() {}
TestScript1_Helper.prototype.GetX = function() {
TestScript1_Helper.prototype.GetX = function()
{
return AdditionHelper(1, 2);
};
@@ -2,11 +2,13 @@ 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;
};
@@ -15,11 +17,13 @@ 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;
};
@@ -2,11 +2,13 @@ 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;
};
@@ -2,11 +2,13 @@ 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;
};
@@ -1,4 +1,5 @@
Modding.prototype.GetX = function() {
Modding.prototype.GetX = function()
{
return this.x * 10;
};
@@ -1,14 +1,17 @@
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;
};
@@ -18,15 +21,18 @@ 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;
};
@@ -36,11 +42,13 @@ 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 });
@@ -1,6 +1,7 @@
function TestScript1_Init() {}
TestScript1_Init.prototype.Init = function() {
TestScript1_Init.prototype.Init = function()
{
var param = this.template;
// print("# ",uneval(param),"\n");
if (param)
@@ -9,7 +10,8 @@ TestScript1_Init.prototype.Init = function() {
this.x = 100;
};
TestScript1_Init.prototype.GetX = function() {
TestScript1_Init.prototype.GetX = function()
{
return this.x;
};
@@ -19,12 +21,18 @@ 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);
};
@@ -1,10 +1,12 @@
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);
};
@@ -15,11 +17,13 @@ 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;
};
@@ -1,12 +1,14 @@
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;
};
@@ -17,16 +19,21 @@ 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;
@@ -38,13 +45,15 @@ 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];
@@ -56,15 +65,18 @@ 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;
};
@@ -74,7 +86,8 @@ 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; });
};
@@ -87,17 +100,20 @@ 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;
};
@@ -1,14 +1,17 @@
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;
};
@@ -20,7 +23,8 @@ function TestScript1B() {}
TestScript1B.prototype = Object.create(TestScript1A.prototype);
TestScript1B.prototype.Init = function() {
TestScript1B.prototype.Init = function()
{
this.x = 102000;
};
@@ -30,15 +34,18 @@ 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;
};
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<material>
<required_texture name="baseTex"/>
<shader effect="dummy"/>
<shader pass="main" effect="dummy"/>
</material>
@@ -24,9 +24,23 @@
<empty/>
</element>
</optional>
<element name="shader">
<attribute name="effect"/>
</element>
<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>
<zeroOrMore>
<element name="define">
<attribute name="name"/>
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<material>
<shader effect="terrain_base"/>
<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"/>
<required_texture name="baseTex"/>
</material>
@@ -4,6 +4,9 @@
<required_texture name="baseTex"/>
<required_texture name="normTex" define="USE_NORMAL_MAP"/>
<required_texture name="specTex" define="USE_SPECULAR_MAP"/>
<shader effect="terrain_base"/>
<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"/>
<uniform name="effectSettings" value="1.0 15.0 0.0"/>
</material>
@@ -4,6 +4,9 @@
<required_texture name="baseTex"/>
<required_texture name="normTex" define="USE_NORMAL_MAP"/>
<required_texture name="specTex" define="USE_SPECULAR_MAP"/>
<shader effect="terrain_base"/>
<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"/>
<uniform name="effectSettings" value="1.2 15.0 0.0"/>
</material>
@@ -4,6 +4,9 @@
<required_texture name="baseTex"/>
<required_texture name="normTex" define="USE_NORMAL_MAP"/>
<required_texture name="specTex" define="USE_SPECULAR_MAP"/>
<shader effect="terrain_base"/>
<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"/>
<uniform name="effectSettings" value="0.8 15.0 0.0"/>
</material>
@@ -3,6 +3,9 @@
<alternative material="terrain_base.xml" quality="1"/>
<define name="USE_TRIPLANAR" value="1"/>
<required_texture name="baseTex"/>
<shader effect="terrain_base"/>
<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"/>
<uniform name="effectSettings" value="1.0 15.0 0.0"/>
</material>
@@ -5,6 +5,9 @@
<required_texture name="baseTex"/>
<required_texture name="normTex" define="USE_NORMAL_MAP"/>
<required_texture name="specTex" define="USE_SPECULAR_MAP"/>
<shader effect="terrain_base"/>
<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"/>
<uniform name="effectSettings" value="1.0 15.0 0.0"/>
</material>
@@ -41,7 +41,8 @@ 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);
@@ -70,8 +71,10 @@ 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 });
});
});
@@ -131,7 +131,7 @@
scrollbar_style="ModernScrollBar"
textcolor="white"
text_align="left"
text_valign="center"
text_valign="top"
sprite="ModernDarkBox"
sprite_overlay="ModernDarkBoxGoldBorder"
/>
@@ -23,8 +23,10 @@ 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;
+1 -1
View File
@@ -89,7 +89,7 @@
</define>
<define name="font">
<data type="string">
<param name="pattern">(mono|sans)-(bold-|italic-)?(stroke-)?[0-9]{1,3}</param>
<param name="pattern">[a-z]+-(bold-|italic-)?(stroke-)?[0-9]{1,3}</param>
</data>
</define>
<define name="size">
@@ -3,7 +3,8 @@ 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;
});
}
+26 -13
View File
@@ -27,12 +27,14 @@ 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).
@@ -44,7 +46,8 @@ var g_ModIOState = {
g_ModsAvailableOnline = Engine.ModIoGetMods();
displayMods();
},
"success": progressData => {
"success": progressData =>
{
// Successfully acquired a mod file
hideDialog();
Engine.GetGUIObjectByName("downloadButton").enabled = true;
@@ -52,20 +55,24 @@ 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"), {
@@ -80,7 +87,8 @@ 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"), {
@@ -95,7 +103,8 @@ 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"), {
@@ -110,7 +119,8 @@ 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"), {
@@ -126,7 +136,8 @@ var g_ModIOState = {
/**
* Default
*/
"none": progressData => {
"none": progressData =>
{
// Nothing has happened yet.
}
};
@@ -144,7 +155,8 @@ 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);
})
@@ -327,7 +339,8 @@ 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();
@@ -1,7 +1,8 @@
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;
});
}
+5 -6
View File
@@ -68,8 +68,12 @@ 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" }
});
});
}
@@ -292,11 +296,6 @@ function filterMod(folder)
return !negateFilter;
}
function closePage()
{
Engine.SwitchGuiPage("page_pregame.xml", {});
}
/**
* Moves an item in the list up or down.
*/
@@ -194,7 +194,6 @@
<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">
+1 -1
View File
@@ -9,6 +9,6 @@
scroll_bottom="true"
textcolor="white"
text_align="left"
text_valign="center"
text_valign="top"
/>
</styles>
@@ -5,7 +5,7 @@ const g_ModProperties = {
"type": "string",
"validate": validateName
},
// example: "0.28.0"
// example: "0.29.0"
"version": {
"required": true,
"type": "string",
@@ -1,6 +1,7 @@
function init()
async function init()
{
Engine.SwitchGuiPage("page_modmod.xml", {
"cancelbutton": false
});
return { [Engine.openRequest]: {
"page": "page_modmod.xml",
"argument": { "cancelbutton": false }
} };
}
@@ -21,7 +21,8 @@ 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);
});
@@ -40,14 +41,16 @@ 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);
};
});
@@ -62,7 +65,8 @@ 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();
@@ -80,7 +84,8 @@ function initLanguageSelection()
return list;
})();
languageDropdown.onSelectionChange = () => {
languageDropdown.onSelectionChange = () =>
{
Engine.GetGUIObjectByName("mainText").caption =
sprintf(
languageDropdown.selected == 1 ?
+10 -31
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2025 Wildfire Games.
/* Copyright (C) 2026 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -166,6 +166,7 @@ function RunDetection(settings)
// This function should have no side effects, it should just
// set these output properties:
let hardwareSupported = true;
// List of warning strings to display to the user
// in an ugly GUI dialog box
@@ -182,10 +183,8 @@ function RunDetection(settings)
var disable_shadowpcf;
var disable_allwater;
var disable_fancywater;
var enable_glsl;
var enable_postproc;
var enable_smoothlos;
var override_renderpath;
// TODO: add some mechanism for setting config values
// (overriding default.cfg, but overridden by local.cfg)
@@ -214,16 +213,6 @@ 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]/))
@@ -239,7 +228,6 @@ 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
@@ -301,25 +289,21 @@ function RunDetection(settings)
// r300 classic has problems with shader mode, so fall back to non-shader
if (os_unix && GL_RENDERER.match(/^Mesa DRI R[123]00 /))
{
override_renderpath = "fixed";
warnings.push("Some graphics features are disabled, due to bugs in old graphics drivers. Upgrading to a Gallium-based driver might help.");
hardwareSupported = false;
}
// https://www.wildfiregames.com/forum/index.php?showtopic=15058
// GF FX has poor shader performance, so fall back to non-shader
if (GL_RENDERER.match(/^GeForce FX /))
{
override_renderpath = "fixed";
disable_allwater = true;
hardwareSupported = false;
}
// 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";
hardwareSupported = false;
}
return {
@@ -331,18 +315,17 @@ 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,
"hardwareSupported": hardwareSupported,
};
}
global.RunHardwareDetection = function(settings)
{
// 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;
// Currently we don't have limitations for other backends than GL.
if (settings.renderer_backend.name != 'gl')
return true;
// print(JSON.stringify(settings, null, 1)+"\n");
@@ -385,15 +368,11 @@ 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());
if (output.enable_smoothlos !== undefined)
Engine.ConfigDB_CreateValue("hwdetect", "smoothlos", (output.enable_smoothlos).toString());
if (output.override_renderpath !== undefined)
Engine.ConfigDB_CreateValue("hwdetect", "renderpath", (output.override_renderpath).toString());
return output.hardwareSupported;
};
+3 -2
View File
@@ -14,7 +14,8 @@ 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)
@@ -29,7 +30,7 @@ for (var settings of hwdetectTestData)
var os = (settings.os_linux ? "linux" : settings.os_macosx ? "macosx" : settings.os_win ? "win" : "???");
var disabled = [];
for (var d of ["disable_audio", "disable_s3tc", "disable_shadows", "disable_shadowpcf", "disable_allwater", "disable_fancywater", "override_renderpath"])
for (var d of ["disable_audio", "disable_s3tc", "disable_shadows", "disable_shadowpcf", "disable_allwater", "disable_fancywater", "hardwareSupported"])
if (output[d] !== undefined)
disabled.push(d+"="+output[d]);
@@ -1,27 +0,0 @@
!!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
@@ -1,19 +0,0 @@
!!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
@@ -1,18 +0,0 @@
<?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>
@@ -1,13 +0,0 @@
!!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
@@ -1,25 +0,0 @@
!!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
@@ -1,16 +0,0 @@
<?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>
@@ -1,3 +0,0 @@
!!ARBfp1.0
MOV result.color, program.local[0];
END
@@ -1,12 +0,0 @@
!!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
@@ -1,13 +0,0 @@
<?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>
@@ -1,9 +0,0 @@
!!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
@@ -1,15 +0,0 @@
!!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
@@ -1,15 +0,0 @@
<?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>
@@ -1,17 +0,0 @@
!!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
@@ -1,6 +0,0 @@
!!ARBvp1.0
MOV result.position, vertex.position;
MOV result.texcoord, vertex.texcoord[0];
END
@@ -1,12 +0,0 @@
<?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>
@@ -1,23 +0,0 @@
!!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
@@ -1,32 +0,0 @@
!!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
@@ -1,17 +0,0 @@
<?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>
@@ -1,7 +0,0 @@
!!ARBfp1.0
PARAM color = program.local[0];
MOV result.color, color;
END
@@ -1,18 +0,0 @@
!!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
@@ -1,14 +0,0 @@
<?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>
@@ -1,34 +0,0 @@
!!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
@@ -1,21 +0,0 @@
!!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
@@ -1,25 +0,0 @@
<?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>
@@ -1,25 +0,0 @@
!!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
@@ -1,29 +0,0 @@
!!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
@@ -1,20 +0,0 @@
<?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>
@@ -1,14 +0,0 @@
<?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>
-27
View File
@@ -1,27 +0,0 @@
!!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
-15
View File
@@ -1,15 +0,0 @@
!!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
@@ -1,14 +0,0 @@
<?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>
@@ -1,7 +0,0 @@
!!ARBfp1.0
PARAM color = program.local[0];
MOV result.color, color;
END
@@ -1,14 +0,0 @@
!!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
@@ -1,13 +0,0 @@
<?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>
@@ -1,3 +0,0 @@
!!ARBfp1.0
MOV result.color, program.local[0];
END
@@ -1,12 +0,0 @@
!!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
@@ -1,20 +0,0 @@
!!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
@@ -1,28 +0,0 @@
<?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>
@@ -1,30 +0,0 @@
<?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>
@@ -1,101 +0,0 @@
!!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
@@ -1,74 +0,0 @@
!!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
@@ -1,29 +0,0 @@
<?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>
@@ -1,19 +0,0 @@
!!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
@@ -1,39 +0,0 @@
!!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
@@ -1,17 +0,0 @@
<?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>
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<effect>
<technique>
<require shaders="arb"/>
<require shaders="glsl"/>
<require shaders="spirv"/>
<pass shader="canvas2d">
@@ -0,0 +1,8 @@
<?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