1
0
forked from mirrors/0ad

Compare commits

...

1196 Commits

Author SHA1 Message Date
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
phosit e2ed4afe00 SoundManager: reintroduce manual memory management
This reverts commit 94c907342a.

It introduced multiple errors and is to big to find the actual errors.

Fixes: #8342
Fixes: #8426
2025-10-13 20:42:32 +02:00
Vladislav Belov 70893b6a32 Adds ARM Neon to report 2025-10-13 19:57:52 +02:00
Ralph Sennhauser dc4785ece6 Fix win64 artifact name in bundles pipeline
The extra space is part of the name and prevents the build tarball to be
excluded from archived artifacts.

Reported-By: Itms <itms@wildfiregames.com>
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-13 19:03:42 +02:00
Ralph Sennhauser aa601de72c Set owner and group when creating tar archive
tar --no-same-owner is only default for non root users, therefore if
extracting as root owner ship is by the user id creating the archive.
This is an issue if extracting happens in a container and cleanup
outside the container by a non root user like on our CI when building
the appimage. Therefore package the tar archives for fcollada and nvtt
with owner and group root.

Fixes: #8440
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-13 19:03:42 +02:00
phosit a730ab65a3 RecomputeActorName when required
533429e800 relied on a later `RecomputeActorName` which was removed in
the same commit.

Fixes: #7590
2025-10-13 18:15:06 +02:00
Hector Gomez 3142b7cbaa Change expert Kushite cavalry spearman model when gathering meat
Kushite expert cavalry spearman uses advanced cavalry spearman rider mo
del when gathering meat.

This commit changes so its expert counterpart is used instead of advanc
ed and art looks consistent.

Fixes #7649
2025-10-13 17:34:21 +02:00
Vladislav Belov c99345a24b Adds MapReader to cppcheck ignore. 2025-10-13 16:57:15 +02:00
Vladislav Belov fb94cc704f Makes loading terrain textures more smooth 2025-10-13 00:14:45 +02:00
Vladislav Belov fb98f5059a Refactors TerrainTextureManager 2025-10-13 00:14:43 +02:00
Vladislav Belov 5bbb2c0b76 Makes parsing entities more smooth 2025-10-13 00:14:29 +02:00
Vantha 7dab8d3f02 Erase the lamdba from the Germanic big hall icon
The great hall of the Germans used the icon of the syssition, which contains
the Spartan civ emblem, which in turn contains a red Greek uppercase
lambda (Λ) for "Lacedaemon". This is obviously incorrect to use for the Germans.
So this patch instead creates a new, generic hall icon for the great
hall out of the syssition icon by just removing the lambda from it. That
way they remain similar and players can recognise them both as
halls and champion-training structures.
2025-10-12 21:36:04 +02:00
phosit a0e4c61565 Don't list removed player when loading a savegame
Removing all entities when loading a game isn't implemented. So the
setting should not be selectable: #8413.
It seems this was tried in b36782388b. But it removed the ai-item
instead of the removed-player-item. That lead to an additional error:
#8425.

Fixes: #8413
Fixes: #8425
2025-10-12 14:25:53 +02:00
elexis 2ccd10e566 Fix missing returns after disconnect in 95179c5e46.
Patch by @elexis.

The package sent in fa85527baf / #2420 plus this missing return causes the NetServerTurnManager
to be stalled forever if a client succeeds to send this package on disconnect.

In NotifyFinishedClientCommands, Disconnect calls OnDisconnect calls UninitialiseClient calls m_ClientsData.erase,
but then m_ClientsData[client].readyTurn = turn; reinserts the disconnected client, making the turnmanager wait forever for the disconnected client.

refs https://wildfiregames.com/forum/topic/134742-bug-game-incredibly-slowfreeze-at-start-because-because-of-1-player/
2025-10-12 12:39:41 +02:00
Vladislav Belov 893f192eaa Makes TextRenderer allocates using LinearAllocator
Also replaces DynamicArena for model and terrain rendering by
LinearAllocator.
2025-10-12 00:53:12 +02:00
Vladislav Belov e4de94415e Removes unused pointer from the allocate function
Also allows to compare ProxyAllocator. For example, it might be
required for containers to compare iterators.
2025-10-12 00:53:10 +02:00
Vladislav Belov 53ff6f0d50 Adds LinearAllocator for faster allocations.
LinearAllocator (also known as bump allocator) allows to reuse the
same memory across the frame for short lifetime allocations.
2025-10-12 00:53:08 +02:00
Itms 29922d254b Fix libicu build for Windows amd64 2025-10-12 00:48:33 +02:00
Itms acf0ccc8dc Create a 64-bit Windows installer in bundles 2025-10-12 00:48:33 +02:00
Itms 78eba9f8c7 Patch win32 binaries as part of bundling 2025-10-12 00:48:33 +02:00
Itms 5826074374 Split building Unix tarballs and Win installer 2025-10-12 00:48:33 +02:00
Vladislav Belov bedb6129f2 Reduces string allocations in GUI and maths. 2025-10-11 19:44:22 +02:00
Ralph Sennhauser 4bf107352f Fix building spidermonkey with python 3.14
Fixes: #8427
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-11 15:47:45 +02:00
Ralph Sennhauser 39ea3b6ea5 Use custom runner for tests
The --libdir switch got lost at some point, which is useful for running
tests with a system build.

Further allow to switch the type of output at runtime avoiding an
unnecessary rebuild.

Finally allow to specify an output file, this means there is no need to
redirect stdout which might break the CI in case the tests write
something to stdout like in case of LOGERROR resulting the test result
not being valid xml.

Ref: #7534
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-11 11:34:38 +02:00
Vantha 48d8238354 Reset 'removed' flag before autoassigning players
Fixes #8396
2025-10-11 09:49:26 +02:00
Vladislav Belov 3ffb5ec5a0 Removes USE_FOG define and switches to a shader parameter.
Refs #8385
2025-10-11 08:11:35 +02:00
real_tabasco_sauce fbc324d97d fix athen marines selection of dock and regular variants
fixes #8128
2025-10-11 06:40:43 +02:00
phosit 81e6e78dac Use the isSavedGame member variable
The `isSavedGame` attribute has been introduced in ea12766834. The
variable has been turned in a member variable in 3a6540110b this
occurrence was missed when rebasing.

Fixes: #8417
2025-10-08 19:34:15 +02:00
real_tabasco_sauce fd1b7c046c nerf infantry champs and adjust seer and teutobod auras 2025-10-08 17:04:26 +02:00
real_tabasco_sauce c43aa1d609 fix debug build by directly setting probability for the inverse binomial in Decay.cpp 2025-10-08 17:00:09 +02:00
Vladislav Belov 8f4aa8ddbd Adds a script to modify rules and tests to it. 2025-10-08 13:56:48 +02:00
Ralph Sennhauser 0baafb5375 Don't set animation for production with UnitAi
Entities with a production queue when queueing or unqueueing items for
will set an appropriate animation which is desired for structures, like
the forge producing smoke, but not so for units as it interferes with
UnitAi animation state.

Units don't have animations for training or researching so the idle
animation will be set in that case instead. If such a unit is in motion
this results in the unit gliding. To avoid this just skip setting an
animation for entities having a UnitAI.

Reported-by: wowgetoffyourcellphone
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-07 19:25:21 +02:00
Ralph Sennhauser ef007b9e5a Fix gliding healers when group attack order
In case a healer is currently healing and is part of a selection ordered
to attack the healer gets moved along but the fsm state isn't changed
which leads to healer healing while gliding to the target.

Introduce a WalkToTargetRange function which does transition state in
addition by issuing an order instead.

Fixes: #6134
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-07 19:25:21 +02:00
phosit 3a6540110b Don't save matchsettings when loading a savegame
When loading a savegame more settings are loaded then normally. Thous
settings (such as TriggerScripts) can't be changed from the
matchsetting-screen.
With this commit the saved matchsettings.mp.json isn't overritten when
loading a savegame.

Fixes: #7632
2025-10-07 19:08:25 +02:00
phosit ea12766834 Don't filter when a saved game is loading
Filtering the maps sometimes changes the selection. Also it's not
required to filter the maps as the setting is already selected and
frozen.
This reuses the code which is used by campains since there the map might
also be frozen.

Fixes: #7682
2025-10-07 19:07:20 +02:00
wowgetoffyourcellphone 3ae3c7ad3b Attempt to fix the Han Great Tower max arrows bug
Tis a minor bug, but worth fixing.
2025-10-07 05:29:35 +02:00
Ralph Sennhauser 788708ed8c Add AppImage support
Add a Dockerfile having all needed tooling. Using a container also means
those are the libs that will end up being used in the AppImage.

Then add a script for building pyrogenesis either form git or from
extracted source tarballs and for assembling the AppImage and finally
creating the AppImage.

Add building the AppImage to the "bundles" pipeline.

Also add a wrapper script to use podman to drive the whole process
for convenience for local builds.

Ref: #7577
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-05 20:35:43 +02:00
Vladislav Belov 199f4cb666 Fixes uninitialized water textures.
Fixes #8052
2025-10-05 14:13:49 +02:00
Vladislav Belov e1d5e92c2a Restores minimap entities size and adds options.
Restores minimap entities size to size they have in A25.
Adds minimap options.

Fixes #6782.
2025-10-05 12:04:21 +02:00
real_tabasco_sauce 3dfd4b0d3e Differentiate cataphract as a stronger, but much slower unit, nerf the HP bonus technology. 2025-10-05 04:26:47 +02:00
real_tabasco_sauce 12be6a0e59 reduce melee champ cav HP from 300 to 260 2025-10-05 04:26:47 +02:00
real_tabasco_sauce 4ba618563c Add civ bonuses for Carth and differentiate embassies and their mercenaries. 2025-10-05 03:55:58 +02:00
real_tabasco_sauce 22ed1fcdef let athens civilians build their unique buildings
Fixes #8393
2025-10-05 03:01:02 +02:00
Vladislav Belov e63c80c613 Reduces string allocations in paths. 2025-10-05 01:31:27 +02:00
Ralph Sennhauser d22d8776e6 Fix layouting of texture preview in atlas
Commit fe192fe58f added one extra level,
so we have to layout the parent of the parent now to actually layout the
sidebar.

Fixes: #8388
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-01 14:40:30 +02:00
Kate 1e3f849816 Increase aura range for Kushite buildings
Temple of Amun's healing range increases from 40m to 70m.

Large Pyramid's aura range is increased to 100m.
2025-09-29 21:52:22 +02:00
phosit 2a25ef11b8 Import getHolder in startingStrategy.js
This was forgotten in 4da78788c8. The error only occurs when a PetraAI
wins.
2025-09-29 19:25:25 +02:00
Vladislav Belov 13b988cecb Removes shader effect duplications. 2025-09-29 12:04:53 +02:00
Vladislav Belov 275f6631c4 Allows to use the same technique for multiple shaders. 2025-09-29 12:04:42 +02:00
Vantha f65e839ac5 Add a new button style: 'BrownButton'
Each sprite is comprised of dynamically scaled 9 slices stored in a designated directory.
Base, over, pressed, and disabled variants are combined into a button style called
'BrownButton'.

The sprites have a native/maximum total resolution of 266 x 74 pixels.
(which is larger than any other button sprites)

Brightness of the base sprite is kept neutral so that it fits on both
light and dark backgrounds.

Disable compression and mipmapping as they don't work well with sliced
sprites.
2025-09-28 22:59:27 +02:00
real_tabasco_sauce 18ef4b6a1a Let units attacking low preference units without direction check for high preference units
-During each attack on a low preference target unless player-directed, update the range query and find a new target.
-Adjust behavior for elephants to work better versus infantry.
fixes #1488
2025-09-28 21:28:30 +02:00
real_tabasco_sauce 3b0bf7fe75 let legionary bonuses from centurion apply to first cohort champs 2025-09-28 20:18:40 +02:00
real_tabasco_sauce 1b0af6902e rework Han ministers 2025-09-28 19:43:24 +02:00
real_tabasco_sauce 0046de8840 differentiate maury maiden units into unique units 2025-09-28 19:39:03 +02:00
real_tabasco_sauce e5de43ef47 increase longsword splash damage while decreasing direct damage. Increase splash range. 2025-09-28 19:38:27 +02:00
real_tabasco_sauce f3ee09f196 buff elephants by adding a pierce armor and slightly increasing splash range 2025-09-28 19:38:27 +02:00
real_tabasco_sauce 7e10d50c0d increase default building capture regen 2025-09-28 19:36:52 +02:00
real_tabasco_sauce 8a9a180a50 add a capture attack of 1 for civilian units 2025-09-28 19:36:52 +02:00
real_tabasco_sauce 865b587b9a buff fort accuracy to improve lethality at longer ranges. 2025-09-28 19:26:37 +02:00
elexis 1f58836cf1 Fix NetServerTurnManager hanging if a client passed handshake but not authentication on gamestart.
Fixes #5201.
2025-09-27 10:02:46 +02:00
phosit 27b5368f1b Iterate once to search texture to convert
Use `std::ranges::max` so that only one iteration is needed to find the
texture of highest priority.

Using `std::ranges::max` with an empty range is undefined behavior. So
there has to be a special case.
2025-09-25 20:42:50 +02:00
real_tabasco_sauce 51767f3888 Optimize corpse decay parameters for faster clearance of corpses
Increase corpse acceleration so corpses spend less time below ground
Decrease decay delay and decay rate to improve percieved smoothness
Fixes #7548
2025-09-23 17:11:12 +02:00
real_tabasco_sauce f8e0a78d6d Add a random chance for a decay sinking event to occur.
Adds a 1/125 chance for a corpse to undergo a decay movement in a given frame.
This allows a probability passed from the template to determine the sinking behavior of the entity.
Fixes #7548
2025-09-23 17:11:12 +02:00
wowgetoffyourcellphone 90505c29ee Fix Roman aux cavalry attack animation
Fixes #8296
2025-09-20 21:00:49 +02:00
phosit 2098bf726a Seperate continue and onTick promises
Confirmation that the connection should start can't occour at the same
time then message exchange.
Rewriting it makes it easier to read.
2025-09-20 10:04:25 +02:00
phosit ec15ca6fee Split waitOnEvent from init in gamesetup_mp 2025-09-20 10:04:25 +02:00
phosit 0eca28f6b4 Common path of password and passwordless option
When no password was entered, it didn't stant to connect. So
`cancelSetup` isn't required.
2025-09-20 10:04:25 +02:00
Vladislav Belov 9884317d33 Fixes non-PCH builds after e8a5103f8c. 2025-09-18 13:26:20 +02:00
Ralph Sennhauser 59cb3cd67b Bump premake to 5.0.0-beta7
Fixes: #8362
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-09-18 12:06:29 +02:00
Itms 2386eb00a1 Update code owners 2025-09-18 08:56:46 +02:00
Itms fdbe3e17e6 Provide sha256 checksums for bundles 2025-09-18 08:51:14 +02:00
Vladislav Belov e8a5103f8c Fixes #8057 by properly initializing atlas texture.
Fixes #8057
Fixes #8184
Fixes #8345
2025-09-17 14:31:16 +02:00
Vladislav Belov 3eca24ed11 Fixes CC for fonts. 2025-09-17 12:32:12 +02:00
Vladislav Belov e2d9450d0d Revert "Font: make atlas uploads queue-aware on Vulkan"
This reverts commit 256dff7fd4.
2025-09-17 12:32:08 +02:00
wowgetoffyourcellphone 5be2d7d9ed Naval Redux 2.1
Naval Redux 2.1

1 Greatly streamline the tech tree after some criticism it was too lengthy.
2 Move Scout ship to Village Phase
3 Tweak some ship costs
4 Implement some ideas from @Real_T_S
5 Acquiesce to all of @Real's demands
2025-09-17 05:48:38 +02:00
Vantha 2fd624260f Remove some invalid GetGUIObjectByName calls
Their return values (undefined) were unused since 2cccd9825d, which is why they
didn't break anything. But due to the latest GetGUIObjectByName API
changes, they triggered some errors. They can be fully removed safely
now.

Fixes #8340
2025-09-16 08:52:11 +02:00
Jonny McCullagh b4ad152df3 escape opening square bracket in quotes.txt 2025-09-15 22:59:54 +02:00
trompetin17 4ef2bb77f2 Add ToJSVAL overload template for array of uknown bound
this commit fix and error in HWDetect when the libraries versions use
only MAJOR.MINOR like zlib in some linux os that is "1.3" that need
char[4] (1.3\0) conversion from Script::ToJSVal.

this commit create an overload template that matches "references  to
array of uknown bound" and forward it to existing const char* / const
wchar_t* specializations.

this bug was reported by Vantha.
2025-09-14 08:46:21 -05:00
Itms 9150c20818 Remove ScriptTypes and ScriptExtraHeaders headers
The first header was used to include the SpiderMonkey JS API at once,
with safeguards and preprocessor defines. Nowadays, SpiderMonkey
provides modular headers allowing us to include what we use, refs #8086.

Some defines have to be moved to compiler options but it is apparently
a mistake from the SM developers:
https://bugzilla.mozilla.org/show_bug.cgi?id=1987876
2025-09-14 13:17:18 +02:00
Itms c4762e22cc Remove obsolete signbit GCC workaround
Reviewed-At: https://gitea.wildfiregames.com/0ad/0ad/pulls/8324
2025-09-14 13:17:05 +02:00
Itms 7b1d2fcb51 Remove obsolete GC defines, removed in ESR 38
https://bugzilla.mozilla.org/show_bug.cgi?id=914402
https://bugzilla.mozilla.org/show_bug.cgi?id=1107349

Reviewed-At: https://gitea.wildfiregames.com/0ad/0ad/pulls/8324
2025-09-14 13:16:45 +02:00
wowgetoffyourcellphone 3413969b4c 3 new/updated structure portraits 2025-09-13 20:07:50 +02:00
trompetin17 423ba82837 Fix text right alignment with GUI Scale
Now that size uses float when emulating positioning, it was getting a
different value, like 0.008. This commit fixed that issue by using
std::floor to remove small noise.

Symmetrical for LEFT with std::ceil.
2025-09-13 10:01:51 -05:00
trompetin17 93f4c5cf22 Fix resizing GUI object to use ceiling values for width and height
The size is now float number, because of this code calculates the
required size, we should always ceiling the value to the next int to
remove any error or unwanted behavior in images or subpixel
calculations.
2025-09-13 09:58:27 -05:00
trompetin17 7027655864 Fix clipping logic in PutString to properly handle vertical boundaries
This commit enable "contains" or "intersects" to be visible instead of
hide.
2025-09-13 09:58:27 -05:00
trompetin17 b5e2ca7300 Fix GUI text clipping when scaling interface
When scaling the GUI, GetCapHeight was incorrectly accounting for
m_Scale which caused text to be hidden due to improper clipping
calculations.
This commit corrects the CapHeight calculation by ensuring that the
division by m_Scale is applied, allowing text to be displayed correctly
at all GUI scale levels.
2025-09-13 09:58:09 -05:00
Jonny McCullagh 5d8debe676 Add more tips 2025-09-13 15:18:30 +02:00
Itms 7c51013ef0 Remove incorrect default for autostart-players
When not provided, the number of players on autostart was set to 2,
which is incorrect for skirmishes and scenarios. This commit makes this
parameter ignored for non-random maps, as well as the other parameters
specific to random maps.

Furthermore, 2 is already set as a default number of players for random
maps (in the `PlayerCount` gamesettings attribute), setting it in
autostart code is redundant.

Fixes #8325
Refs #7269
2025-09-10 10:34:45 +02:00
Vantha a5b5331fa4 Fix chat line button sizing
The issue was that the rright value was 100%.
That's why the buttons would always extend across the full width of the
screen.
Replacing the value right in the XML would result in an invalid size, so
we can remove it from there and create a full, separate size in the code
each time (Object.assign just edits it), since the top and bottom values
specified in the XML were overwritten anyway.
And since the left margin of 3 is fixed, we better move it to the parent
object to avoid a constant like that in the code.

Fixes #8322
2025-09-10 08:55:02 +02:00
real_tabasco_sauce eac96dbcbd Add Germans Civilization 2025-09-08 22:20:13 +02:00
Itms 24b47b0e3a Fix strategic campaign city templates
The gendered civilian change made this unit native to its civil center,
but inherited templates in the proof-of-concept strategic map were not
adapted.

Fixes #8337
2025-09-08 17:24:20 +02:00
phosit 760ad169fe Steadily increase strongholds size with team size
`groupedDistance` is the "distance between neighboring players" but it
was used as the radius.
Then there was a special case when the team size is big and the
`groupedDistance` was to small.

With this commit the `groupedDistance` is actually used as
"distance between neighboring players" and removes the special casing.
2025-09-07 16:29:17 +02:00
phosit 94a0dde58a Equalize space between stronghold
Change the stronghold placement.
Preqiously the angle between the center of the strongholds where equal.
Now the distance between strongholds is equal.

This is done so that big teams have more space.
2025-09-07 16:29:17 +02:00
real_tabasco_sauce 89f4fc7e99 correct civilian train time after #8062 2025-09-06 11:31:39 -07:00
Ralph Sennhauser f44855126e Fix scrolling with GTK/QT wxWidgets backends
wxWidgets can use X11 APIs or the GUI toolkits GTK or QT on Linux, with
pure Wayland only the option to use the toolkits remains for
wxGetKeyState().

wxGetKeyState() is only usable for modifier keys with either toolkit and
so we need to bookkeep ourself.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-09-06 17:59:32 +02:00
obelix c963711667 Fix the tooltip of Giant maps
Tooltips for map sizes were introduced in 8cfd494b88 when 'Giant' 
received the same sentence as 'Very Large'.

This commit fixes the tooltip for Giant Maps by giving them a proper 
sentence, which might avoid confusion.
2025-09-06 14:43:49 +02:00
Ralph Sennhauser 4136b2f6f7 Clone InitAttributes for serialization test
Commit 8b11f6a151 requires InitAttributes to be available, which isn't
the case for the secondary context in serialization test. So clone
InitAttributes to make it available.

```
ERROR: JavaScript error: simulation/helpers/Commands.js line 89
InitAttributes is not defined
  reveal-map@simulation/helpers/Commands.js:89:7
  ProcessCommand@simulation/helpers/Commands.js:932:23
ERROR: Failed to call ProcessCommand() global script function
```

Reported-by: phosit <phosit@autistici.org>
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-09-06 13:13:25 +02:00
wowgetoffyourcellphone 3592814aa8 Gendered Civilians
Adds a randomly male and female Civilian unit which replaces the old "Female Citizen" for each civ.
New actors, new portraits, some new body textures, but the same stats as the old Female Citizen.
Updates maps, technologies, skirmish templates, et al. including the Tutorials.

Co-Authored By: Itms
Reviewed By: Vantha
2025-09-02 10:23:44 +02:00
wowgetoffyourcellphone 18818fd31c Create 24x24 obstructors for #8304
@phosit
2025-08-30 00:40:02 -04:00
phosit d85eef067b Make TaskManager independent of Future
`TaskManager` and `Future` where coupled together. When a task is pushed
a future is returned. Also the `Future::Wrap` function was inconvenient
to use.
Now `TaskManager::PushTask` doesn't return a `Future` anymore. This
alows to use different `Future`-like types.
Also it's possible to easily use the `Future` with a different type that
implements a `PushTask` function.
2025-08-28 20:01:39 +02:00
phosit 8abe9f6cea Rename warn to aiWarn in utils.js
There is a call to `warn` in this function. That caused infinite
recursion.
Everywhere the function is imported it's aliased as `aiWarn`. So just
export it with that name and remove the aliasing.

Introduced in: #8255
2025-08-25 21:44:32 +02:00
elexis 8b11f6a151 Delete redundant per player CheatsEnable property
We do not see benefit in enabling cheats for certain players but not for the rest.
The AI cheats irrespective of the CheatsEnable property.

This patch uses InitAttributes to check if cheats are enabled making it
slightly harder to workaround it from js.

See SetLosRevealAll in CCmpAIManager and PETRA.Config.prototype.Cheat.

refs 996a32125c / #879 (AI reveal los);
refs 202a02568b /  #1555 (cheat codes, cheatsEnable for AI);
refs 25293ce0cc  (AIDiff GatherRateMultiplier),
refs f6e0c4c5a4  / #2019 (no more cheatsEnable for AI),
refs 3246b02cda  (SetTradeRateMultiplier)
refs de72510c60  / #6302 (move from InitGame.js to petra/config.js)
2025-08-25 20:41:31 +02:00
trompetin17 94c907342a SoundManager: Replace manual memory with unorderedmap
Remove manual memory management throughout the SoundManager subsystem
in favor of unorderedmap.

Key changes:
- Eliminate manual new/delete calls and potential memory leaks
- Update all sound item classes to use SoundManager factory
- Modernize resource management in OggData and related components
- Ensure exception-safe memory handling across the audio pipeline

This refactoring improves code maintainability, reduces crash risk from
memory errors, and aligns with modern C++ best practices.
2025-08-25 09:45:14 -05:00
Ralph Sennhauser fe192fe58f Make wxStaticBox' content children
As per the docs[1]: Note that since wxWidgets 2.9.1 you are strongly
encouraged to create the windows which are added to wxStaticBoxSizer as
children of wxStaticBox itself.

wxWigets 3.3 added a warning to that end.

[1] https://docs.wxwidgets.org/3.2/classwx_static_box_sizer.html

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-24 18:27:30 +02:00
phosit ac25071a2e Fix typo in "Headquaters" introduced in 4da78788c8
There is another usage which was wrongly spelled. It was spelled
differently so it wasn't found in 835f59a604.

Fixes: #8291
2025-08-24 16:28:56 +02:00
Ralph Sennhauser ceb491c599 Make cppcheck happy wrt std::span usage
We don't gain anything using a span here, so just don't.

```
source/graphics/Font.cpp:535:35: error: Out of bounds access in 'tempDstRow[3]', if 'tempDstRow' size is 2 and '3' is 3 [containerOutOfBounds]
   const float dstAlpha{tempDstRow[3] / 255.0f};
                                  ^
source/graphics/Font.cpp:543:14: error: Out of bounds access in 'tempDstRow[2]', if 'tempDstRow' size is 2 and '2' is 2 [containerOutOfBounds]
   tempDstRow[2] = static_cast<u8>(std::round(((b * srcAlpha + tempDstRow[2] * dstAlpha * (1.0f - srcAlpha)) / outAlpha)));
             ^
source/graphics/Font.cpp:544:14: error: Out of bounds access in 'tempDstRow[3]', if 'tempDstRow' size is 2 and '3' is 3 [containerOutOfBounds]
   tempDstRow[3] = static_cast<u8>(std::round(outAlpha * 255.0f));
             ^
```

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-24 11:09:57 +02:00
Ralph Sennhauser 77e05ca26d Convert span with dynamic extent to static extent
In some places we know the size at compile time, so use that knowlage.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-24 11:09:57 +02:00
Ralph Sennhauser 2cedb48de2 Remove custom span and use std::span
With C++20 the custom container PS:span, which was a backport of
std::span is no longer needed.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-24 11:09:57 +02:00
Ralph Sennhauser 2daa5385a8 Remove obsolete warning suppression
This was needed for old Visualstudio and is no longer needed with
VS2022.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-24 11:09:57 +02:00
Vantha 83f4d8789b Lift window width constraint of .getPreferredTextSize
The method's point is to calculate a text's height and width if it was written
in a single line -- no matter how long the caption, even if it's wider
than the window.
2025-08-24 11:03:34 +02:00
phosit 835f59a604 Fix typo in "Headquaters" introduced in 4da78788c8
Fixes: #8291
2025-08-24 07:32:24 +02:00
elexis 2413d13483 Place bigger placeblock on survival of the fittest
This reverts 50b76acdd5 As it places to many entities on giant maps
2025-08-23 20:08:37 +02:00
Dunedan f43f4ae1b1 Update the pre-commit hooks
With v3.12.0 shfmt changed the behavior of the `--simplify` option to
ignore any EditorConfig when it's provided. Therefore, this option is
now moved to the EditorConfig as suggested by the shfmt author. See
https://github.com/mvdan/sh/issues/1173 for details.
2025-08-22 13:04:38 +02:00
Vantha 4dace890cf Fix some 'Failed to get GUI object by name' errors
Fixes #8297
2025-08-22 10:50:28 +02:00
Ralph Sennhauser e22c5bd05e Fix some includes in atlas
Make include-what-you-use happy with some files in source/tools/atlas
and fix what needs to be fixed.

Update premake script to include missing deps and drop various extra
paths for simplification.

Don't always include wx/wx.h via precompiled.h in case PCH is disabled.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-21 14:18:38 +02:00
Itms 7fde47e1f3 Fix linker invocation on macOS Sequoia 2025-08-15 19:43:36 +02:00
Itms 758229558e Fix segfault during GUI GC 2025-08-15 19:43:36 +02:00
Itms 7038d87454 Update SpiderMonkey to ESR 128.13
Fixes #7662
2025-08-15 19:43:34 +02:00
Itms 733297a038 Fix use of pkg-config when building SM on macOS 2025-08-15 11:32:33 +02:00
trompetin17 ecfa5be686 Fix undefined difficulty reference in config.js
Fix ERROR: JavaScript error where 'difficulty' is not defined on line
247 of config.js.

The bug was introduced in commit 062be89694 where two issues occurred:

this.difficulty was incorrectly set to the entire difficultyLevel module
instead of the difficulty parameter value.
Later comparisons used undefined difficulty variable instead of the
imported difficultyLevel module
2025-08-15 01:39:39 -05:00
Ralph Sennhauser 5b5f678e3f Fix some includes all over the place
Make include-what-you-use happy with some files in source and fix what
needs to be fixed.

Add markers to precompiled.h header includes to avoid
include-what-you-use wanting them to be removed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-14 20:15:30 +02:00
Vincent Cheng 390a2f473e Fix nvtt build failure on Debian i386 2025-08-14 20:14:21 +02:00
Vantha 2026a5fece Clean up Engine.GetGUIObjectByName calls
GetGUIObjectByName was previously made stricter, logging an
error if it doesn't find the target object.
This commit deals with the resulting error-causing (invalid) calls,
by deleting them if they're unnecessary or converting them to the new
TryGetGUIObjectByName (which doesn't log any errors).
2025-08-14 10:22:56 +02:00
Vantha 6515c3fb1f Show an error when Engine.GetGUIObjectByName fails
It previously failed silently and just returned undefined which would often
only cause errors later on. Printing an error as soon as that happens helps
with debugging, by directly catching typos, for example.

For cases where the queried object may not exist, a new Engine function
called TryGetGUIObjectByName is introduced. It doesn't log any errors
and behaves exactly as GetGUIObjectByName used to.
2025-08-14 10:22:56 +02:00
Ralph Sennhauser 3647921bed Fix some includes all over the place
Make include-what-you-use happy with some files in source and fix what
needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-13 19:38:21 +02:00
Ralph Sennhauser 827116cd35 Fix issues pointed out by cppcheck
For the memleak warning actually wx will free it for us, so just
suppress the warning.

```
source/soundmanager/data/SoundData.cpp:48:29: error: Iterators of different containers 'CSoundData::sSoundData' and 'sSoundData' are used together. [mismatchingContainers]
  if ((itemFind = CSoundData::sSoundData.find( theData->GetFileName().string() )) != sSoundData.end())
                            ^
source/soundmanager/data/SoundData.cpp:62:28: error: Iterators of different containers 'CSoundData::sSoundData' and 'sSoundData' are used together. [mismatchingContainers]
 if ((itemFind = CSoundData::sSoundData.find(itemPath.string())) != sSoundData.end())
                           ^
source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Terrain/Terrain.cpp:145:3: error: Memory leak: buf [memleak]
  }
  ^
```

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-13 17:09:36 +02:00
phosit 062be89694 Move enums to own files in ai
This way they don't accidentally get mutated.
2025-08-13 14:04:16 +02:00
phosit 0a2bd6a5a4 Use proper js-modules for ai common-api
The common-api already used a coding pattern which was called modules.
That is replaced with native js-modules.

Refs: #8081
2025-08-13 14:04:16 +02:00
phosit 4da78788c8 Use proper js-modules for petra
Petra already used a coding pattern which was called modules. That is
replaced with native js-modules.

Refs: #8081
Fixes: #1024
2025-08-13 14:04:16 +02:00
Ralph Sennhauser 0368a1b391 Make requirements sufficient in StunClient
While std::is_pod is required it is not sufficient so use
std::is_integral as condition which is.

Further replace the static_assert with a requires and use the new endian
support to avoid use preprocessor.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-12 20:45:16 +02:00
Ralph Sennhauser 65d0561d70 Switch to using C++20
Obviously for shiny new features.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-12 20:45:16 +02:00
Ralph Sennhauser c4848dbe9c Require wxWidgets 3.2
wxWigets 3.0 does stuff that is deprecated in C++20, namely bitwise
operation between different enumeration types. wxWidgets 3.2 has
widespread support and in fact 3.3 was release recently so 3.4 won't be
that far off anymore either. Requiring 3.2 will allow us to do several
cleanups.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-12 20:45:16 +02:00
Ralph Sennhauser 9381ea50df Suppress warnings on old GCC
Current GCC doesn't warn here, so add -Wno-stringop-overflow,
-Wno-attribute-warning, -Wno-restrict and -Wno-array-bounds to the list
of warnings for old GCC.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-12 20:45:16 +02:00
Ralph Sennhauser c12d52b8c3 Define __PRETTY_FUNCTION__ for Windows
mozilla/LinkedList.h uses __PRETTY_FUNCTION__ in debug builds, even when
using MSVC, so just define it to allow building with C++20.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-12 20:45:15 +02:00
Ralph Sennhauser af3f7acfe7 Explicitly const_cast string literal for C API
The implicit conversion form sting literal to char* for C compatibility
was removed with C++11, seems MSVC caught up with this in C++20.

Use explicit cast instead where needed and change API to const char*
otherwise.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-12 20:45:15 +02:00
Ralph Sennhauser 6ed56954ab Add missing const in ModuleLoader
Add the required const to operator == and != as required and warned
about with C++20.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-12 20:45:15 +02:00
Ralph Sennhauser 58f697f227 Don't define main as extern "C"
Was done for Android support but the cleanup didn't revert to the
original version and at least clang-20 warns -Wmain

Ref: f4625e69af
Ref: 20d23eb340
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-12 20:45:15 +02:00
Ralph Sennhauser f8a2d5ddaa Silence mongoose warnings
C++20 removed a sizable portion of valid places to use volatile
specifier. As mongoose is on the way out just add the warning to the
list of suppressed warnings. Further add a warning already suppressed
when using GCC to the list of suppressed warnings with Clang.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-12 20:45:15 +02:00
Ralph Sennhauser 27caf4b87d Add mising const in Ogre
Add the required const to operator == as required and warned about
with C++20.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-12 20:45:15 +02:00
Ralph Sennhauser 4a14e382d5 Replace deprecated std::is_pod
std::is_pod is deprecated in C++20 and as such triggers
-Wdeprecated-declarations when built with C++20, "is_standard_layout &&
is_trivial" is the equivalent, so migrate to that.

While at it replace runtime dispatch with compile time and reduce the
required trait for memcpy to what is really needed.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-12 20:45:15 +02:00
Ralph Sennhauser d6b0198bab Fix some includes in atlas
Make include-what-you-use happy with some files in source/tools/atlas
and fix what needs to be fixed.

Define ATLASDLLIMPEXP in a regular header instead of a PCH header and
dedupe its definition.

wxWidgets uses WX_ATTRIBUTE_PRINTF this days, so remove the workaround
for ATTRIBUTE_PRINTF.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-12 19:52:40 +02:00
Itms cea708ac91 Cleanup of IGUIObject classes
- Explicitly delete move constructor and move assignment operator to
  avoid risk of memory leaks
- Remove unused class and typo
- Use same invocation of ScriptInterface as elsewhere
2025-08-11 18:38:01 +02:00
Itms 74bbdca25f Remove default dtors of IGUIObject derived classes 2025-08-11 18:38:01 +02:00
Stan 6a8366b99a Add more libraries to the report 2025-08-11 14:00:14 +02:00
Itms 2fc12e9fe9 Remove obsolete comment, closes #5128
The wish I expressed there was fulfilled in D3210 / 0406c4dfde
2025-08-10 23:32:07 +02:00
real_tabasco_sauce 55c17a905d Use footprint for fish selection box
The addition of seagulls made fish selection boxes large, leading to clumbsiness when trying to select fish. Using the footprint for the selection box makes for a more intuitive selection.
2025-08-10 13:00:51 +02:00
Ralph Sennhauser 45afefa961 Rename wcsnlen and strnlen to C11 names
Those functions were added to the C11 standard as an extension under the
name wcsnlen_s and strnlen_s. Also supported under that name in Windows.

Renaming avoids a possible name conflict with the posix functions of the
same name. Further this new name follows the pattern of names of the
other "secure" functions.

Fixes: #8274
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-10 07:33:00 +02:00
Ralph Sennhauser fbc74482db Fix some includes in atlas
Make include-what-you-use happy with some files in source/tools/atlas
and fix what needs to be fixed.

Drop the wxWidgets specific handling of precompiled headers in some
places, it isn't consistently used which it would have to to have meaning
and was mostly for early VS implementation of precompiled headers and a
lot of time has gone by since.

Drop Borland C++ compiler specific quirk, that compiler was
discontinued long ago and doesn't support modern C++.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-09 18:28:46 +02:00
Stan 0dc9477109 Fix missing this call
Reported by: @trompetin17
Pull Request: #8265
Fixes: e35fce8524
2025-08-09 16:32:09 +02:00
Ralph Sennhauser 73ca3d303b Fix some includes in atlas
Make include-what-you-use happy with some files in source/tools/atlas
and fix what needs to be fixed.

Add "source" to include path for AtlasUI target to allow for absolute
includes. In the future all but one should be removed.

Drop check for at least boost 1.40.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-09 06:52:41 +02:00
Ralph Sennhauser cc7a165365 Fix includes in source/simulation2
Make include-what-you-use happy with some files in source/simulatation2
and fix what needs to be fixed.

source/simulation2/system/ComponentTest.h uses cxxtest, so add cxxtest
to the deps for simulation2 target.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-08 07:10:11 +02:00
Ralph Sennhauser 2bad15b4c2 Fix includes in source/simulation2
Make include-what-you-use happy with some files in source/simulation2
and fix what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-07 20:00:49 +02:00
Ralph Sennhauser b066bb0b99 Fix includes in source/scriptinterface
Make include-what-you-use happy with files in source/scriptinterface and
fix what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-07 11:45:19 +02:00
Ralph Sennhauser 32fd10691d Fix includes in source/simulation2
Make include-what-you-use happy with some files in source/simulation2
and fix what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-07 08:38:40 +02:00
Stan 94a7dbacdc Build molten vk instead of relying on a prebuilt version 2025-08-06 21:21:30 +02:00
Jonny McCullagh aee2aa4cfd Add new historical quotes 2025-08-05 22:27:12 +02:00
Kate 96ab6ecb41 Rename "Join game" to "Connect by IP" in main menu 2025-08-05 22:04:13 +02:00
phosit b1196fc94f Use promises to update the colormixer
Callbacks introduce indirections which are harder to understand.
2025-08-05 19:15:01 +02:00
phosit 17338daaaa Groupe a chanels in the collor-mixer
It's easyier to construct and iterate chanel by chanel instead of
iterating three arrays at once.
2025-08-05 19:15:01 +02:00
phosit 6c481d4811 Make the colormixer a module
Modules don't expose global symbols. Because of that not all functions
have to be cramed in to one class. The functions can now be split in a
more readable way.

Ref: #8081
2025-08-05 19:15:01 +02:00
Ralph Sennhauser 46d44bbc14 Fix includes in source/ps
Make include-what-you-use happy with some files in source/ps and fix
what needs to be fixed.

Delete source/ps/FutureForward.h as it is no longer used.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-05 07:21:22 +02:00
Itms 03fff3572f Use conforming preprocessor with modern MSVC
https://learn.microsoft.com/en-us/cpp/preprocessor/preprocessor-experimental-overview
2025-08-04 17:35:48 +02:00
trompetin17 251f6bfc86 Enhance language selection by applying CJK font styles 2025-08-04 09:35:46 -05:00
trompetin17 690838e3dc Add [locale] inline tag for per-locale fonts
New `[locale='xx']...[/locale]` markup lets GUI text sections render
with a locale-specific font (e.g. CJK) while the rest of the caption
keeps the current game font.

guiObject.caption = "Hello [locale='ja']世界[/locale], how do you
[locale='zh']感覺[/locale]" This is ideal for language pickers and
similar UI where you want the language name shown in its own script.

This commit unlocks richer, self-explanatory international UI while
keeping the legacy text behaviour unchanged.
2025-08-04 09:35:41 -05:00
trompetin17 47454a592e Fix casing for debug box configuration keys in default.cfg and TextRenderer.cpp 2025-08-04 07:44:12 -05:00
Itms ed55976c6c Set pyrogenesis as start project in Visual Studio
Fixes #7218
Refs #3729, #404
2025-08-04 12:39:55 +02:00
phosit 9f15df2831 Calculate baseResourceConstraint only once
`baseResourceConstraint` was calculated for every resource.
2025-08-03 21:05:14 +02:00
phosit 0cf1697594 Allow maps to not specify BaseResourceClass
There was already a check to handle no `BaseResourceClass` but it's
handled in a way that could lead to errors later on.
2025-08-03 21:05:14 +02:00
phosit 0c96ef7906 Add stronghold placement to Cantabrian Highlands
With stronghold each team is placed on a hill.

With stronghold placement the hills are bigger. On tiny maps the ramps
might overlap and enemies might not be reachable. To prevent that the
ramps are shortened and the angle is changed to point more towards the
center of the map.

Refs: #7717
2025-08-03 19:08:04 +02:00
phosit ecb2db1dcd Return objects from placement-functions
An alternative to 6a43f91630 which doesn't restrict
`playerPlacementByPattern` to return exactly two values.
2025-08-03 19:08:04 +02:00
Ralph Sennhauser 86255ed66f Fix includes in source/simulation2
Make include-what-you-use happy with some files in source/simulation2
and fix what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-03 17:16:27 +02:00
phosit eee48b74dd Store IGUIObjects in std::unique_ptr in CGUI
The object are automatically deleted. The destructor can now be
defaulted.
2025-08-03 16:55:43 +02:00
phosit 6eac128f12 Pass IGUIObject as reference
Where nullptr isn't allowed references should be used.
2025-08-03 16:55:43 +02:00
phosit f2dfb94b88 Return void from CGUI::Xeromyces_ReadObject
The returned value was never used.
Now all CGUI::Xeromyces_Read* functions return void.
2025-08-03 16:55:43 +02:00
phosit 50b76acdd5 Restrict foundations on survival of the fittest
Units which are able to build can't reach the center, to build the
placed foundation and the collectors can't build.

This might help Petra a bit and avoid players placing foundations that
cannot be built.
2025-08-03 16:50:43 +02:00
Ralph Sennhauser 8a6d7b6c65 Fix includes in source/ps
Make include-what-you-use happy with some iles in source/ps and fix what
needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-03 15:57:56 +02:00
Ralph Sennhauser 7dece41990 Fix includes in source/lib
Make include-what-you-use happy with some files in source/lib and fix
what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-03 10:15:37 +02:00
rene 35db768ae5 Remove incorrect tech requirement for Kushites
Naval Ballistae cannot be researched by the Kushites, who don't have
access to siege ships. Hence their unique Flaming Projectiles technology
cannot depend upon Naval Ballistae.

This removes the dependency and increases the cost of the unique tech.

Fixes: #8046
Patch-By: rene
Reviewed-By: Itms
Reviewed-At: https://gitea.wildfiregames.com/0ad/0ad/pulls/8056
2025-08-03 00:29:51 +02:00
Ralph Sennhauser 621a9c422f Fix includes in source/graphics
Make include-what-you-use happy with files in source/graphics and fix
what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-08-02 21:39:39 +02:00
phosit 07309450fc Make also dap respect 'no-useless-assignment'
Forgotten in #8163 due to rebase.
2025-08-01 15:57:27 +02:00
phosit 582541ea80 Enable eslint rule 'no-useless-assignment'
Enable rule 'no-useless-assignment' [1] and fix violations.

[1] https://eslint.org/docs/latest/rules/no-useless-assignment
2025-08-01 11:26:40 +02:00
phosit 27a0c22a23 Remove TIMER debug_filter
There are now no "TIMER" messages printed anymore. So the filter can be
removed.

Refs: #1003
2025-07-29 18:19:59 +02:00
phosit 971525a41b Remove TIMER_BEGIN and TIMER_END
`TIMER` messages where printed to stdout which lead to noise.

Refs: #1003
2025-07-29 18:19:59 +02:00
phosit f721f56ad4 Replace TIMER with PROFILE2
`TIMER` messages where printed to stdout which lead to noise.

Refs: #1003
2025-07-29 18:19:49 +02:00
Ralph Sennhauser aed1570040 Fix some includes in source/ps
Make include-what-you-use happy with some files in source/ps and fix
what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-28 16:59:04 +02:00
phosit 08d8f0f61c Remove UNUSED2
The remaining uses can be changed to `std::ignore`.
Fix #7760
2025-07-28 13:16:37 +02:00
phosit eb3f0166f8 Prefer [[maybe_unused]] over UNUSED2
`[[maybe_unused]]` is in the C++ standard.
2025-07-28 13:16:37 +02:00
phosit 5be02743fa Don't use UNUSED2 on always unused variables
Not introducing a variable enforces that the variable is not used.
`UNUSED2` on the other hand is used to silence the warning.
2025-07-28 13:16:37 +02:00
phosit c0f20171f8 Remove wrong UNUSED2
Some variable are marked unused even though they are used.
2025-07-28 13:16:37 +02:00
Stan e35fce8524 Move globals to the PopCapManager prototype. 2025-07-27 19:00:04 +02:00
Ralph Sennhauser f9e1e742bf Fix includes in source/renderer
Make include-what-you-use happy with files in source/renderer and
fix what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-27 16:07:14 +02:00
Ralph Sennhauser 27f7216be7 Use proper units for time conversion
On *nix the conversion of timeval and timespec to double needs to use
the actual unit in use instead of the unrelated clock resolution.

Fixes: aa3bd08513
Fixes: #8215
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-27 14:11:52 +02:00
Ralph Sennhauser 70b8c6eb52 Prefer standard int types
<cstdint> since C++11 defines all those int types and macros, therefore
drop extra definitions in source/lib.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-25 15:53:40 +02:00
Ralph Sennhauser 9c7bbd531f Fix some includes in source/lib
Make include-what-you-use happy with some files in source/lib and fix
what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-25 07:11:21 +02:00
Ralph Sennhauser 3c1a37985a Fix includes in source/network
Make include-what-you-use happy with files in source/network and
fix what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-23 18:18:47 +02:00
Ralph Sennhauser 41c65b972b Print all copyright violations at once
If there are multiple commits with bad copyrights then only the results
for one was printed and immediately returned failure. This change
collects all and returns success or failure after.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-23 17:19:07 +02:00
Ralph Sennhauser c373334b90 Use fixed fetch-depth for copyright linter
The old trick to get needed commits doesn't work anymore. The context in
gitea unlike on github doesn't carry the number of commits, therefore
just fetch a fixed depth of 100 which is to reason should be enough.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-23 17:19:07 +02:00
trompetin17 df7b2fcd2a Win: include <cctype> for isalpha without PCH
Building the workspace with `--without-pch` fails on MSVC:

    source/lib/sysdep/os/win/acpi.cpp(123): error C3861: 'isalpha':
    identifier not found

The pre-compiled header normally brings in `<cctype>`, but when PCH
generation is disabled the translation unit must include the header
explicitly.

Add the missing `#include <cctype>` to
`source/lib/sysdep/os/win/acpi.cpp`.

No functional change; the code now compiles cleanly with or without PCH.
2025-07-23 09:17:27 -05:00
Itms 8ccba254fe Remove modmod dependency in test_CGUIText.h
The test loading the `mod` mod uses the bold variant that is present in
`_test.minimal`. Removing the need for the `mod` mod allows packagers to
build and run tests from the `unix-build` tarball without needing the
`unix-data` one.

The setup for this test suite defines the italic variant of the sans
serif font, but this variant is not present in `_test.minimal` and is
not used in any test, so remove that as well.
2025-07-23 12:20:19 +02:00
Itms 781d2b6ab6 Throw exception, detected by C4834 warning 2025-07-23 10:21:27 +02:00
Itms 2d6d510ffa Hide compiler warnings from external includes 2025-07-23 10:21:26 +02:00
Itms aca798b318 Adapt the build infrastructure to VS2022 2025-07-23 10:21:25 +02:00
Stan ef69c37f66 Add VS2022 support with the v143 toolset 2025-07-23 09:19:29 +02:00
trompetin17 8ed40553c8 Update SetFormatAndFreq method to use ALenum type in format parameter 2025-07-22 08:41:03 -05:00
trompetin17 019514a9cf Refactor COggData class: make destructor non-virtual, adjust method declarations for consistency 2025-07-22 08:41:02 -05:00
trompetin17 000304a402 Rename m_BuffersUsed to m_BuffersCount for consistency in COggData class 2025-07-22 08:41:02 -05:00
trompetin17 ef28d5222a Use 'using' instead of 'typedef' for OggStreamPtr definition 2025-07-22 08:41:01 -05:00
trompetin17 c40aada404 Rename atFileEOF to AtFileEOF for consistency in Ogg classes 2025-07-22 08:41:01 -05:00
trompetin17 586d02838a Refactor Ogg buffer logic to use span and vector
Modernized COggData::FetchDataIntoBuffer and OggStream
interface:

- Replaced raw buffer pointer with std::vector<u8> in COggData
- Updated GetNextChunk to use PS::span<u8>
- Removed manual new/delete and memset usage
- Replaced long with ALsizei for m_Frequency to match OpenAL API
- Simplified type usage with size_t where appropriate
- Eliminated unnecessary casting and improved code clarity

These changes improve safety, readability, and bring the
code closer to modern C++ standards.
2025-07-22 08:41:00 -05:00
trompetin17 325bedcf3f Use std::array for OggData buffer handling
Replaced the raw C array for m_Buffer with std::array
to improve bounds safety and code clarity.

- Used .data() and .at() for buffer access
- Added check for bufferCount exceeding OGG_MAX_BUFFER_COUNT
- Left FetchDataIntoBuffer unchanged to avoid breaking external usage
  (e.g. CStreamItem)

This refactor improves safety while keeping external API stable.
2025-07-22 08:41:00 -05:00
trompetin17 21f26455f5 Decouple buffer config from SoundManager
OggData now manages its own buffer size and count directly,
instead of relying on SoundManager to provide those values.

- Removed unused GetBufferCount() and GetBufferSize()
- Use default values for buffer size and count in OggData
- Documented buffer settings for clarity

This change centralizes control in OggData and improves encapsulation.
2025-07-22 08:40:59 -05:00
trompetin17 50dbd5ca2d Remove unused AddDataBuffer declaration
The AddDataBuffer method was declared but never defined
in any implementation of CSoundData or its derived classes.

It is also not used anywhere in the codebase, so this
commit removes the dead declaration to clean up the
interface.
2025-07-22 08:40:59 -05:00
trompetin17 95fc9bd2ed Standardize OggData fields and variable naming
This commit renames ogg to m_OggStreamPtr for clarity and consistency
with naming conventions. Additionally, it moves the m_Format and
m_Frequency fields to the private section to ensure proper
encapsulation.

Local variables like pcmout have been renamed to PCMOut to match style
conventions, and all member fields now follow a consistent m_ prefix
style, placed at the end of the class definition for clarity.

These changes help improve code readability, enforce privacy, and align
with the rest of the codebase's naming standards.
2025-07-22 08:40:58 -05:00
trompetin17 e95829494c Ensure brace initialization variables in OggData
This commit updates the OggData-related classes to use uniform brace
initialization ({}) for member variables where applicable. Brace
initialization improves clarity and prevents potential narrowing
conversions or unintended behavior caused by default constructor
ambiguity.

This change improves consistency and aligns with modern C++ best
practices, especially in C++11 and later where brace initialization is
recommended for safer initialization semantics.
2025-07-22 08:40:57 -05:00
trompetin17 e97292430d Remove manual Close method from OggStream
The OggStream interface no longer needs the Close() method.
OpenOggNonstream returns a smart pointer (OggStreamPtr),
so resource cleanup is automatically handled by the destructor.

OggStreamImpl now calls ov_clear in its destructor, making
manual cleanup unnecessary. This commit removes the Close()
method from the interface and its implementation.
2025-07-22 08:40:48 -05:00
phosit e03b6ae657 Remove isNomad in unknown.js
`isNomad` got removed in 6bb7f3fd39 this use was missed.

It wasn't called. So it always evaluated to true.
2025-07-21 11:07:57 +02:00
Ralph Sennhauser 8398f1baf4 Fix some includes in source/graphics
Make include-what-you-use happy with some files in source/graphics and
fix what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-20 17:28:48 +02:00
Ralph Sennhauser 0dc52a4d43 Drop GetWstringFromWpath helper function
657be906fe allowed the use of boost filesystem v4, so this should have
been updated as well. As boost filesystem v2 is irrelevant as it was
removed in boost-1.50 so just remove the wrapper function altogether.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-20 07:24:35 +02:00
Stan 0d60ecbf96 Remove OS_MAC macro
It hasn't been used in a while, and we shouldn't pretend to support macOS < 10.9.
2025-07-19 18:16:14 +02:00
Ralph Sennhauser 6f2f8c13bf Replace boost::mt19937 with std::mt19937
Available since C++11 and already used in the codebase.

Ref: #8210
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-19 10:46:02 +02:00
Ralph Sennhauser a2f15bae4e Fix some includes in source/graphics
Make include-what-you-use happy with some files in source/graphics and
fix what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-18 07:30:04 +02:00
Ralph Sennhauser 4324dc1447 Fix some includes in source/lib
Make include-what-you-use happy with some files in source/lib and fix
what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-17 20:07:25 +02:00
trompetin17 b32b018769 Fix chat session incorrect width calc
Refs: #8188
2025-07-17 09:46:31 -05:00
trompetin17 ffdf527d90 Fix label resizing in Map Browser
Refs: #8188
2025-07-17 09:46:18 -05:00
trompetin17 01d2481f55 Fix Structure Tree misplaced phase icons
Refs: #8188
2025-07-17 09:45:35 -05:00
Ralph Sennhauser 1c9d4508f7 Cleanup of premake pkgconfig module
Split public and private stuff into their own sections and do parsing of
libs in a helper function analog to the parse helper function for
includes and document public funcions using LDoc. Finally make setting
the static flag a function.

Ref: #8135
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-17 11:22:05 +02:00
Ralph Sennhauser 0a78acf4dd Drop header lib/posix/posix_time.h
Only used for timespec which is in <ctime> since C++17. All other uses
were already obsolete with C++11 so remove the header wrapper.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-16 18:28:05 +02:00
Ralph Sennhauser 826dba847c Make wfilesystem.cpp freestanding
Copy some wtime internals to wfilesystem.cpp with internal linkage only,
this code has had no use outside of wfilesystem and was only added to
wtime in case other use cases could be found. This will allow removing
posix_time and affiliated code.

wfilesystem will become obsolete with the move to <filesystem>

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-16 18:28:05 +02:00
Ralph Sennhauser 2e6f62dcf9 Use clock_gettime on macOS
Is a Posix function and available on macOS since version 10.12, has better
granularity than gettimeofday. Add missing header <time.h> where
clock_gettime is specified.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-16 18:28:05 +02:00
Ralph Sennhauser a03268ebae Drop header lib/posix/posix_errno.h
Does only include <errno.h> with the exception on Windows but only if
not using MSVC and even then depends on whether boost is included first
or not.

Use <cerrno> which was added in C++11 and is based of of Posix instead
of a particular cerrno.h of a particular C library.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-15 19:42:34 +02:00
trompetin17 4fd3533f37 Fix wrapping by passing window width to text size
Why
Passing 0 as the width to `CGUIText` meant "no wrapping".
Buttons and text objects therefore treated every caption as a
single unbroken line, ignoring embedded new-line characters and
overflowing their allotted space.

What
`GetPreferredTextSize` in both `CButton` and `CText` now forwards
`m_pGUI.GetWindowSize().Width` instead of 0.
With a real width the underlying `CGUIText::GetSize()` can measure
the caption using normal word-wrap rules, restoring correct
multi-line behaviour and preventing layout glitches.

Fixes: #8193
2025-07-14 15:02:13 -05:00
trompetin17 b2fc1d6943 DapInterface: shutdown sockets on Unix
FreeBSD could hang indefinitely when the debug-adapter process
terminated because we closed the TCP socket without first calling
`shutdown()`.  On that platform (and similarly on Linux and macOS)
a peer that is still blocked in `recv` will not be woken up unless
a full‐duplex shutdown is performed.

This patch adds `shutdown(fd, SHUT_RDWR)` in `DapInterface.cpp`
for Linux, *BSD, and macOS builds, preventing the observed hang.
2025-07-14 13:53:17 -05:00
phosit 8f9c92f30c Utilize minDist in placePlayerBaseBerries
Only maps where `minDist` and `maxDist` differ get changed by this
commit. That is only "Deep Forest".

This has been around since `placePlayerBaseBerries` got introduced in
921850cdef.
2025-07-13 20:29:54 +02:00
phosit 6bb7f3fd39 Remove isNomad from rmgen-common
This removes a usage of the global `g_MapSettings`.

The conversion to bool isn't required.
`mapSettings` (non-global) is available since e01ea16ae5.
2025-07-13 20:29:54 +02:00
phosit aa0c195332 Remove get function in placePlayerBase
`get` is used to get a property of `args` or a default if the property
doesn't exist.
`args` was bound to `get` so it obscured dataflow.

`get` was usefull when there wasn't a `??` operator.
2025-07-13 20:29:54 +02:00
phosit bb76a4f711 Remove trivial playerPosition
`playerPosition` is the same as `args.playerPosition` so it isn't of
much value and does obscure dataflow.
2025-07-13 20:29:54 +02:00
trompetin17 c1353d665a Add missing includes for fmt and CLogger in test_DapInterface.h 2025-07-13 07:27:56 -05:00
Itms 16bcc5a870 Bump build date of A27.1 RC2 2025-07-12 15:25:10 +02:00
Itms b362f0537a Fixup SpiderMonkey DLL for Windows 7 on Win32
Pulling the DLL from SVN is performed separately to allow backporting
to A27.

Accepted-By: sera
Reviewed-On: https://gitea.wildfiregames.com/0ad/0ad/pulls/8175
2025-07-12 14:26:30 +02:00
Ralph Sennhauser 47b2733183 Fix some includes in source/renderer
Make include-what-you-use happy with some files in source/renderer and
fix what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-12 12:19:41 +02:00
trompetin17 0f156e3544 GUIProxy: Support property introspection for debugging
This commit enables proper property enumeration and inspection for GUI
proxy objects in debugging sessions using the SpiderMonkey Debugger API.

Interface (IGUIProxyObject):
- Added a pure virtual method getPropsNames() to expose cached property
  names from the GUI object implementation.

Proxy handler (JSI_GUIProxy):
- Implemented ownPropertyKeys() to enumerate all visible properties of
  the proxy, including: -- Built-in GUI fields: "name", "parent",
  "children". -- Dynamic settings stored in m_Settings. -- Script event
  handlers prefixed with "on" from m_ScriptHandlers. -- Function
  properties returned by getPropsNames().
- Implemented getOwnPropertyDescriptor() to synthesize descriptors for
  debugger queries: -- Returns undefined if the property is not defined.
  -- Returns a read-only enumerable descriptor otherwise.
- Both methods are marked final and override SpiderMonkey's
  BaseProxyHandler.

Why:
- SpiderMonkey’s Debugger API requires ownPropertyKeys and
  getOwnPropertyDescriptor for proxy objects to be introspectable in dev
  tools like VS Code.
- Without these, properties of GUI objects are hidden during debugging.
- This change improves the developer experience by making all meaningful
  GUI object fields visible and explorable at runtime.
2025-07-11 11:06:06 -05:00
trompetin17 20b7c3f9b8 Implement Debug Adapter Protocol (DAP) Interface in debugger.js
Adds initial support for the Debug Adapter Protocol (DAP) to
SpiderMonkey via debugger.js. This JavaScript-based implementation
enables external debuggers (e.g., VS Code) to interact with the JS
runtime using the DAP interface.

Implemented DAP requests and events:

- attach
- initialize (capabilities)
- stopped event
- threads
- scopes
- variables (globalThis pending)
- continue
- stepIn
- stepOut
- setBreakpoints
- Handling of debugger statements

This forms the foundation for interactive debugging of in-game scripts,
providing smoother integration with developer tools.
2025-07-11 11:06:05 -05:00
trompetin17 678a33c100 Dap Interface with Spidermonkey debug
Spidermonkey provide a mechanics to debug all comportaments and real
from a different place with JS code this allow us to reuse the current
scriptinterface but addind the new Debugger object definition only for
debugging without change any code from other place like GUI &
simulation.

Debugger Adapter Interface is a protocol that commons IDE implement to
being able for debugging, the concept is to provide sockets connections
with c++ but the Dap implementation in JS that allow us to extend for
more Request / Events that DAP provide.

Because Dap Interface its implemented with JS we need to handle message
in the main thread so we are calling in the main loop before GUI
messages
2025-07-11 11:06:04 -05:00
Ralph Sennhauser 91105657d9 Update FreeBSD Jenkins pipline
Drop reference build as it makes no sense for incremental builds, fix
warnings in test reporting and finally log build warnings per run which
prevents third partly library builds to leak into the report and failing
the CI.

Ref: #7367
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-10 08:19:58 +02:00
Ralph Sennhauser b2e379b841 Update MacOS Jenkins pipline
Make use of build matrix, drop reference build as it makes no sense for
incremental builds, fix warnings in test reporting and finally log build
warnings per run which prevents third partly library builds to leak into
the report and failing the CI.

Ref: #7367
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-10 08:19:58 +02:00
trompetin17 256dff7fd4 Font: make atlas uploads queue-aware on Vulkan
Goal
----
Avoid corrupting the dynamic font-atlas on Vulkan by blocking any
re-uploads until the command buffer that created / last updated the
texture has actually been submitted.

What changed
------------
* **Queue-aware textures**
  * Added `queueSubmitAware` flag to `IDevice::CreateTexture*` APIs.
  * `Vulkan::CTexture` now stores two booleans:
      - `m_QueueSubmitAware` – opt-in per texture.
      - `m_PendingQueueSubmit` – set to *true* the moment an upload
        is recorded, cleared once the submit scheduler has flushed.
  * `CRingCommandContext::ScheduleUpload` marks the texture as
    pending (`SetPendingQueueSubmit(true)`).

* **Device-side watcher**
  * `Vulkan::CDevice` keeps a
    `m_TextureUploadWatcherQueue`. Each frame it checks textures that
    were uploaded ≥ `NUMBER_OF_FRAMES_IN_FLIGHT` frames ago and
    clears their pending flag.
  * New helpers
    `ScheduleTextureUploadWatch `,
    `ProcessTextureUploadWatchQueue()`.

* **Font code**
  * Atlas texture is now created with
    `queueSubmitAware = true`.
  * `CFont::UploadTextureAtlasToGPU()` early-outs when
    `IsPendingQueueSubmit()` returns *true*, instead of tracking a
    submit-handle or the manual `m_IsLoadingTextureToGPU` flag
    (removed).

Why this is better
------------------
The logic to wait for a flush is localised inside the rendering
backend, so `CFont` only needs to ask *“is my texture busy?”*.
This removes the fragile submit-handle bookkeeping and works even if
the scheduler issues multiple submits per frame in future.

Result
------
Atlas uploads are deferred until the previous submit completes,
eliminating the intermittent glyph corruption on the Vulkan backend
while leaving GL and the dummy backend unchanged.
2025-07-09 13:09:46 -05:00
Ralph Sennhauser ddcb844bcc Redirect stderr into build.log in Windows pipeline
The build.log is created and found, but no warnings are collected.
Redirect stderr so the warnings end up in the log in the first place.

Fixes: #8159
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-09 19:24:51 +02:00
Ralph Sennhauser 8a8f2596ea Fix a warning on Windows
5e4b49f65f introduced a warning, silence it as it's in spidermonkey and
only leaks while on vs2017.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-09 19:24:51 +02:00
Ralph Sennhauser e7f44ca6ca Fix some includes in source/renderer
Make include-what-you-use happy with some files in source/renderer and
fix what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-09 09:04:50 +02:00
Ralph Sennhauser c2cc762616 Better handling of PKG_CONFIG_PATH
Allow override PKG_CONFIG_PATH via env, making it possible to easily
inject alternative library builds for testing or bisecting. This was
only possible when the premake script didn't override it which it
unconditionally did on macos.

Also don't expose the variable holding the path directly but offer a
function to append to the path instead.

Ref: #8135
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-09 07:48:49 +02:00
Ralph Sennhauser ad3f6e3119 Dissolve external_libraries/openal.h
This header was used to overcome macos openal vs openal-soft header name
difference, for the migration to openal 1.1 and to pass arguments to the
linker on windows in the past. None of this is used anymore so dissolve
the header.

Also fix related headers so one can run include-what-you-use on the
changed files.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-08 19:33:36 +02:00
phosit 9822a22573 Replace ScriptException::Raise in Engine functions
Now exceptions can be thrown. The function throwing exceptions becomes
cleaner and doesn't require a `ScriptRequest` anymore.
2025-07-08 19:11:49 +02:00
phosit 616fa4a006 Handle C++ exceptions in Engine functions
`JSNatives` passed to SpiderMonkey must not throw exceptions. Most
callbacks are wrapped in `ScriptFunction::ToJSNative`.
This commit adds exception handling to `ScriptFunction::ToJSNative` so
that exceptions thrown in the wrapped callbacks are catched and rethrown
as JavaScript `Error`s.
2025-07-08 19:11:49 +02:00
phosit eeeba977ea Don't crash if rl-interface port is already in use
Replace `ENSURE` with recoverable error handling. Introduce a new error
type so that it's distinguishable from other errors.

When such an error occurs the program exits with `EXIT_FAILURE`.

Fixes: #7475
2025-07-07 21:38:52 +02:00
Ralph Sennhauser 5e4b49f65f Fix some includes in source/renderer
Make include-what-you-use happy with some files in source/renderer and
fix what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-07 17:45:54 +02:00
trompetin17 251f599ad2 Expand summary GUI resource columns
Mods can add more resources than the summary screen’s fixed layout
handled, which crashed with:

ERROR: JavaScript error: gui/summary/layout.js:269 headerGUI is null

This patch doubles the column templates (9 → 18) and updates the
iteration logic so extra headers no longer resolve to null. It removes
the need for copy-paste XML edits when mods grow the resource list.

Known limitations
-----------------
* Column count is still static; a future change should generate the
  layout from g_Resources at run-time.
* UI tested at 1080p and 4 K; very small resolutions might require a
  horizontal scroll solution.
2025-07-06 22:33:25 -05:00
Ralph Sennhauser ed4e2587c2 Fix includes in source/maths
Make include-what-you-use happy with files in source/maths and fix what
needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-06 18:24:31 +02:00
obelix 9970706deb Fixes typo in gerousia.xml 2025-07-06 05:57:43 +02:00
obelix bf25c463c5 Correction of the tooltip in gerousia.xml
Add 'and heroes' to the tooltip as this building trains three of them.
2025-07-06 05:57:43 +02:00
wowgetoffyourcellphone af84640a0c Update cape_long_gaul.xml
Fixes the cape not animating while the Gallic skirmisher attacks.
Also has a small formatting improvement.

Fixes #7970
2025-07-05 18:57:15 +02:00
Ralph Sennhauser 461ff6c20c Fix most headers in gui
Make include-what-you-use happy with most of the files in source/gui and
fix what needs to be fixed after including missing compile flags.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-05 12:42:34 +02:00
Ralph Sennhauser 2b5830e82a Add support for specifying pkg-config via env
For cross compiling there is a need to specify an alternative binary for
pkg-config. It's customary to use the environment variable PKG_CONFIG for
this.

Ref: #8135
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-05 09:20:37 +02:00
trompetin17 11a108d00c GameSettingsController: clear stale “Removed” flag
If a human player is set to “Removed” in Game Setup, leaves to the
main menu, and re-enters, they are auto-assigned back to the same
slot but still flagged as removed, triggering an instant defeat when
the match starts.

GameSettingsController::onLoad already reconciles **playerAI** against
current player assignments, but the analogous check for the new
**playerRemoved** setting was missing. The flag therefore survived
persisted-settings reloads.

This mirrors the existing AI-conflict logic and resets the flag
whenever a human player occupies the slot.

Bug reported by *elexis*.
2025-07-03 20:41:39 -05:00
phosit 1ca4dc08fd Enable eslint rule 'no-duplicate-imports'
Enable rule 'no-duplicate-imports' [1] before we use modules heavily.
There where no violations.

[1] https://eslint.org/docs/latest/rules/no-duplicate-imports
2025-07-03 19:19:30 +02:00
Ralph Sennhauser 8227e76845 Restore includes for suppressing warnings on vs2017
Commit d888b10931 remove those headers which have the side effect of
suppressing some warnings on Windows using vs2017. Keep those headers
around for till vs2019+.

Add additional suppressions where needed for spidermonkey headers.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-02 17:40:27 +02:00
Ralph Sennhauser 61326cfca6 Fix some headers in gui
Make include-what-you-use happy with a part of the files in source/gui
and fix what needs to be fixed after including missing compile flags.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-02 13:20:13 +02:00
Ralph Sennhauser 707abee34d Don't export HOSTTYPE in update-workspace.sh
Exporting HOSTTYPE prevents cross compilation as HOSTTYPE is used to
override target host arch instead of detecting it from chosen compiler.
This then results in the wrong arch specific source files to be
included. So just don't set it by default and let it to the user to set
it if he so chooses.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-02 12:58:46 +02:00
Ralph Sennhauser 904957c50f Allow --fix in copyright linter wrapper
Sometimes doing it manually is cumbersome.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-02 12:45:58 +02:00
Ralph Sennhauser 0f39dcf2c3 Fix white-space error in 8b5bcf05d7
The workflow was run before the addition of white-space error check, so
the trailing white-space made it in.

This commit unblocks the CI.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-02 11:56:09 +02:00
Langbart 8b5bcf05d7 fix: adjusts the tooltip for the fire ship
ref: https://gitea.wildfiregames.com/0ad/0ad/pulls/7510#issuecomment-110923
2025-07-02 07:23:03 +02:00
Langbart 86077bc97f fix: remove 'Heroes' in the spart/syssiton tooltip
ref: https://gitea.wildfiregames.com/0ad/0ad/pulls/7510#issuecomment-114268
2025-07-02 07:23:03 +02:00
Langbart 1aae83f20a fix: wrongly owned entities on the skirmishes/isthmus_of_corinth_2p map
ref #6688
2025-07-02 07:23:03 +02:00
Langbart 091e865243 fix: remove redundant splash tooltip
ref 22b72a362b
2025-07-02 07:23:03 +02:00
Langbart 1f074862cd fix: remove unsupported modifications in ram_garrison.json
ref: #6884
2025-07-02 07:23:03 +02:00
Langbart 26a3f4e8aa fix: increase kennel vision
Default vision of 4 is too low when standing in FOW.
2025-07-02 07:23:03 +02:00
Langbart 1e72caa0f6 fix: increase vision for onager
Increase vision range to avoid continuous firing for most structures.
Ref: #6708

Rename onager template to 'siege_onager_unpacked' to follow existing
naming conventions.
2025-07-02 07:23:03 +02:00
Langbart 1f32412e8d docs: update entity classes and categories
checked for missing, redundant and duplicates classes, Removed 'Fire' no tech uses it and classification value is zero
2025-07-02 07:23:03 +02:00
Langbart 834fff776c fix: delist promoted entities on training panel
promoted entities dont need to be listed if the subset unit is present
2025-07-02 07:23:03 +02:00
Langbart db57e58fd5 fix: add missing civ tags to templates
ref: #7438
2025-07-02 07:23:03 +02:00
Vantha 9c8c8bc42a Enable normal-map-specific compression for skins and terrains
Normal maps contain redundant color information and the engine supports
compression algorithms (like DXT5n) optimized for that.
It has previously only been enabled for the water normal maps.

Pull Request: #8114
2025-07-01 13:42:53 +02:00
Dunedan 31d7e4c97f Improve styling of the header of the profiler2 UI
This improves the styling of the header of the profiler2 UI, by applying
the following changes:

- change the spinner animation to actually look like a spinner
- ensure open reports don't overflow the nav bar
- reduce the size of the server port input field
- add some paddings to make everything look more pleasing
2025-07-01 09:56:28 +02:00
Dunedan 07845b0ff5 Apply graph smoothing changes immediately
`onchange()` triggers only when an element looses focus. For the graph
smoothing in the profiler2 UI we want to have the smoothing applied
immediately when modifying the slider, so let's use `oninput()` instead.
2025-07-01 09:35:18 +02:00
Ralph Sennhauser 863b0b90b7 Update headers in i18n
Remove external_libraries headers for icu and tinygettext, as they
neither add any workarounds needed and as quite a few other libraries
don't have such a header either. As for the warnings suppressed, this is
no longer needed as they were fixed and with vs2019 added support for
-isystem or equivalent would make this useless eitherway.

Further make include-what-you-use happy with files in source/118n and
fix what needs to be fixed after.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-01 09:01:00 +02:00
Ralph Sennhauser a606fbf1a5 Fix headers for XML/XMB
Declare "lib/posix/posix.h" as source for <strings.h>

Make include-what-you-use happy with files in source/ps/{XMB,XML} and
fix what needs to be fixed after including missing compile flags.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-07-01 07:44:06 +02:00
Ralph Sennhauser 758d901883 more objecttype 2025-06-30 21:18:16 +02:00
Ralph Sennhauser af582b09aa fixup! Fix headers for gui/ObjectTypes 2025-06-30 21:09:46 +02:00
Ralph Sennhauser 00f9d887b1 fixup! Fix headers for gui/ObjectTypes 2025-06-30 21:07:53 +02:00
Ralph Sennhauser 49863da3b4 Fix headers for gui/ObjectTypes
Make include-what-you-use happy with files in source/gui/ObjectTypes and
fix what needs to be fixed after.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-30 20:38:16 +02:00
Ralph Sennhauser d888b10931 Fix headers for gui/ObjectBases
Make include-what-you-use happy with files in source/gui/ObjectBases and
fix what needs to be fixed after.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-30 19:56:41 +02:00
trompetin17 571b536e1f Log GUISize/GetTextSize deprecations once
Replace repeated LOGWARNING calls with ONCE(LOGWARNING) in
JSInterface_CGUISize.cpp and JSInterface_Main.cpp.

Why – The old behaviour printed a warning every time the deprecated
API was used, cluttering the log and annoying modders. We still want to
nudge them toward the new APIs (object.size = {...} and
guiObject.GetPreferedTextSize/getTextSize), but a single reminder is
enough.

What changed

CGUISimpleSetting<CGUISize>::DoFromJSVal now wraps the deprecation
message in ONCE(...).

Engine.GetTextSize warning is likewise wrapped.

Impact – Functionality is unchanged; only the frequency of the
warnings is throttled to one per session, making the transition less
intrusive and more user-friendly.
2025-06-29 09:12:21 -05:00
Ralph Sennhauser d8af7b9416 Improve reporting of build environment for premake
Various environment variables may have an impact on what premake will
do, properly report them in the output and consolidate others.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-29 13:58:14 +02:00
Ralph Sennhauser 3a38fcb17c Update lfsconfig comment
Use a colon instead of a backslash to seperate domain from repo. The
backslash only works for pushing and for pulling lfs will complain about
"batch request: missing protocol"

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-29 08:31:50 +02:00
rene 3c457457cd Add tip about lost resources when gathering
Illustration by: Vantha
Feedback by: Vantha, Langbart
Fixes #7652.
2025-06-28 10:39:52 +02:00
trompetin17 3db465587f Fix chat input size assignment typo
Fixes a typo introduced in fd847c2a23 where the code
incorrectly modified chatSubmitButton.size instead of
chatInput.size, effectively collapsing the input field's
width to zero.

This change ensures the chat input field resizes correctly
based on the button's position.

Thanks to Langbarg for noticing the issue.

Refs: #8138
2025-06-27 08:38:38 -05:00
trompetin17 22d3a52b38 Fix chat wrapping by replacing Object.assign
Fixes a bug where chat overlay text wrapping changed
unexpectedly when earlier messages expired.

The issue was caused by Object.assign modifying the size
object in place, which did not trigger proper recalculation
for getTextSize in subsequent frames.

Replacing it with direct assignment ensures the size object
is recompute, allowing correct layout behavior.

Bisected to: fd847c2a23

Thanks to Langbarg for identifying the root cause.

Ref: #8043
Fixes: #8138
2025-06-27 08:38:37 -05:00
Vantha bef29e4af5 Add some new tips 2025-06-27 15:34:44 +02:00
Ralph Sennhauser aabb5854aa Add note for ssh users to .lfsconfig
Users using ssh are suddenly asked for a username and password for lfs,
add a note as to why that is and how to avoid it to the .lfsconfig in
hope they will see it.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-27 15:23:30 +02:00
Dunedan e6c479e956 Show report statistics for single reports as well 2025-06-27 10:04:11 +02:00
Dunedan 7e531ec6fe Add minimum, sum and percentile columns to reports 2025-06-27 10:03:38 +02:00
trompetin17 e845da025a Add deprecation warning to GetTextSize API
Adds a runtime warning to `Engine.GetTextSize` indicating that the API
is deprecated and will be removed in a future version.

This API does not simulate GUI rendering accurately, as it treats markup
tags like [color], [font], or [icon] as visible characters. This leads
to incorrect size measurements in modern GUI layouts.

New recommended alternatives:
- Use `Engine.GetGUITextSize(...)` for accurate measurement of raw text
  blocks, fully simulating GUI rendering.
- Use `guiObject.getTextSize()` when working within a specific GUI
  object, as it accounts for maxWidth, padding (bufferZone), and object
  constraints.

A warning is now emitted at runtime to guide developers toward these
updated APIs.
2025-06-26 17:11:24 -05:00
trompetin17 b42a2b9adb Apply correct use of TextSize APIs in GUI
Updates GUI code to apply the correct usage of `guiObject.getTextSize()`
and `guiObject.GetPreferedTextSize()`.

- `guiObject.getPreferedTextSize()` is now used when the goal is to compute the
  bounding box of a text string to dynamically resize or layout a GUI
  object accordingly. It simulates how the text would be rendered,
  accounting for markup and layout rules.

- `guiObject.getTextSize()` remains in use when text is being measured
  within a fixed-size GUI element (e.g., a button or label). It respects
  internal constraints like buffer zone and maxWidth, and is typically
  used to align other elements based on its visual appearance.

These changes ensure more accurate text sizing and consistent layout
behavior across GUI components.
2025-06-26 17:11:24 -05:00
trompetin17 19e82ebceb Add getPreferredTextSize to calculate unconstrained text width
Introduces (CButton|CText).getPreferredTextSize, a new method for estimating
the natural width of a caption if the object had no width constraints.

Unlike .getTextSize, which reports the size after applying current
layout constraints (e.g., fixed width or anchors), getPreferredTextSize
answers the question: "How wide would this object need to be to display
the caption on a single line?"

This is particularly useful for modders and layout logic that wants to
dynamically size elements *before* assigning a fixed width or anchoring.
2025-06-26 16:58:32 -05:00
Ralph Sennhauser 7eaea3d181 Update headers in collada
Make include-what-you-use happy with files in source/collada and
fix what needs to be fixed after. Also switch quote with bracket include
where appropriate.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-26 20:05:53 +02:00
phosit 891908b801 Remove UNUSED
The `UNUSED` macro is used to mark a variable as unused but with a name.
Those usages are replaced with comments so that `UNUSED` can be removed.

https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-unused
2025-06-26 17:25:05 +02:00
phosit dd26f3a802 Restrict param type of FSM events
Previously the param type was `void*` now the type has to be specified
as template parameter of the `CFsm`.
With this commit some casts can be removed.
2025-06-26 16:42:04 +02:00
Ralph Sennhauser 7f67bab7c8 Fix -Wrange-loop-construct in ModIo.cpp
Gcc 15 generates the following warning:

../../../source/ps/ModIo.cpp: In static member function ‘static bool ModIo::ParseModsResponse(const ScriptInterface&, const std::string&, std::vector<ModIoModData>&, const PKStruct&, std::string&)’:
../../../source/ps/ModIo.cpp:738:41: warning: loop variable ‘prop’ of type ‘const std::string&’ {aka ‘const std::__cxx11::basic_string<char>&’} binds to a temporary constructed from type ‘const char* const’ [-Wrange-loop-construct]
  738 |                 COPY_STRINGS_ELSE_CONTINUE("", el, "name", "name_id", "summary")
      |                                         ^~~~
../../../source/ps/ModIo.cpp:738:41: note: use non-reference type ‘const std::string’ {aka ‘const std::__cxx11::basic_string<char>’} to make the copy explicit or ‘const char* const&’ to prevent copying
../../../source/ps/ModIo.cpp:749:41: warning: loop variable ‘prop’ of type ‘const std::string&’ {aka ‘const std::__cxx11::basic_string<char>&’} binds to a temporary constructed from type ‘const char* const’ [-Wrange-loop-construct]
  749 |                 COPY_STRINGS_ELSE_CONTINUE("", modFile, "version", "filesize");
      |                                         ^~~~
../../../source/ps/ModIo.cpp:749:41: note: use non-reference type ‘const std::string’ {aka ‘const std::__cxx11::basic_string<char>’} to make the copy explicit or ‘const char* const&’ to prevent copying
../../../source/ps/ModIo.cpp:756:41: warning: loop variable ‘prop’ of type ‘const std::string&’ {aka ‘const std::__cxx11::basic_string<char>&’} binds to a temporary constructed from type ‘const char* const’ [-Wrange-loop-construct]
  756 |                 COPY_STRINGS_ELSE_CONTINUE("filehash_", filehash, "md5");
      |                                         ^~~~
../../../source/ps/ModIo.cpp:756:41: note: use non-reference type ‘const std::string’ {aka ‘const std::__cxx11::basic_string<char>’} to make the copy explicit or ‘const char* const&’ to prevent copying
../../../source/ps/ModIo.cpp:762:41: warning: loop variable ‘prop’ of type ‘const std::string&’ {aka ‘const std::__cxx11::basic_string<char>&’} binds to a temporary constructed from type ‘const char* const’ [-Wrange-loop-construct]
  762 |                 COPY_STRINGS_ELSE_CONTINUE("", download, "binary_url");
      |                                         ^~~~
../../../source/ps/ModIo.cpp:762:41: note: use non-reference type ‘const std::string’ {aka ‘const std::__cxx11::basic_string<char>’} to make the copy explicit or ‘const char* const&’ to prevent copying

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-26 12:39:48 +02:00
Stan dc04f3f432 Fix autofixable eslint warnings for eqeqeq
Ref: #7812
Pull Request: #8129
2025-06-26 11:03:19 +02:00
phosit 0fcc4f5fc5 Split the main-menu into modules
Ref: #8081
2025-06-26 10:50:21 +02:00
phosit dd9ba2fd26 Make the splashscreen a module
Ref: #8081
2025-06-26 10:50:21 +02:00
phosit 77b1addb45 Enable modules in the GUI
Doesn't actually change a GUI-page to use modules. Adopting a GUI-page
now only requires JS and XML changes.

Ref: #8081
2025-06-26 10:50:21 +02:00
phosit b8348bec55 Store the ScriptInterface& in ModuleLoader::Result
During hotloading the `ScriptRequest` was constructed from a
`JSContext*`. That requires that already an other `ScriptRequest` is
active. Which isn't always the case.
Now The `ScriptRequest` is constructed from a `ScriptInterface&`.

Storing a `ScriptInterface&` in the `ModuleLoader::Result` allows to
remove the `m_Result` as it is retrieved from the `ScriptInterface`.
2025-06-26 10:50:21 +02:00
Ralph Sennhauser 25c53cb0ac Enable eslint style rule 'keyword-spacing'
After Stan suggesting change in a review comment just enable the rule
'keyword-spacing' [1] and fix violations so this is no longer a topic in
spirit of #7812.

[1] https://eslint.style/rules/keyword-spacing

Ref: #7245
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-25 14:34:12 +02:00
Ralph Sennhauser b6e66a5d43 Update headers in lobby
Some gloox headers need workarounds to be included, so mark the header
"lib/external_libraries/gloox.h" as source for all gloox symbols and
collect all headers we use under it.

Further make include-what-you-use happy with files in source/lobby and
fix what needs to be fixed after.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-25 14:00:44 +02:00
Ralph Sennhauser 4720033ef9 Don't use premake for setting Wextra on Unix
Move -Wall to where the other warnings are enabled so everything is in
one place.

Fixes: #5329
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-21 19:24:12 +02:00
Ralph Sennhauser 24a5b72020 Cleanup compiler warnings declarations
Remove '-Wno-switch' and '-Wno-invalid-offsetof' as they do no longer
suppress any existing warnings. Also group warning disablers together.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-21 19:24:12 +02:00
Ralph Sennhauser f2b2222284 Fix msvc truncation warning
The CI warns but doesn't fail, explicitly cast to float and while at it
use constant for PI/2.

```
source\graphics\cameracontroller.cpp(303): warning C4305: 'argument': truncation from 'double' to 'float'
```

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-21 08:27:45 +02:00
trompetin17 0ebcc45237 Refactor GetNextChunk for clarity and safety
Replaces the for(;;) loop in GetNextChunk with a clearer while
(bytesRead < size) loop for better readability and intent.

Other improvements:
- Uses constexpr for constant audio format parameters
- Replaces C-style cast with reinterpret_cast
- Ensures consistent use of static_cast for type conversions
- Improves comment formatting

This refactor maintains the original logic while aligning with modern
C++ best practices.
2025-06-20 10:49:23 -05:00
trompetin17 0396d67d26 Apply consistent naming to member variables in ogg.cpp
Renames local variables in the class to follow the member naming
convention using the m_ prefix (e.g., m_Adapter, m_VF, m_FileEOF).
2025-06-20 10:49:16 -05:00
trompetin17 6b9652050c Use std::copy_n in VorbisBufferAdapter::Read
Replaces a raw memcpy call with std::copy_n in VorbisBufferAdapter::Read
for improved type safety and readability. This ensures cleaner buffer
copying using standard C++ algorithms, avoiding manual pointer
arithmetic on void*.

The change is functionally equivalent but aligns better with modern
C++17 practices.
2025-06-20 09:04:09 -05:00
trompetin17 1d20adc3b9 Ensure brace initialization for member variables in Ogg classes
This commit updates the Ogg-related classes to use uniform brace
initialization ({}) for member variables where applicable. Brace
initialization improves clarity and prevents potential narrowing
conversions or unintended behavior caused by default constructor
ambiguity.

This change improves consistency and aligns with modern C++ best
practices, especially in C++11 and later where brace initialization is
recommended for safer initialization semantics.
2025-06-20 09:04:01 -05:00
trompetin17 2ae95d3c49 Refactor OggStreamImpl to use exceptions for error handling
Introduce a new `Open` method in `OggStreamImpl` that encapsulates the
logic for opening Ogg Vorbis files. This method replaces the previous
`Open` method and utilizes `std::runtime_error` for error reporting
instead of returning error codes. The constructor has been updated to
call this new method, ensuring files are opened upon instantiation. The
changes streamline the code and improve error handling.
2025-06-20 08:51:39 -05:00
trompetin17 336ff333ed Remove unused OpenOggStream method
OpenOggStream was previously used to stream Ogg files directly from the
file system. It operated on raw file paths (OsPath) and assumed
uncompressed, unarchived files, which made it unsuitable for working
with files inside archives or VFS layers.

However, its usage has been fully replaced by OpenOggNonstream, which:
- Reads the entire file into memory (non-streaming),
- Works with virtual file systems (VFS),
- Supports both archived and compressed assets,

Is already used consistently across debug and release builds.

There are no remaining references to OpenOggStream in the codebase, so
this commit removes the unused function and its associated logic.
2025-06-20 08:41:39 -05:00
Itms 406565f3c4 New appdata entry for A27.1
Fixes #7986
2025-06-20 11:48:53 +02:00
Ralph Sennhauser 4c165dd208 Update some includes for iwyu part 1
First batch of fixes to please include-what-you-use.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-20 09:01:19 +02:00
phosit 1652e82021 Use std::unique_ptr for CSimulation2Impl
Using a `std::unique_ptr` it's explicit that the data is owned by the
`CSimulation2`.
2025-06-19 22:12:52 +02:00
phosit 2d43ca6462 Make rmgen2 modules
As rmgen2 depends on rmgen it has to be converted to modules before
that.
rmgen2 contains some globals which don't have to be exposed.

Refs: #8081
2025-06-19 19:07:08 +02:00
phosit 93666d8628 Remove ignore_result
`std::ignore` serves the same purpose and is C++ standard.
2025-06-19 19:05:56 +02:00
trompetin17 5b8cb7f34b Support std::optional in FromJSVal
This commit introduces support for std::optional<T> in
Script::FromJSVal. When a JavaScript value is undefined or null, the
resulting optional is set to std::nullopt; otherwise, the value is
converted and wrapped.

This change allows components to cleanly handle optional script values
without needing manual null checks or exception handling in C++.

As a direct application of this feature, the Identity component now uses
std::optional<std::wstring> for the return value of GetCiv(). This
resolves a bug where formation templates (e.g., those inheriting from
template_formation.xml) do not explicitly define a civ. After commit
03f7903fec, the code assumed GetCiv() would always return a valid
string, leading to undefined behavior when it was missing.

With this update:
- GetCiv() returning undefined results in an empty optional.
- The Identity component defaults to an empty civilization string ("")
  when the civ is not defined.
- This avoids crashes or actor parsing errors for civ-less templates and
  improves robustness in script-C++ interaction.

Closes: #8107
Fixes: #8091
2025-06-19 08:52:24 -05:00
trompetin17 007b4f5db7 Improve error logging for failed JS-to-C++ script conversions
Previously, if a JavaScript function returned a value that failed to
convert to the requested C++ type (e.g., from JS undefined to
std::wstring), the ScriptInterface would fail silently, making debugging
difficult.

This commit improves the error reporting in the script system by logging
the name of the JavaScript function being called when a type conversion
failure occurs. This makes it easier to trace and fix issues arising
from script-side inconsistencies or missing return values.

The improved logging is particularly useful for debugging errors such as
undefined civ values from GetCiv() when used via m_Script.Call<T>().
2025-06-19 08:52:23 -05:00
Itms aaccd6ba97 Explictly set the LFS remote URL for all forks
As the Gitea LFS server does not abstract access to LFS remotes
(see https://github.com/go-gitea/gitea/issues/17715), it is necessary to
explicitly set the main repository as LFS storage, including for forks.
2025-06-19 12:53:26 +02:00
Ralph Sennhauser ddb738b17d Remove empty cpp file vfs_path.cpp
Once upon time there was content but no more, so remove it.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-19 09:03:38 +02:00
Ralph Sennhauser 0108ff51f4 Fix no-pch build after b34f4b79aa
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-18 21:12:33 +02:00
phosit 11b92f784f Decrease interval of hotload check on mac
There are 8 hotloads in the tests. When each takes 1 second that adds 8
seconds to the tests. Decrease the interval value to an acceptable
number.
2025-06-18 14:42:13 +02:00
Stan 85bb494c17 Catch more file changes on mac 2025-06-18 14:42:13 +02:00
Stan 6a0dfa6dc1 Test whether some files are reloaded more directly
Add a way to tell whether `ReloadChangedFiles` actually catched events
by returning `INFO::SKIPPED` when it didn't.
Unlike GUI apps, you have to explicitely tell macOS to punp events in
console apps thus add a loop in the tests.
2025-06-18 14:42:13 +02:00
Stan 2a47bbf096 Use a mutex to syncronize g_QueuedDirs
`g_QueuedDirs is accessed by multiple threads. It has to be syncronized.
2025-06-18 14:42:13 +02:00
Stan 8b58d8865c Don't use ".." to get the data-directory
`sys_ExecutablePathname().Parent()/".."/"data";` was causing realpath to
pail on macOS, because ".." doesn't match any directory.
2025-06-18 14:42:13 +02:00
phosit 0698243dd1 Don't skip tests on mac
The tests where accidetally skipped on mac because it's treated as BSD.
2025-06-18 14:42:13 +02:00
phosit d9795d29fe Remove the name of some unused arguments
Remove some usage of the `UNUSED` macro. Remove only those cases where
the names can be deduced from their type.

https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-unused
2025-06-18 12:49:59 +02:00
trompetin17 084b141ecc Fix MatchSettingsDialog after b34f4b79aa
Reported by wow on irc:
ERROR: JavaScript error:
gui/session/match_settings/MatchSettingsDialog.js line 55 undefined has
no properties
rebuild@gui/session/match_settings/MatchSettingsDialog.js:55:3
init@gui/session/session.js:320:3
reallyStartGame@gui/loading/loading.js:22:9  ERROR: GUI page
'page_session.xml': Failed to call init() function
2025-06-17 23:27:18 -05:00
Ralph Sennhauser 657be906fe Cleanup use of boost::filesystem
Suppressing boost warnings is already covered by how we include
libraries if there are actually still any of them relevant.

Then the v2 vs v3 stuff is obsolete as boost ships with filesystem v4
this days.

Lastly injecting a namespace alias via pch header is questionable, so
just don't.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-17 21:56:04 +02:00
Vantha fd847c2a23 Refactor GUI object resizing JS code passages
It is possible to modify sizes by setting the properties directly.
(Without having to create a copy of it)
This allows to shorten those passages quite a bit without any functional change.
2025-06-17 12:57:37 -05:00
trompetin17 b34f4b79aa Allow setting CGUISize properties directly
Previously, modifying individual CGUISize properties (left, top, right,
bottom) via JavaScript had no effect unless the entire size object was
copied, modified, and reassigned—resulting in verbose and error-prone
code.

This update introduces proper JavaScript property accessors, enabling
direct reading and writing of CGUISize members. The result is a more
intuitive and scriptable API.

Key Changes:
- Implemented JavaScript get/set accessors for each CGUISize property,
  directly interacting with the native object.
- Retained support for string assignments to CGUISize
- Maintained the GUISize JS object for backward compatibility, also
  marked as deprecated.
- Improved CGUISimpleSetting<CGUISize> to allow partial updates via
  direct property access.
- allow assigning size from object with pixel and percent values

You can now assign size using an object with properties like:
size = {
  left: number, right: number, top: number, bottom: number,
  rleft: number, rright: number, rtop: number, rbottom: number
}

- One or more properties can be specified, the missing properties with
  fill as zero.
- Assignment triggers an immediate update event.

Delayed Setting Notifications:
- Introduced a mechanism for delayed setting notifications, currently
  only used in CGUISimpleSetting<CGUISize>, to avoid redundant
  recalculations.
- Ensured that getComputedSize triggers any pending delayed
  notifications before returning the size.

This change significantly enhances the developer experience and brings
the behavior in line with typical expectations for direct property
manipulation in JavaScript.
2025-06-17 12:57:33 -05:00
Ralph Sennhauser b382a4c47a Enable eslint rule 'no-sparse-arrays'
Enable recommended rule 'no-sparse-arrays' [1] and manually fix
violations. Solution proposed by elexis.

[1] https://eslint.org/docs/latest/rules/no-sparse-arrays

Fixes: #8068
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-17 19:21:19 +02:00
trompetin17 9a4708cb71 Remove ignore LNK4098 2025-06-17 11:26:06 -05:00
trompetin17 8d957ec91d Remove hardcoded library linking pragmas from vorbis.h 2025-06-17 11:26:05 -05:00
trompetin17 ba67208b22 Remove zlib library linking pragma 2025-06-17 11:26:04 -05:00
trompetin17 c1751cd8e8 Remove libpng library linking pragma 2025-06-17 11:26:04 -05:00
trompetin17 cd4aebbb90 Remove unnecessary pragma comment for OpenAL 2025-06-17 11:26:03 -05:00
trompetin17 c375d9ba67 Add SDL2 linking configuration to premake 2025-06-17 11:26:03 -05:00
trompetin17 6fc46c16f4 Update SVN revision to 28262 in get-windows-libs.bat 2025-06-17 11:26:02 -05:00
trompetin17 59ff5d912f Add oleaut32 library support and remove unnecessary pragma comment 2025-06-17 11:25:54 -05:00
Ralph Sennhauser 91df65d64c Enable eslint rule 'require-yield'
Enable recommended rule 'require-yield' [1] and manually fix violations.

[1] https://eslint.org/docs/latest/rules/require-yield

Ref: #8068
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-17 16:26:49 +02:00
Ralph Sennhauser 14bb7730fe Enable eslint rule 'no-useless-escape'
Enable recommended rule 'no-useless-escape' [1] and manually fix violations.

[1] https://eslint.org/docs/latest/rules/no-useless-escape

Ref: #8068
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-17 15:20:06 +02:00
Ralph Sennhauser f29f0b7fd1 Enable eslint rule 'no-prototype-builtins'
Enable recommended rule 'no-prototype-builtins' [1] and manually fix violations.

[1] https://eslint.org/docs/latest/rules/no-prototype-builtins

Ref: #8068
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-17 13:47:11 +02:00
Ralph Sennhauser f87d266e4e Enable eslint rule 'no-fallthrough'
Enable recommended rule 'no-fallthrough' [1] and manually fix violations.

[1] https://eslint.org/docs/latest/rules/no-fallthrough

Ref: #8068
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-17 12:20:51 +02:00
Ralph Sennhauser 57e72b01ae Enable eslint rule 'no-case-declarations'
Enable recommended rule 'no-case-declarations' [1] and manually fix violations.

[1] https://eslint.org/docs/latest/rules/no-case-declarations

Ref: #8068
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-17 11:44:28 +02:00
Mentula 0 A.D. cb2717faba Add support for bird's eye camera view
A new hotkey "hotkey.camera.togglebirdseyeview" allows to switch
between regular view and bird's eye (top-down) view.

When bird's eye view gets toggled on, the camera moves above the scene;
When bird's eye view gets toggled off, the camera moves back to the
default vertical rotation angle;
When bird's eye view is on, vertical rotation is disallowed.
2025-06-16 20:01:07 +02:00
Ralph Sennhauser 617e438fad Enable all recommended eslint rules that are clean
This rules can all be enabled without any code changes, meaning we
already follow them properly.

Ref: #8068
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-16 19:07:53 +02:00
trompetin17 8e255af185 Fix mods configuration stacking and mergin per mod
Previously, the engine only loaded the last mod’s `config/mod.cfg` file,
causing earlier mods' configuration settings to be ignored. This broke
the expectation of stackable mod behavior and affected features relying
on custom config, such as font overrides.

This commit updates the mod mounting and configuration process to:

- Mount each mod's files before attempting to load its config.
- Reload each mod's `config/modname.cfg` via `g_ConfigDB.Reload(CFG_MOD)`
  after mounting.
- Merge configuration keys into the CFG_MOD namespace:
  - If a key exists, its value is updated.
  - If not, the key is added.

This behavior now aligns with the VFS override system, where later mods
take precedence but earlier mods still contribute.

Also adds `_test.mods` for validation.

Fixes edge cases for mod authors who rely on consistent and layered
configuration overrides.

Related: #6383, #1810
Fixes: #8060
2025-06-16 11:03:09 -05:00
trompetin17 7ccda26f34 Use cppdialect "C++17" instead of per-action buildoptions
Premake 5.0.0-alpha12 (released in August 2017) introduced the
`cppdialect` directive, which provides a cleaner and more portable way
to specify the C++ standard across compilers and platforms.

Previously, we used manual per-action buildoptions:

filter "action:vs*" buildoptions { "/std:c++17" }
filter "action:not vs*" buildoptions { "-std=c++17" }

This workaround was necessary due to the limitations of older Premake
versions (particularly Premake 4), which lacked built-in support for
setting the C++ language standard.

Now that we're using a newer version of Premake 5, we can simplify this
setup by using:

cppdialect "C++17"

This results in cleaner, more maintainable build scripts with consistent
behavior across toolchains.
2025-06-16 07:35:43 -05:00
Dunedan bd15b87be6 Remove the limit of the available graph colors
Previously the number of graph colors was limited, which resulted in the
reuse of colors if many different profiling regions or reports were
displayed. This commit changes so unique colors are generated for
each region/graph, by utilizing the beauty of the golden ratio.
2025-06-16 08:17:38 +02:00
Dunedan 1a65267b83 Remove unnecessary hslToRgb() utility function
We can use the `hsl()` function provided by CSS directly in the
profiler2 UI, instead of using a custom utility function.
2025-06-16 08:16:34 +02:00
Dunedan 256e3819df Use other composition for multiple graphs
"lighten" would result in a disappearing graph when too many graphs
overlapped, "exclusion" looks much better in this situation.
2025-06-16 08:16:24 +02:00
Lancelot de Ferrière ff754b8bb1 Reset modifiers properly when changing ownership
The ModifiersManagers needs to reset caches and recompute modifiers when changing ownership. However, the code only did this for global modifiers for the new player entity, not the old player entity. This meant we would not reset all modifiers, and could OOS (#7996) or lead to incorrect values.

Fixes #7996

Reported by: Itms
2025-06-15 21:37:00 +02:00
Ralph Sennhauser 58219b974c Fix trailing whitespace and add pre-commit hook
Some have their editor configured to remove trailing whitespace and
editing such a file would "fix" it, adding an unrelated change.

Fix whitespace violations excluding third party libs and generated files
like glad or patches.

Enable pre-commit hook trailing-whitespace to enforce it in the future.

Fixes: #8016
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-15 20:08:48 +02:00
Langbart e6ad1141fd fix(atlas): Fix ship placement in Atlas
- Changed the obstruction check to use the unit's passability class.
Ref: https://code.wildfiregames.com/rP16149

Fix: #8053
2025-06-15 19:24:49 +02:00
Vantha 7938a120d1 Rename the 'Objectives' dialog to 'Match Settings' 2025-06-15 19:24:03 +02:00
Ralph Sennhauser 2f54155219 Don't list disabled rules in eslint extra
Disabled rules are the same as not listed rules of which there are many,
keep them out of the config.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-15 18:42:54 +02:00
Ralph Sennhauser 782443c543 Explicitly disable eslint rule 'no-unused-vars'
They way the project is structured this isn't really usable for now but
might change with move to ESM modules.

See: https://eslint.org/docs/latest/rules/no-unused-vars

Ref: #8068
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-15 18:42:54 +02:00
Ralph Sennhauser 10f331271e Explicitly disable eslint rule 'no-undef'
They way the project is structured this isn't really usable for now but
might change with move to ESM modules.

See: https://eslint.org/docs/latest/rules/no-undef

Ref: #8068
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-15 18:42:54 +02:00
trompetin17 c0a3f2d885 Preload common glyphs after font load to reduce rendering delay
To improve visual consistency during dynamic font rendering, especially
on lower-end machines or during low FPS moments, we now preload a set of
common Latin letters, digits, and punctuation glyphs immediately after a
font is loaded by the FontManager.

This reduces the likelihood of users seeing empty or missing characters
on the first frame after a font is used, minimizing visual glitches
during simulation.

The preloaded characters include:
- Uppercase and lowercase Latin letters (A–Z, a–z)
- Digits (0–9)
- Common punctuation and symbols (e.g., .,;:!?()[]{}<> etc.)

This change helps smooth the user experience and avoids blank spaces
during the initial rendering of text in performance-constrained
scenarios.
2025-06-15 08:05:12 -05:00
Stan 03f7903fec Make rallypoints moddable.
Allow use of {civ} tags in templates to simplify mod dependencies and inheritance.

Reviewed-On: #8038
Reviewed-By: @phosit
2025-06-15 07:43:08 +02:00
Dunedan 92ef4ffa19 Improve profiler2 analysis graphs
This removes the padding from the start and the end of the frequency
graphs, to remove the inaccurate steps it caused.

It also improves the smoothness of the frequency and frame-to-frame
graphs by painting each graph as a single line, instead of one line per
data point.
2025-06-14 15:02:44 +02:00
Ralph Sennhauser 97a82cbc4a Enable eslint rule 'no-redeclare'
Enable recommended rule 'no-redeclare' [1] and manually fix violations.

[1] https://eslint.org/docs/latest/rules/no-redeclare

Ref: #8068
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-14 14:53:10 +02:00
Ralph Sennhauser d5f4c812ea Improve CC detection using premake
Before premake 5.0.0-beta3 if --cc wasn't specified the gnu make default
was used unless overridden via env.

Now premake always chooses a compiler sidestepping gnu make choice. So
use the premake pick unless explicitly overridden via CC in env or via
option to premake.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-14 14:13:16 +02:00
Ralph Sennhauser ead2fbc115 Improve clang default toolset on BSD
The gmake action has a separate idea as to what the default toolset
should be, add that to the patch fixing the default for BSD.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-14 14:13:09 +02:00
Ralph Sennhauser 8b98a7a27c Enable eslint rule 'no-extra-boolean-cast'
Enable https://eslint.org/docs/latest/rules/no-extra-boolean-cast

Ref: #8068
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-14 12:03:06 +02:00
Ralph Sennhauser 6a62dae166 Split eslint rules into recommended and extra
Eslint maintains a list of rules it recommends, split them into own
section for easy identification.

Further sort the rules and don't use magic values for severity.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-14 12:03:06 +02:00
phosit df5cdbe8f1 Load map scripts as modules
Because its a function `GenerateMap` is renamed to `generateMap`.

Allows to rewrite the libraries as modules and to remove the costum
`Engine.LoadLibrary` mechanism in the future.
2025-06-14 09:10:47 +02:00
Ralph Sennhauser 086e8ec09d Replace deprecated eslint rule 'no-negated-in-lhs'
The rule 'no-negated-in-lhs' was deprecated in eslint 3 [1], replace it
according to recommendation with 'no-unsafe-negation' and enable all
extras as our code already conforms.

[1] https://eslint.org/docs/latest/rules/no-negated-in-lhs.html

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-13 06:32:07 +02:00
Ralph Sennhauser 638c04987e Bump premake to version 5.0.0-beta6
This makes 5.0.0-beta5 the minimally supported version as the gmake2
action was renamed to gmake while gmake was renamed to gmakelegacy. So
from now on gmake action is to be used.

Clear out all old version dependent code.

Fixes: #7789
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-12 20:57:54 +02:00
Ralph Sennhauser f1d577be62 Add semver.lua for use by premake
Also extend it by compairsion operators <= and >=

This will probably also be useful for checking versions of dependencies.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-12 20:57:54 +02:00
trompetin17 4524460d9c Increase text size for capture, health, and resource stats in GUI panels
After FreeType integration in dfb4598186 font height and line spacing
were incorrectly applied. That caused UI elements like capture, health,
and resource stats to appear misaligned or invisible.

Commit c2d529b975 standardized font height usage, removed lineSpace, and
introduced GetCapHeight + Descender for better vertical alignment.

However, affected texts used a font-stroke-12 with a GUI size of 12,
which now renders lower in the container due to stroke and metric
offset. Increasing the size to 14 ensures the text is properly visible
and aligned.

This adjusts for the actual space font-stroke-12 occupies in rendering.

Fixes: #7962
2025-06-11 08:34:42 -05:00
trompetin17 79104db2c5 Revert "Fix position of the ingame release label"
This reverts commit dc156c3f24.

The original commit addressed incorrect UI alignment caused by improper
handling of font height and linespacing after FreeType integration
(introduced in 734386ce9f).

However, commit c2d529b975 corrected the root issue by standardizing
font metrics:
- Proper use of FreeType's height
- Removal of lineSpace
- Introduction of getCapHeight and Descender for accurate vertical
  alignment

As a result, the UI offset workaround is now obsolete and must be
reverted to reflect the correct baseline behavior.
2025-06-11 08:10:57 -05:00
trompetin17 b1123ff259 Revert "Fix element positions after new font rendering"
This reverts commit 52ee6ad470.

The original commit addressed incorrect UI alignment caused by improper
handling of font height and linespacing after FreeType integration
(introduced in 734386ce9f).

However, commit c2d529b975 corrected the root issue by standardizing
font metrics:
- Proper use of FreeType's height
- Removal of lineSpace
- Introduction of getCapHeight and Descender for accurate vertical
  alignment

As a result, the UI offset workaround is now obsolete and must be
reverted to reflect the correct baseline behavior.
2025-06-11 08:10:57 -05:00
trompetin17 dfb4598186 Align font height, capHeight to FreeType metrics
Previously, `height` was derived from a manually chosen glyph (typically
"I", Standard Cap Height) using FontBuilder, and `lineSpacing` was used
inconsistently for layout logic as a height.

Now, with the FreeType-based system:
- `height` uses `face->size->metrics.height`, which includes the
  recommended line height with internal leading/line gap as defined by
  the font designer.
- `lineSpacing` was removed
- `GetCapHeight` uses the standard cap height + ascender to have a
  visual virtual alignment

This change standardizes font metric usage:
- Use `height` for vertical layout and line progression.
- Use `GetCapheight` in layout engines like `CGUIText` or `CGUIString`,

This ensures better alignment across fonts and consistent spacing in
multiline text rendering.

Fixes: #7962
2025-06-11 08:10:18 -05:00
Dunedan 638d4d28d2 Use the official eslint pre-commit hook
Recently eslint added official support for pre-commit, so let's use
their official pre-commit hook instead of a third-party one.
2025-06-11 13:22:44 +02:00
Itms 994645930c Move maps XML files out of LFS
Fixes #7519.

Reviewed-By: Dunedan
Reviewed-On: https://gitea.wildfiregames.com/0ad/0ad/pulls/8014
2025-06-11 10:33:57 +02:00
Carl-O a2830603b4 Capitalize first letter in ancient Egyptian
Reviewed-By: Stan
Reviewed-On: https://gitea.wildfiregames.com/0ad/0ad/pulls/8041
2025-06-10 23:12:59 +02:00
Carl-O c772b3ad89 Fix gaul Assembly SoundGroups
Make the sound consistent with its Athenian and Spartan counterparts.

Reviewed-By: Stan
Reviewed-On: https://gitea.wildfiregames.com/0ad/0ad/pulls/8040
2025-06-10 23:07:17 +02:00
Vantha 6a7ad264e4 Add pitch-rolling to some bush and grass props
Fixes the issue that they noticably stick out horizontally when placed on slopes.

(thanks to the previous commit these values will be adopted by the "special/actor" template when loading it in)

Reviewed-By: Itms
Reviewed-On: https://gitea.wildfiregames.com/0ad/0ad/pulls/7542
2025-06-10 23:01:09 +02:00
Vantha eb2f59eeaa Allow actors to override the entity's anchor type
Optionally let actor templates define their own anchor types.
These override the default value defined in the template.
Useful for actors without their own entity template.

Reviewed-By: Itms
Reviewed-On: https://gitea.wildfiregames.com/0ad/0ad/pulls/7542
2025-06-10 23:01:09 +02:00
Ralph Sennhauser 0ce889ca6d Use stylistic for deprecated eslint rules
During the eslint 8 cycle the formatting rules were split out [1],
deprecating the corresponding rules in core.

This replaces all rules that where moved to @stylistic/eslint-plugin [2]
and accounts for the difference in the indenting rule behaviour.

To allow the pre-commit import hack to continue to work with the
stylisitc plugin for a recent nodejs version to be used.

[1] https://eslint.org/blog/2023/10/deprecating-formatting-rules/
[2] https://eslint.style/packages/default

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-10 21:23:23 +02:00
Stan ff03dd45c4 Adjust log path to use XDG_STATE_HOME
Also move logs/ log/ so that it's more in line with /var/log/

Fixes: #7960
Pull Request: #8045
2025-06-07 12:39:03 +02:00
phosit 05869454e5 Disalow importing some files
Not all modules should be able to load all other modules. A predicate
function can to be passed to the `ScriptInterface`. That function
returns whether the module is allowed to loat the module. If no
predicate is passed in no modules can be loaded through that
`ScriptInterface`.
2025-06-06 17:36:35 +02:00
phosit 6492bc705a Allow modules to be hotloaded
Reload a module when it's script file got changed or when one of it's
imported modules got reloaded.

This doesn't work for dynamic `import`s.
2025-06-06 17:36:35 +02:00
phosit 4043f954a7 Allow mods to write appendices
Module local values are visible to Appendixes. This mechanism can be
used for mods.
2025-06-06 17:36:35 +02:00
phosit d76e107dca Support the import.meta property
Through the `import.meta` property the engine can pass some values to
the module. Currently only the `path` of the script file is exposed.
2025-06-06 17:36:35 +02:00
phosit a40caaffc4 Support dynamic import
The static `import` should be prefered over the dynamic but it might be
usefull when loading an object from a json file.
2025-06-06 17:36:35 +02:00
phosit 252df0a1db Return the namespace of a module
To make it easy for the engine to access the exported values the
namespace is returned from the future.
2025-06-06 17:36:35 +02:00
phosit d26d9b9b2b Rethrow exceptions from the top level of a module 2025-06-06 17:36:35 +02:00
phosit ce01bdddf6 Allow to check whether modules finished evaluating 2025-06-06 17:36:35 +02:00
phosit 32ef4fd0fa Normalize module-path
Modules indipendant of the path, should only be evaluated once.
2025-06-06 17:36:35 +02:00
phosit c6d42ebbd5 Support JavaScript modules
- With modules JavaScript code can be split up into multiple files. We
	already implemented such a mechanism (`Engine.LoadLibrary`) in
	multiple parts of the engine. The advantage of using modules is
	that it's standart (JS-devs are familiar with it) and it doesn't
	has to be implemented multiple times.
	Note that `Engine.LoadLibrary` loads all files in a directory
	while the new `import` only loads one file.

- With modules seemingly global variables are local to that
	script/module. We already implemented such a mechanism
	(`ScriptInterface::LoadScript`).
2025-06-06 17:36:35 +02:00
Ralph Sennhauser 475053ea7c Fix copyright linter invocation
Requires HEAD to point to --to <commitish> for the files to be in the
state for copyright.py to produce expected results. Which isn't the case
in the gitea workflow.

Also use plumbing commands to on one hand make it more robust and on the
other hand to avoid bad files only in --from <commitish> to leak into
the check.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-04 21:12:25 +02:00
trompetin17 c3d3943047 Fix incorrect shadow behavior in VisualActors
This commit primarily corrects an inaccurate comment and resolves a
hidden bug in the VisualActor shadow logic, while preserving the current
behavior.

Previously, the DisableShadows option removed both casting and receiving
shadows. However, the internal logic ignored this setting in some cases,
causing shadows to appear even when explicitly disabled in XML
templates.

This change introduces the ability to control CastShadows and
ReceiveShadows independently via template settings, defaulting both to
true unless explicitly specified.

In addition, previews are updated to receive shadows but not cast them,
improving visual volume effects without affecting lighting behavior.
2025-06-03 19:30:10 -05:00
Ralph Sennhauser 8ec21aac53 Group documentation pages
All documentation pages are made subpages of a page Documentation, this
helps browse documentation not directly tied to source code.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-03 20:44:39 +02:00
trompetin17 4dc686564e Fix FreeType font loading from zipped mods
The FreeType font loader was directly passing filesystem-style paths
(e.g., mod.zip/...) to FT_New_Face, which does not support paths inside
ZIP archives. As a result, FreeType failed to open the font, triggering
a crash when the engine attempted to use an invalid face object.

This patch changes the font loading logic to:

Use the VFS to read the .ttf font file into memory (shared_ptr<u8> and
size).

Load the font using FT_New_Memory_Face with the in-memory buffer,
ensuring compatibility with zipped mods.
2025-06-03 11:20:56 -05:00
elexis 67eaa8f1a9 Fix change perspective in replays
Fixes change perspective features of multiplayer replays following cheat
protection in 023527e56e.

Fixes: #8020
2025-06-03 13:52:26 +02:00
trompetin17 81dfd51eb3 Fix hard crash when terrain is missing from map
Previously, opening a map that referenced a deleted or missing terrain
caused a severe crash with multiple error dialogs, forcing users to kill
the process. This change restores the previous behavior where missing
terrains are gracefully handled: a warning is logged and the terrain is
substituted with a fallback placeholder (ErrorTexture from
TextureManager).

This significantly improves UX for developers and modders working with
outdated or broken maps, aligning behavior with expectations from
earlier versions of the editor.
2025-06-02 00:29:03 -05:00
Ralph Sennhauser 9dfc638b80 Add Win64 pipeline support
Extends the current Windows pipeline to also build for AMD64. While at
it use a matrix build.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 20:51:39 +02:00
Ralph Sennhauser 623e7f7a47 Disable warning LNK4098
Even with lots of effort [1] to isolate the offending library there is
little to be had, as such disable the warning.

[1] https://gitea.wildfiregames.com/0ad/0ad/pulls/7798#issuecomment-119332

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 20:51:39 +02:00
Ralph Sennhauser 241b9f0952 Add missing Win64 dbghelp dlls
Bump svn libs version to get dbghelp.dll and dbgcore.dll.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 20:51:39 +02:00
Ralph Sennhauser a8e0e50ae5 Use Bit instead of BIT
The BIT macro is compile time only anyway. Takes care of the warning
"C4334 - <<': result of 32-bit shift implicitly converted to 64 bits".

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 20:51:39 +02:00
Ralph Sennhauser 06e2f0bcc3 Fix cast to void for Win64
Make what could be considered a legendary hack less brittle.

    C4312: 'reinterpret_cast': conversion from 'long' to 'void *' of greater size

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 20:51:39 +02:00
Ralph Sennhauser e1e1e42939 Update fmt and libxml2 for Wind64
Bump svn rev for libs to get fmt and libxml2 fixes.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 20:51:38 +02:00
Ralph Sennhauser b527e6b870 Fix check for availability of wxWidgets for Win64
In premake we check for wxWidgets on Windows to see if we can build
Atlas, this check wasn't adopted when adding support for Win64.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 20:51:38 +02:00
Ralph Sennhauser fb56668dd9 Fix size mismatch in shift operation for Win64
Msvc complains about C4334 - 32bit/64bit shift.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 20:51:38 +02:00
Ralph Sennhauser 58b70719be Disable conversion warnings on Win64
Those warnings aren't enabled for gcc and clang currently either, so
just disable them for msvc as well.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 20:51:38 +02:00
Ralph Sennhauser 904dffdaba Disable warnings for Mongoose on Win64
Mongoose is on the way out, and it's not like the same issue isn't
present for other 64bit platforms, we just don't have those warnings
enable there.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 20:51:38 +02:00
Ralph Sennhauser ef7f1d336c Move errorlist.pl from build to tools
The target file is checked in into vcs so this tool isn't used during
build and as such better lives in source/tools.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 20:42:44 +02:00
Ralph Sennhauser 4463e9480a Remove leftovers of arclint
All linting was ported to pre-commit or gitea workflows, the only thing
left is an adapter to output to Phabricator which is no longer in use.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-01 13:25:24 +02:00
Ralph Sennhauser 895cb63c4a Add --build-archive to spidermonkey build.sh
This option allows to build the spidermonky archive hosted by WFG from
the upstream firefox tarball.

First this serves as documentation as to how the taball is created and
by integrating it into the regular build process allows to easely bump
spidermonky version for local testing.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-31 17:10:10 +02:00
Stan 167020c05c Fix broken build restrictions
In f3ac9e9669 the fail condition was broken causing it to allow building on restricted areas.

Add a test to ensure correct behavior for this case.

Reported by: @wowgetoffyourcellphone
Pull Request: #8021
2025-05-31 10:58:14 +02:00
Stan d3017b6f9c Fix error spam in Atlas
Atlas has no notion of player removal. Each entity would trigger an error in Player.js

Reported by: @trompetin17
Reviewed by: @trompetin17
Pull Request: #8006
2025-05-30 19:23:32 +02:00
Ralph Sennhauser 02e15da51b Add eslint pre-commit hook
This replaces the old arclint eslint setup 1:1 rule wise, only porting
the configuration to a format recent eslint can read.

Further remove the arclint setup as it is no longer of use.

Thanks to Stan for reviewing all needed fixes to Javascript code to
allow for adding this without compromises.

Fixes: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-30 17:30:25 +02:00
Ralph Sennhauser 666ffb0f18 Fix new and profiler eslint warnings
This fixes 'no-trailing-spaces', 'semi', 'prefer-const' that made it in
since and 'no-shadow', 'no-multi-assign', 'no-invalid-this' as well as
'no-undef-init' in profiler.

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-30 15:25:54 +02:00
phosit d98a205feb Don't pass report explicitly in ReportDraw
The function declaration binds `report` implicitly.

Ref: #7812
2025-05-30 14:16:32 +02:00
phosit e0ed2ae0c8 Replace var in inner scopes from ReportDraw
Variables declared with `var` are also accible after accessing the
scope. This lead to shadowing because variables with the same name are
declared in a later scope.

Ref: #7812
2025-05-30 14:16:31 +02:00
phosit 07ed959422 Remove IIFE in ReportDraw
Since variables declared with `var` don't respect all scopes, when used
in a loop it doesn't create a new variable each iteration. The
initializer value is always assigned to the same variable. That makes
problems when the variable is used in a callback. To work around that
the variable is copied in to a IIFE.
When not using `var` the iife isn't required.

Ref: #7812
2025-05-30 14:16:18 +02:00
phosit 61de7ccbfc Don't use this in do_zoom callbacks
Ref: #7812
2025-05-30 13:22:06 +02:00
phosit 0e9d2a8d5e Remove outInterface from ReportDraw
Only return the one function which is actually used.

Ref: #7812
2025-05-30 13:21:59 +02:00
phosit 83f2a34a50 Make canvas local in ReportDraw
Ref: #7812
2025-05-30 13:21:41 +02:00
trompetin17 d323797d98 Add glyph debug box rendering for font system
This commit introduces optional debugging visuals for font glyph
rendering. When enabled, each glyph is drawn with a surrounding debug
box to aid in visual inspection of glyph layout, spacing, and atlas
behavior.

Usage examples (via console):

// Enable debug box rendering
Engine.ConfigDB_CreateValue("user","fonts.debugBox", true);

// Set debug box color (R G B)
Engine.ConfigDB_CreateValue("user","fonts.debugBoxColor", "35 0 35");

This feature is intended for developers working on font layout or atlas
generation logic, and has no effect on normal gameplay or UI rendering
when disabled.
2025-05-29 06:23:20 -05:00
Ralph Sennhauser 8b1c6c76b6 Make Profiler2Report a class and make eslint happy
This removes all global code and fixes eslint warnings 'no-shadow' and
'no-undef-init'. Leave other possible improvement style wise for an
other time.

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-29 11:03:13 +02:00
Stan b36782388b Allow removing player entities when starting a match. 2025-05-28 23:05:36 +02:00
Ralph Sennhauser e4e80a2504 Use trigger hook to init map Flood
Eslint doesn't like the global return and fails to parse the trigger
script file. Rewrite the script to avoid this and any globals while at
it. Also use OnInitGame as the execution with an IIFE in global scope
wouldn't guarantee when it will be executed or whether the timer
component is already registered.

Further don't concat the warning string as the extraction script for
translation expects a literal.

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-28 20:21:24 +02:00
Ralph Sennhauser 7583c4f241 Fix remaining eslint warnings
Fix instances of semi, no-unreachable, space-unary-ops, and no-invalid-this.

Manual fixes needed for:
eslint --config full.mjs

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-28 19:51:10 +02:00
Ralph Sennhauser 97d76b1495 Fix eslint rule 'prefer-const'
Manual fixes needed for:
eslint --no-config-lookup --rule '"prefer-const": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-28 19:34:46 +02:00
Ralph Sennhauser f3ac9e9669 Fix eslint rule 'default-case'
Manual fixes needed for:
eslint --no-config-lookup --rule '"default-case": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-28 19:24:50 +02:00
Ralph Sennhauser d37811d42c Fix eslint rule 'no-invalid-this'
Manual fixes needed for:
eslint --no-config-lookup --rule '"no-invalid-this": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-28 17:18:33 +02:00
Lancelot de Ferrière e930cf893e Align SM GC time budget with manual GC time budget
6 milliseconds now used everywhere.
2025-05-28 10:14:34 +02:00
Lancelot de Ferrière e3e542b1f9 Always allow last-ditch GCs
As noted on #7979, we run into OOMs since commit af32d386b9. The reason is that the default incremental GC budget is unlimited, which actually doesn't perform incremental GCs. Our settings can lead to situation where the incremental GCs don't actually sweep, thus not freeing memory.
SM has a mechanism to avoid OOM anyways with LAST_DITCH GCs, but by default these can only occur ever 30 seconds. Turn this off.

Reported by: langbart
2025-05-28 10:14:20 +02:00
trompetin17 2781d9a6a3 Add Fallback Font support
In previous fontbuilder.py we have the capacity to specified chain fonts
when a glyph is missed from one font.

This commit enable that behavior.
2025-05-28 01:01:03 -05:00
trompetin17 e024f5c88b Fix blurry text by aligning glyph positions
Text rendering appeared blurry due to subpixel positioning when using
LINEAR filtering. Replaced glyph position calculation with std::ceilf()
to ensure integer-aligned drawing coordinates and crisper text.
2025-05-27 21:30:57 -05:00
Vantha b772ebc262 Small normal map improvement 2025-05-27 22:19:24 +02:00
Ralph Sennhauser 03fd1acd5d Fix memory leak wrt renderer instance
The renderer instance is created with new, so use delete.

Direct leak of 80 byte(s) in 1 object(s) allocated from:
    #0 0x7fd3c932870b in operator new(unsigned long) (/usr/lib/gcc/x86_64-pc-linux-gnu/15/libasan.so.8+0x12870b)
    #1 0x55bbedf25fb0 in InitGraphics(CmdLineArgs const&, int, std::vector<CStr8, std::allocator<CStr8> > const&, ScriptContext&, ScriptInterface&) ../../../source/ps/GameSetup/GameSetup.cpp:654
    #2 0x55bbed2bb95e in RunGameOrAtlas ../../../source/main.cpp:684
    #3 0x55bbed271b28 in main ../../../source/main.cpp:759
    #4 0x7fd3c665f3ed in __libc_start_call_main (/lib64/libc.so.6+0x263ed)

Fixes: #7951
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-27 20:36:48 +02:00
Ralph Sennhauser ba9dcd8146 Fix eslint warnings for 'gamestate.js'
Fixes 'no-invalid-this' by converting to arrow function as thisArg is
only accepted by eslint for inlined function, "free" function might be
used in another context.

Also fixes 'consistent-return' and 'default-case' adn while at it
simplify the logic a bit.

Manual fixes needed for:
eslint --config full.mjs binaries/data/mods/public/simulation/ai/common-api/gamestate.js

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-27 19:25:30 +02:00
Dunedan f00dff380d Refactor validate_dae.py for more speed
This refactors validate_dae.py to utilize multiple CPU cores. This makes
it significantly faster. It also improves code quality and adds commands
line options.
2025-05-27 08:05:13 +02:00
Dunedan 4b3d7f018b Improve find_files implementation
Instead of listing files recursively for each directory manually, this
uses the built-in glob functionality of Python's pathlib.Path. As
part of this the found paths are returned as generator instead of a
list. Together this results in easier to read code and better
performance.
2025-05-27 07:32:51 +02:00
Vantha 279233aca1 Two improved normal maps 2025-05-27 07:26:33 +02:00
trompetin17 bdd94bd264 Add font engine aware of Gui.scale
This commit enhances text rendering by leveraging FreeType and a dynamic
font atlas. Previously, GUI scaling relied on bitmap fonts, which led to
blurry and distorted text when scaling up. Now, we scale the font size
directly using FreeType, resulting in much sharper and more readable
text at any GUI scale.

Key improvements:
- Replaced bitmap font scaling with true font size scaling via FreeType.
- Reduced glyph cache dependency on fixed positions, relying on shader
  scaling instead.
- Switched to float-based glyph positioning for more accurate rendering
  and scaling.

These changes ensure clean and consistent text appearance across
different GUI scales.
2025-05-26 13:12:47 -05:00
Ralph Sennhauser 189ec6a7eb Fix eslint rule 'brace-rules'
Manual fixes needed for temporary config braces-rules due to setting up
required plugin:
eslint --no-config-lookup --config brace-rules.mjs

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-26 19:23:19 +02:00
Ralph Sennhauser 8b13be3b03 Fix eslint rule 'consistent-return'
Manual fixes needed for:
eslint --no-config-lookup --rule '"consistent-return": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-26 18:54:52 +02:00
Dunedan b42ea94c3c Update the pre-commit hooks 2025-05-26 17:19:03 +02:00
Dunedan d111d4cc84 Specify the NodeJS version for markdownlint
Running the markdownlint pre-commit hook as Gitea Action fails for
markdownlint >=0.38.0, as the NodeJS version available in the Act Runner
Docker image so too old for that. To solve this, this commit specifies a
newer NodeJS version to use.
2025-05-26 17:18:58 +02:00
Dunedan 782bab293b Fix pre-commit workflow to work with Ubuntu 24.04 2025-05-26 16:42:05 +02:00
Dunedan a109b3973c Remove the need to change the working directory 2025-05-26 08:48:42 +02:00
Dunedan 5758430962 Simplify and speed up parent retrieval
This skips recursive parsing of the parents of an entity, as just its
direct parents are required by the implmentation. It also simplifies how
such calls are cached. This leads to much cleaner and faster code.
2025-05-26 08:48:42 +02:00
Dunedan 927165e1e5 Make unit_tables.py callable from other places 2025-05-26 08:48:42 +02:00
Dunedan 2b54697862 Fix overwriting previous error state
This fixes a problem where the previous error state got overwritten by
the result of validating meshes in checkrefs.py.
2025-05-25 12:23:58 +02:00
Dunedan 71c02cf658 Fix checkrefs.py return code
A typo in the assignment of the error state lead to checkrefs.py
existing with return code 0, while it should've returned 1 in some
cases. This commit fixes that.
2025-05-25 12:23:58 +02:00
Dunedan b4f076effb Don't report errors for empty attribute values
Let checkrefs.py skip reporting errors for empty attribute values.

Fixes #7966
2025-05-25 12:12:45 +02:00
Dunedan 99b9a0cb86 Add support for new font handling for checkrefs.py
As the fonts specified in the GUI templates don't exist as files on disk
anymore after 734386ce9f we can't check if they're specified correctly
the same way as before anymore. Instead, this commit adds validation
of font names to the GUI Relax NG schema and adds a check whether all
fonts referenced in default.cfg exist in the proper location.
2025-05-25 11:21:51 +02:00
Dunedan 6c85951d53 Combine duplicate profiler2 config sections
default.cfg contained two sections named "profiler2". That's something
which might be confusing and is not supported by all implementations of
ini file parsers. To remove that ambiguity, this combines these two
sections into one.
2025-05-25 11:21:47 +02:00
trompetin17 1aea9f2d32 Add CJK languages to release/installer
After 734386ce9f, CJK fonts are included in mods/mod folder, removing the
need for CJK mods. This commit enables those languages in the release
and the installer.
2025-05-24 12:15:14 -05:00
Lancelot de Ferrière a7330cf469 Improve group movement by distributing units around the target.
This improves pathfinding feel as units no longer try to clump on a particular point. However, can lead to oddities if there's a lot of impassable terrain around.

Closes #7791
2025-05-24 14:34:09 +02:00
Dunedan efdc1fab0a Add a pre-commit hook to check for large files
This checks there are no large files being committed, which aren't
stored in git-lfs.
2025-05-22 20:43:52 +02:00
Dunedan 1985fefcbd Fix a crash of the debug console
This fixes a crash when pyrogenesis got compiled with certain
compilers, whenever a command is entered in the console, while no
console.txt log exists.

Fixes #7964
2025-05-22 20:31:28 +02:00
Ralph Sennhauser 72be06fd7f Fix AttackEntityInZone after eslint 'no-shadow'
Fix for 7b4cf11e25

Fixes: #7965
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-22 19:16:28 +02:00
trompetin17 8c85f32327 Remove fontbuilder & files
After 734386ce9f (that introduce freetype as a core of text rendering
engine), we dont need fontbuilder.py, neither files generated by that
tool.
2025-05-22 19:06:53 +02:00
trompetin17 c8c1522953 Fix memory leak from Font
FreeType’s FT_Glyph_To_Bitmap mutates the FT_Glyph by allocating a new
glyph object and overwriting the input pointer. This creates a risk of
memory leaks if the old glyph isn’t released or if ownership is unclear.

To avoid this, we now store the glyph in a UniqueFTGlyph and explicitly
pass it by reference to FT_Glyph_To_Bitmap. After the mutation,
ownership continues to reside in the smart pointer, and cleanup is
guaranteed even in error branches.

For temporary glyphs (e.g., strokes), we still manually call
FT_Done_Glyph, since they are not managed by UniqueFTGlyph. These
changes ensure all glyph memory is correctly released and reduce the
need for repetitive error-path cleanup code.
2025-05-22 11:35:12 -05:00
Ralph Sennhauser 1fac3461f9 Never strip binaries automatically
Striping is trivial, getting the debug symbols if premake just strips
them silently is a pain tho.

Stripping should optionally be done during install, as we don't have an
install target nor an install-strip target, make it a configure option
which is off by default.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-22 17:32:39 +02:00
Dunedan b3de44c37d Increase range of Ptolemaic lighthouse
The Ptolemaic lighthouse is a pretty unique building. Ever since it got
changed to not reveal all coasts anymore in 04240f05a7 it hasn't been
very useful anymore, as its visibility range was too low to justify
spending the resources on it. To make the lighthouse more attractive
again, this commit increases its visibility range from 200 to 325.
2025-05-22 08:18:24 +02:00
Ralph Sennhauser fb470ffa35 Add options for sanitizers to premake5.lua
Given that Valgrind is not yet avx512 ready [1] all the more reason to
have easy access to ASAN and friends for compilers that support it.

This commit adds options for ASAN, TSAN and UBSAN. [2]

[1] https://bugs.kde.org/show_bug.cgi?id=383010
[2] https://github.com/google/sanitizers/wiki

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-21 20:44:19 +02:00
trompetin17 a1d13c1cf8 Add CJK fonts for Text Engine
This PR removes the need for separate mods that previously provided CJK
support, and reduce the step for release process as mentioned here:
https://gitea.wildfiregames.com/0ad/0ad/wiki/ReleaseProcess
2025-05-21 16:16:36 +02:00
Lancelot de Ferrière 75421ef27c Disable system libs for WxWidgets
This is needed on recent wxWidgets versions to prevent fetching native libraries on the system while we are cross-compiling for Intel bundles.
2025-05-21 08:54:45 +02:00
Ralph Sennhauser 622f477ae9 Fix eslint rule 'no-new'
Manual fixes needed for:
eslint --no-config-lookup --rule '"no-new": 1'

Make the handlers that aren't actually handlers calss functions and for
the HotkeyPage suppress the warning as the global init is prone to be
removed at some point.

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-20 14:17:13 +02:00
Ralph Sennhauser 382b732515 Update test_root path in update-workspace
After 8d993b9250 the generated test_root.cpp is no longer in the source
tree but generated in workspace. The issue of there bing no source is
still valid, so update the path.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-19 17:43:21 +02:00
Dunedan 638391d7ab Fix password change for certain usernames
This fixes the ability for users with uppercase letters in their
username to change their passwords, which wasn't possible before on
non-Windows platforms. The underlying issue for that is
https://github.com/processone/ejabberd/issues/4377 and in addition some
inconsistent normalization of usernames in password change requests
by gloox. This commit works around that by always using the local JID
part as username for password requests, which got the nodeprep string
profile already applied.

It also fixes a problem that Windows users which were able to change
their passwords, weren't able to login afterwards anymore, unless they
typed their username in all lowercase in the login form. This was caused
by using the all lowercase username as input for the password hash
function, instead of using the username in the user supplied case.

Fixes #7796
2025-05-19 17:05:41 +02:00
ShadowOfHassen 231c38d28d Improved Civ Overviews 2025-05-19 10:35:27 +02:00
Ralph Sennhauser 5445aaaf59 Allow no files for copyright checks
If a commit just removes files for cleanup purpose for example the list
of files to check would be empty. Therefore allow no files as arguments
for use in CI.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-18 20:18:08 +02:00
Dunedan f28ca5d684 Fix bold and italic fonts
A last minute change in #7787 caused the bold and italic identifiers of
fonts to be ignored once it got merged in 734386ce9f and all fonts to
be rendered as regular fonts. This commit fixes that.
2025-05-18 18:41:25 +02:00
Dunedan b1a638dfdc Remove the sprites of the player color dropdown
This makes the arrow of the player color dropdown look like in a27
again.
2025-05-17 18:54:22 +02:00
Dunedan dc156c3f24 Fix position of the ingame release label
This commit fixes the vertical position of the release label in the
in-game top menu, which broke with 734386ce9f.
2025-05-17 18:54:22 +02:00
Dunedan ec95ee96d4 Improve player color dropdown
This properly centers the colors in the player color dropdown.
2025-05-17 18:54:22 +02:00
Dunedan 58a58bc25d Improve layout of the civ and structree pages
This contains some small layout fixes and improvements for the
civilization overview and structure tree pages. Some of these fixes have
fix regressions introduced with 37065ebc71.
2025-05-17 18:54:12 +02:00
Ralph Sennhauser 4e5cdc87b9 Fix eslint rule 'spaced-comment'
Manual fixes needed for:
eslint --no-config-lookup --rule '"spaced-comment": ["warn", "always"]'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-17 12:08:47 +02:00
Dunedan 52ee6ad470 Fix element positions after new font rendering
This fixes the positions of elements which changed as part of
734386ce9f.
2025-05-17 10:02:25 +02:00
Ralph Sennhauser 7b4cf11e25 Fix eslint rule 'no-shadow'
Manual fixes needed for:
eslint --no-config-lookup --rule '"no-shadow": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-17 09:48:36 +02:00
Ralph Sennhauser dcda4187be Fix parsing of graph.js for eslint
The perl script extract.pl just checks for a line matching
'-- include data json--', so making it valid js is can be done just
fine.

Also fix eslint warning is graph.js.

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-17 06:29:29 +02:00
trompetin17 734386ce9f Use freetype for font rendering
Replace premade bitmap fonts with FreeType2 and dynamic texture atlas.

Switched from static, premade bitmap fonts to runtime-generated glyphs using FreeType2.
Glyphs are rendered on demand into a dynamic texture atlas, improving scalability,
font quality, and support for internationalization.

Currently using RGBA format for compatibility across all render
paths while initial support for R8_UNORM is being added.
This prepares for future optimizations in VRAM and performance

Includes groundwork for gamma-corrected blending and future swizzling support.
2025-05-16 14:57:59 -05:00
Dunedan 45340a2e32 Don't store consecutive console commands twice
This adds an option to disable storing consecutive console commands
twice and enables it by default.
2025-05-16 17:38:41 +02:00
Dunedan d549cbeeaa Make the console font configurable 2025-05-16 17:38:41 +02:00
Dunedan 13c00d1869 Add missing console.history.size to default.cfg 2025-05-16 17:38:29 +02:00
Kate a91a8594c2 remove whitespace on line 317 through 321 2025-05-16 12:11:18 +02:00
Kate 750b10a966 Update binaries/data/mods/public/simulation/ai/petra/config.js 2025-05-16 01:51:06 +02:00
Kate 517916c4d6 Update binaries/data/mods/public/simulation/ai/petra/config.js 2025-05-16 00:50:49 +02:00
Itms 416ba3fc2b Fix Gitea actions syntax on push events
The Github documentation is difficult to parse, but there is an
asymmetry in the API:
- for a PR event, the event object contains a `pull_request` object
  containing `base` and `head` objects
- for a push event, the `before` and `after` SHAs are immediate
  children of the event object

<https://docs.github.com/en/webhooks/webhook-events-and-payloads>

Fixes #7730.
2025-05-15 11:45:25 +02:00
Itms 83674e1d1b Fix lfscheck action syntax on push 2025-05-15 10:54:46 +02:00
Itms 2889170a09 Check LFS pointers integrity in an action
Running the checks here instead of in repository hooks will prevent
Gitea from hanging during pushes.
2025-05-15 09:33:50 +02:00
Ralph Sennhauser a9987868c4 Fix eslint rule 'no-use-before-define'
Manual fixes needed for:
eslint --no-config-lookup --rule '"no-use-before-define": ["error", "nofunc"]

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-14 16:35:58 +02:00
Ralph Sennhauser 3a2d75af65 Fix eslint rule 'no-irregular-whitespace'
Manual fixes needed for:
eslint --no-config-lookup --rule '"no-irregular-whitespace": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-14 13:52:12 +02:00
Itms 56e268d82b Update the issue template for release processes 2025-05-14 11:14:13 +02:00
Itms 51ab929926 Implement pipeline for generating patch releases
The new patch-release pipeline takes a git branch originating from a
release tag, applies the changes since the tag onto the nightly build of
the release, and rebuilds the Windows binary.

All resulting changes are sent to the bundling pipeline which builds for
macOS and creates the tarballs and installers.

There will be two instances of the bundles pipeline: the main one will
keep tracking the main branch and providing biweekly bundles of the next
release, while a new patched-bundles pipeline will be manually used to
generate patch releases.
2025-05-14 10:49:02 +02:00
Itms c38b40cda8 Allow downloading Windows libraries into nightly 2025-05-14 10:48:43 +02:00
Ralph Sennhauser 74f475f9fd Fix eslint rule 'no-return-assign'
Manual fixes needed for:
eslint --no-config-lookup --rule '"no-return-assign": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-13 20:12:35 +02:00
phosit 429fb672a0 Move the argument validation to PlayerPlacement
Only `PlayerPlacement` itself should know how to validate it's value.
Fix: #7686
2025-05-13 17:52:57 +02:00
Ralph Sennhauser 406d0c90ca Fix eslint rule 'operator-linebreak'
eslint --no-config-lookup --fix --rule '"operator-linebreak": ["warn", "after"]'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-13 16:06:50 +02:00
Ralph Sennhauser bc2e16afc2 Fix eslint rule 'no-mixed-spaces-and-tabs'
Manual fixes needed for:
eslint --no-config-lookup --rule '"no-mixed-spaces-and-tabs": ["warn", "smart-tabs"]'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-13 15:48:23 +02:00
Ralph Sennhauser 40f1340e60 Fix eslint rule 'space-before-function-paren'
eslint --no-config-lookup --fix --rule '"space-before-function-paren": ["warn", "never"]'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-13 15:21:57 +02:00
Ralph Sennhauser 8e71be511b Fix eslint rule 'space-in-parens'
eslint--no-config-lookup --fix --rule '"space-in-parens": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-13 14:29:29 +02:00
Ralph Sennhauser 76a50d1828 Fix eslint rule 'no-floating-decimal'
eslint --no-config-lookup --fix --rule '"no-floating-decimal": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-13 14:09:58 +02:00
Ralph Sennhauser d2222ee0ac Fix eslint rule 'prefer-const'
The remaining ones that can be fixed automatically.

eslint --no-config-lookup --fix --rule '"prefer-const": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-12 18:44:28 +02:00
Ralph Sennhauser c24bf321d6 Fix eslint rule 'prefer-const' in gui/[c-p]
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/gui/[c-p]*

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-12 14:15:40 +02:00
Ralph Sennhauser e7f1406c37 Fix eslint rule 'prefer-const' in components/[T-V]*
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/components/[T-V]*

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-12 13:12:45 +02:00
Ralph Sennhauser 4b3124e364 Fix eslint rule 'prefer-const' in components/unitai
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/components/UnitAI.js

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-12 08:23:10 +02:00
Ralph Sennhauser 9d791de2eb Fix eslint rule 'prefer-const' in components/[R-S]*
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/components/[R-S]*

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-12 08:02:53 +02:00
Ralph Sennhauser fd27f39c20 Fix eslint rule 'prefer-const' in components/[H-P]*
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/components/[H-P]*

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-11 19:24:03 +02:00
Ralph Sennhauser eb75835ce4 Fix eslint rule 'prefer-const' in components/G*
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/components/G*

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-11 17:53:23 +02:00
Ralph Sennhauser b80c222b96 Fix eslint rule 'prefer-const' in components/[C-F]*
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/components/C* \
    binaries/data/mods/public/simulation/components/D* \
    binaries/data/mods/public/simulation/components/E* \
    binaries/data/mods/public/simulation/components/F*

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-11 14:27:12 +02:00
Dunedan ea4de39faa Direct support requests to the forums
This disables the default issue type in Gitea and replaces it with a
link to the help and feedback section in the forums. That's a measure to
discourage players to use Gitea as a tool to seek support.
2025-05-11 12:24:49 +02:00
Lancelot de Ferrière dd74892463 Fix no-pch build following #7829 2025-05-11 11:24:50 +02:00
Ralph Sennhauser 4c4f787c63 Fix eslint rule 'prefer-const' in components/[A-B]*
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/components/A* \
    binaries/data/mods/public/simulation/components/B* \

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-11 10:40:23 +02:00
Ralph Sennhauser 88eea5c7e3 Fix eslint rule 'prefer-const' in components/tests
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/components/tests

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-11 10:03:30 +02:00
Lancelot de Ferrière cf952b34e4 Fix silhouette calculation after 8a40673
Fixes #7804
2025-05-11 09:56:24 +02:00
Ralph Sennhauser 2e090c2daa Fix eslint rule 'prefer-const' in components/tests/[A-R]*
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/components/tests

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-11 09:06:57 +02:00
Ralph Sennhauser 5a9968f88d Fix eslint rule 'prefer-const' in simulation/helpers
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/helpers

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-11 08:50:27 +02:00
Ralph Sennhauser bebc72a3c7 Fix eslint rule 'prefer-const' in sim/helpers/commands
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/helpers/Commands.js

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-10 19:41:45 +02:00
Ralph Sennhauser 62ee1c34ac Fix eslint rule 'prefer-const' in simulation/ai
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/ai

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-10 19:16:52 +02:00
Ralph Sennhauser ac3f56fa9e Fix eslint rule 'prefer-const' in ai/[a-f]*
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/ai/common-api/class.js \
    binaries/data/mods/public/simulation/ai/common-api/entity.js \
    binaries/data/mods/public/simulation/ai/common-api/entitycollection.js \
    binaries/data/mods/public/simulation/ai/common-api/filters.js

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-10 18:55:13 +02:00
Ralph Sennhauser 93668e8447 Fix eslint rule 'prefer-const' in gui/reference
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/gui/reference

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-10 18:40:28 +02:00
Ralph Sennhauser 50a5d4b366 Fix eslint rule 'prefer-const' in gui/session
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/gui/session

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-10 18:05:22 +02:00
Ralph Sennhauser 9f489b748f Fix eslint rule 'prefer-const' in gui/session/[m-t]*
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/gui/session/message_box \
    binaries/data/mods/public/gui/session/messages.js \
    binaries/data/mods/public/gui/session/minimap/MiniMap.js \
    binaries/data/mods/public/gui/session/objectives \
    binaries/data/mods/public/gui/session/top_panel \
    binaries/data/mods/public/gui/session/trade

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-10 17:38:23 +02:00
Lancelot de Ferrière 9eccf1f27d Iterate the component map only once on serialization 2025-05-10 17:08:49 +02:00
Lancelot de Ferrière ea34960249 Skip UTF8 conversions in prototype name 2025-05-10 17:08:49 +02:00
Lancelot de Ferrière bcd0e12cc3 BinarySerializer: avoid creating unnecessary ScriptRequest 2025-05-10 17:08:49 +02:00
Lancelot de Ferrière ab6a420f78 Cache property keys during component serialization 2025-05-10 17:08:49 +02:00
Lancelot de Ferrière 83bf2eb22e Skip redundant HasProperty in GetObjectClassName 2025-05-10 17:08:49 +02:00
Ralph Sennhauser 8c20405274 Fix eslint rule 'prefer-const' in gui/session/[a-l]*
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/gui/session/campaigns \
    binaries/data/mods/public/gui/session/chat \
    binaries/data/mods/public/gui/session/developer_overlay \
    binaries/data/mods/public/gui/session/diplomacy \
    binaries/data/mods/public/gui/session/lobby

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-10 16:52:52 +02:00
Ralph Sennhauser 7eeb8a6f9f Fix eslint rule 'prefer-const' in gui/session/input+
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/gui/session/input.js \
    binaries/data/mods/public/gui/session/session.js

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-10 16:43:01 +02:00
Ralph Sennhauser b5227e03f7 Fix eslint rule 'prefer-const' in gui/session/selection
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/gui/session/selection*

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-10 16:22:11 +02:00
Ralph Sennhauser 6e4e4b681e Fix eslint rule 'prefer-const' in maps/random
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/maps/random

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-10 12:40:32 +02:00
Ralph Sennhauser 5373c2e10c Fix eslint rule 'prefer-const' in maps/rmgen
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/maps/random/rmgen*

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-10 12:10:24 +02:00
Ralph Sennhauser c92e300c20 Fix eslint rule 'prefer-const' in maps/scenarios
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/maps/scenarios

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-10 08:11:32 +02:00
Ralph Sennhauser 60fc382bd8 Fix eslint rule 'prefer-const' in maps/scripts
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/maps/scripts

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-09 19:46:31 +02:00
Ralph Sennhauser 519a215e1c Fix eslint rule 'prefer-const' in gui/common
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/gui/common

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-09 19:32:43 +02:00
Ralph Sennhauser c8f3455458 Fix eslint rule 'prefer-const' in gui/campaigns
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/gui/campaigns

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-09 15:37:01 +02:00
Vantha fa046392bb Adjust the resource icon placement in tooltips 2025-05-09 13:20:19 +02:00
Vantha 314088af14 Center all small resource icons 2025-05-09 13:16:43 +02:00
Ralph Sennhauser 5221b81bff Fix eslint rule 'prefer-const' in petra
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/ai/petra

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-09 11:16:53 +02:00
Ralph Sennhauser 6a16b18795 Fix eslint rule 'prefer-const' in petra/trade+
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/ai/petra/startingStrategy.js \
    binaries/data/mods/public/simulation/ai/petra/tradeManager.js \
    binaries/data/mods/public/simulation/ai/petra/transportPlan.js \

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-09 10:42:16 +02:00
Ralph Sennhauser fb5ae32e4b Fix eslint rule 'prefer-const' in petra/victoryManager
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/ai/petra/victoryManager.js

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-08 21:45:45 +02:00
Stan c960e6efd4 Fix linting jenkins file
The main branch wasn't pulled causing the diff to fail.
2025-05-08 21:01:54 +02:00
Stan 934ca601d7 Add a Jenkinsfile linter 2025-05-08 19:50:21 +02:00
Itms 1adab34511 Generate signatures and hashes in the bundles job 2025-05-08 19:08:56 +02:00
Ralph Sennhauser 5378f452cf Fix eslint rule 'prefer-const' in petra/worker
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/ai/petra/worker.js

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-08 18:31:51 +02:00
Ralph Sennhauser 08e21f3186 Fix eslint rule 'prefer-const' in petra/navalManager
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/ai/petra/navalManager.js

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-07 19:36:47 +02:00
Ralph Sennhauser c6b14fbb2c Fix eslint rule 'prefer-const' in petra/defense
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/ai/petra/defense*

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-07 18:49:03 +02:00
Ralph Sennhauser 06b8857c04 Fix eslint rule 'prefer-const' in petra/queueplan
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/ai/petra/queueplan*

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-07 15:36:02 +02:00
Ralph Sennhauser baa8d99be3 Fix eslint rule 'prefer-const' in petra/headquarters
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/ai/petra/headquarters.js

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-07 14:04:48 +02:00
Ralph Sennhauser e83d5069f0 Fix eslint rule 'prefer-const' in petra/baseManager
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/ai/petra/baseManager.js

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-07 13:24:54 +02:00
Ralph Sennhauser 0d59444401 Fix eslint rule 'prefer-const' in petra/attackPlan
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/ai/petra/attackPlan.js

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-07 12:56:45 +02:00
Itms 5b7feb360e Fix nightly pipeline syntax mistake in 2659efdb38 2025-05-07 12:49:51 +02:00
Itms 2659efdb38 Speed up nightly build generation
New files in the repository are naively added using `svn add --force`
which adds all unversioned files according to the documentation.

However, this iterates through the entire repository and takes about 12
minutes. Using `svn status` and parsing through the results only takes a
couple seconds.
2025-05-06 22:02:21 +02:00
Itms b58ea2698e Fix bug in nightly pipeline on spaces in filenames
The call to `svn delete` on deleted files does not work if filenames
contain spaces. This happens in particular when we fix spaces in
filenames, as the pipeline doesn't understand file renames.
2025-05-06 22:02:01 +02:00
Ralph Sennhauser a800441783 Fix eslint rule 'prefer-const' in petra/attackManager
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/simulation/ai/petra/attackManager.js

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-06 18:43:37 +02:00
Ralph Sennhauser 7df1bd1a42 Fix eslint rule 'prefer-const' in gui/gamesetup
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/gui/gamesetup

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-06 18:12:37 +02:00
Ralph Sennhauser 7e73841d50 Fix eslint rule 'prefer-const' in gui/maps
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/gui/maps

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-06 17:18:12 +02:00
Ralph Sennhauser 0791504491 Fix eslint rule 'prefer-const' in globalscripts
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/globalscripts

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-06 14:16:42 +02:00
Ralph Sennhauser 7684e12717 Fix eslint rule 'prefer-const' in modmod
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/mod

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-06 13:49:13 +02:00
Ralph Sennhauser 6aeb09228a Fix eslint rule 'no-multi-assign'
Manual fixes needed for:
eslint --no-config-lookup --rule '"no-multi-assign": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-06 13:15:10 +02:00
Ralph Sennhauser 1ee51e2d86 Fix eslint rule 'prefer-const' in gui/lobby
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/gui/lobby

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-06 09:48:52 +02:00
Lancelot de Ferrière 6931aca983 Switch to -fstack-protector-strong
This allows the compiler to skip stack guards on some functions, leading to better performance at limited security expanse.
Examples of such functions include isqrt64 and ComponentManager::PostMessage.
2025-05-06 08:47:30 +02:00
Ralph Sennhauser dc16f1ce82 Fix eslint rule 'prefer-const' in gamesettings
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/gamesettings

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-05 19:35:16 +02:00
Ralph Sennhauser bc5f42d4a4 Fix eslint rule 'no-else-return'
Use ternary expressions instead.

eslint--no-config-lookup --fix --rule '"no-else-return": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-04 22:34:54 +02:00
scuti 0e1c881fef Check for broken animated meshes in checkrefs.
Added and integrated P293 by @trompetin17 and @Stan
Addresses #6714
2025-05-04 22:25:47 +02:00
Ralph Sennhauser e218cfa170 Fix eslint rule 'dot-notation'
For consistency with other commandline args containing '-' which can't
make use of the dot notation disable the rule for affected lines.

eslint --no-config-lookup --fix --rule '"dot-notation": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-04 21:31:21 +02:00
Ralph Sennhauser 3916fab66f Fix eslint rule 'no-undef-init'
Manual fix needed, remove all assignments to undefined and rely on the
default state.

eslint --no-config-lookup --rule '""no-undef-init: 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-04 20:34:40 +02:00
Ralph Sennhauser 08a5f4405f Fix eslint rule 'no-empty'
Manual fix needed, using 'noop' comment to silence warnings and convert
for loop to a probably more readable while loop.

eslint --no-config-lookup --rule '"no-empty": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-04 20:05:02 +02:00
Lancelot de Ferrière 7cc495ec91 Fix UnitMotion 'path prediction' to not trigger if following a short path
This is needed otherwise units might never go around pure unit obstructions.

Adds a small test map.

Fixes def0f57365
2025-05-04 11:22:31 +02:00
Ralph Sennhauser dc6544a6c4 Fix eslint rule 'operator-assignment'
eslint --no-config-lookup --fix --rule '"operator-assignment": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-03 19:02:10 +02:00
Ralph Sennhauser 2b67499e05 Fix eslint rule 'no-trailing-spaces'
eslint --no-config-lookup --fix --rule '"no-trailing-spaces": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-03 17:31:47 +02:00
Ralph Sennhauser 1da93a6d2f Fix eslint rule 'object-curly-spacing'
eslint --no-config-lookup --fix --rule '"object-curly-spacing": ["warn", "always"]'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-03 17:17:35 +02:00
Ralph Sennhauser 12640ad63e Fix eslint rule 'brace-on-same-line'
eslint --no-config-lookup --fix --plugin eslint-plugin-brace-rules \
    --rule '"brace-rules/brace-on-same-line": [
                "warn",
                {
                    "FunctionDeclaration": "never",
                    "FunctionExpression": "ignore",
                    "ArrowFunctionExpression": "always",
                    "IfStatement": "never",
                    "TryStatement": "ignore",
                    "CatchClause": "ignore",
                    "DoWhileStatement": "never",
                    "WhileStatement": "never",
                    "ForStatement": "never",
                    "ForInStatement": "never",
                    "ForOfStatement": "never",
                    "SwitchStatement": "never",
                },
                {
                    "allowSingleLine": true,
                }
            ]'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-03 16:16:44 +02:00
Ralph Sennhauser 27c70de8ae Fix eslint rule 'key-spacing'
eslint --no-config-lookup --fix --rule '"key-spacing": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-03 15:44:04 +02:00
Ralph Sennhauser fd0f7cc270 Fix eslint rule 'comma-spacing'
eslint --no-config-lookup --fix --rule '""comma-spacing: 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-03 15:12:53 +02:00
Ralph Sennhauser 7ab9416acc Fix eslint rule 'quote-props'
eslint --no-config-lookup --fix --rule '"quote-props": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-03 14:31:11 +02:00
Ralph Sennhauser 81c119bf39 Fix eslint rule 'semi'
eslint --no-config-lookup --fix --rule '"semi": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-03 14:13:14 +02:00
Ralph Sennhauser ddba1ceabd Fix eslint rule 'no-extra-semi'
eslint --no-config-lookup --fix --rule '"no-extra-semi": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-03 11:18:16 +02:00
Ralph Sennhauser 24c47c81c7 Fix eslint rule 'no-multi-spaces'
eslint --no-config-lookup --fix --rule '"no-multi-spaces": ["warn", { "ignoreEOLComments": true, }]'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-03 10:50:50 +02:00
Ralph Sennhauser b6df170303 Fix eslint indent rule
eslint --no-config-lookup --fix --rule 'indent:  ["warn", "tab", { "outerIIFEBody": 0, }]'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-03 09:39:58 +02:00
Ralph Sennhauser 57cf9578a7 Fix schema for TurretHolder
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-03 09:39:58 +02:00
Lancelot de Ferrière 1f2156adcc Fix library build on MacOS Sonoma 2025-05-02 21:05:31 +02:00
Stan 00793d2918 Add rooster model and template. 2025-05-02 14:41:29 +02:00
Ralph Sennhauser 9038b555fe Eslint auto-fix JS in profiler2 webui
This fixes all issues eslint can safely do automatically. Drastically
reducing the number of open style issues reported.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-02 13:25:23 +02:00
Ralph Sennhauser 545cf99a0c Add JS to editorconfig
Uses tabs for JS files

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-02 13:25:23 +02:00
abian 853ae057dd Do not require Traders for Diaspora
Remove the need to train 3 Traders before researching Diaspora, which
will now be researched directly from the Market instead of the Civic
Center. To compensate, increase cost by +100 food, +200 metal, and
+10 research time, matching the three resources used to produce
Traders, but in smaller quantities.

Fixes #7381
2025-05-01 22:01:32 +02:00
Pio 7f684cbcd3 Fix incorrect shaders path in LICENSE.md
The two shaders are actually located in mods/mod/shaders/glsl
2025-05-01 17:13:37 +02:00
fiftydinar 26acb9df22 Add StartupWMClass to desktop file
This fixes the potential edge-cases of icon not showing, like in Gnome's dash for example.
2025-04-29 15:18:41 +02:00
Dunedan d79c05f10e Allow loading multiple profiling reports at once
This allows selecting multiple reports to load at once in the file
chooser dialog. Reports will be loaded in parallel and the last one to
finish loading will be the active one.
2025-04-29 12:40:31 +02:00
Dunedan 1e276bb4ad Remove duplicate call of on_report_loaded()
This removes a duplicate call of on_report_loaded() when loading a
profiling report. This second call caused loading reports to fail,
whenever it took longer than 5 seconds. While that was probably a
measure to prevent reports loading too long and taking up too much
resources, it didn't achieve that goal, as the actual loading of the
report din't get aborted.
2025-04-29 12:40:31 +02:00
Ralph Sennhauser 19d568d506 Add linter to check for copyright year
This replaces the previous arclint linter for checking the copyright
year in license headers with a gitea workflow job.

As the date of last edit might differ from commit date due to reverts
the copyright linter is run against a base commit.

The python script doing the heavy lifting is written by @Dunedan.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Co-Authored-by: Dunedan <dunedan@phoenitydawn.de>
2025-04-28 16:14:34 +02:00
Ralph Sennhauser 263b481442 Cmake-4 support for nvtt
Fix nvtt build to support cmake-4, while at it also fix other
related outstanding cmake issues in nvtt.

Fixes: #7538
Fixes: #7764
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-04-27 09:58:23 +02:00
Vladislav Belov 7275f590e9 Fixes wxWidgets on 64bits. 2025-04-26 20:53:24 +02:00
Vladislav Belov d049a09f81 Adds libraries/win64 to .gitignore. 2025-04-26 20:53:22 +02:00
Vladislav Belov f2fcc12859 Restores iconv dependency for collada. 2025-04-26 20:53:20 +02:00
Vladislav Belov c46593149b Adds amd64 support to get-windows-libs. 2025-04-26 20:53:18 +02:00
Vladislav Belov 479cdbfc82 Removes unapplied arch_suffix for now. 2025-04-26 20:53:16 +02:00
Vladislav Belov b0160d0ece Adds 64bits support. 2025-04-26 20:53:09 +02:00
Lancelot de Ferrière 8a40673dab Avoid overflow in silhouette occluder bounds
This triggered a debug_warn in some cases.
2025-04-26 16:48:06 +02:00
Vladislav Belov 2264807ad0 Fixes runtime switch of the GPU skinning.
Fixes #7572, #7630.
2025-04-25 20:13:59 +02:00
Vladislav Belov 0180faa1f2 Adds fixed frame frequency.
Adds possibility to control the frame time by setting the frame
frequency by a command line argument (`-fixed-frame-frequency`). It's
mostly useful for a trailer recording and graphics debugging.
2025-04-25 19:15:57 +02:00
Dunedan d78e46ba26 Fix positioning of bottom minimap tooltips 2025-04-24 18:49:11 +02:00
Dunedan 680efb147d Unify tooltip style of top menu items 2025-04-24 18:49:10 +02:00
Dunedan dee2b73c7d Remove pointless content from counter tooltips
This removes the static text "Gatherers: current" from the
resource and population counter tooltips. This string was static and
only changed its color depending on whether units were assigned to
collect a certain resource. That information is however already
available in the counter display itself.
2025-04-24 18:49:10 +02:00
Vladislav Belov 0bf3ff5ad6 Reduce allocations for GUI and Hotkeys.
It allows to reduce the number of allocations per-frame for GUI and
during initialization for Hotkeys.
2025-04-24 15:11:22 +02:00
Vladislav Belov bdd3cac051 Reduces allocations for ShaderDefines.
It allows to reduce the number of allocations per-frame for
ShaderDefines. For example, on Acropolis Bay it goes down from
2.7k to 0.9k for the whole map view.
We don't really need std::vector for it. Because materials and
particularly shaders shouldn't have so many parameters.
2025-04-24 01:05:34 +02:00
Ralph Sennhauser 25ef6107e0 Make get-windows-libs fail on error
Don't try to muddle through, if the files expected to be present can't
be copied it's a hard failure.

Further abort with error code for failed commands so it can be caught by
the CI.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-04-22 19:34:18 +02:00
Ralph Sennhauser e2511cfbac Propagate error for failed update-workspace.bat
If running premake fails during update workspace then update workspace
needs to exit with an error as well so the CI will actually report an
error.

According to Itms testing with powershell passing the original error is
unreliable, so just exit with one.

Fixes: #7642
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-04-22 19:34:11 +02:00
Lancelot de Ferrière af32d386b9 Stop running shrinking gcs & simplify GC logic.
Shrinking GCs dump the JITted code, which leads to redundant recompilations, lowers performance, and makes profiling JS more difficult.
They may still happen if the runtime is at risk of OOM.
2025-04-22 17:03:29 +02:00
Lancelot de Ferrière d262eb8757 Remove log scale in profiler2
It showed incorrect values and was simply not very useful.
2025-04-21 09:05:34 +02:00
Vladislav Belov 9306aae297 Fixes PS::StaticVector insert and adds more tests
There was an incorrect mutable iterator construction missed in
ca242239f1.
2025-04-20 17:13:40 +02:00
Lancelot de Ferrière ea5a350f83 Cache JS component wrappers 2025-04-19 14:41:45 +02:00
Lancelot de Ferrière 0a4bfefb1e Fix modifiersManager cache incorrectly storing values with player-wide modifier
The cache would take the value post-player-modification, which is incorrect. This would usually just make caching fail, but could trigger worse problems if the post-player value is also used in other situations.

One such situation leads to an OOS for britons.

Thanks to elexis for the thorough investigation.

Fixes #7634
2025-04-19 12:37:24 +02:00
Vladislav Belov e65879bdbf Fixes non-PCH compilation after 0b33921c06. 2025-04-17 23:26:23 +02:00
Dunedan 280dcd3a1c Tweak probabilities of tip categories
With the introduction of multiplayer loading screen tips, categories of
tips and probabilities of how often to show tips from a certain category
got introduced. The original probabilities ended up showing multiplayer
tips in 60% of the cases. As the number of multiplayer tips is still
fairly small, this resulted in very repetitive occurrence of the same
multiplayer tips over and over when loading multiplayer matches.

This commit changes that to give single-player tips a higher probability
for multiplayer matches. It also adds showing tips from the "Beginner"
category for multiplayer games, as there are regularly new players who
start their experience with 0 A.D. by playing multiplayer matches with
friends, instead of playing single-player matches and who'll therefore
benefit from those tips being shown for multiplayer matches as well.
2025-04-17 17:15:43 +02:00
phosit 44605c1297 Add a class to register stateful callbacks to JS
Use the class in autostart as an example.
2025-04-17 15:02:05 +02:00
phosit 0afb5f3d06 Use std::string_view in ConfigDB
Now no `std::string` has to be constructed to get a config-value.
To accomplish that the map has to have a "transparent" comparator.
2025-04-17 12:35:40 +02:00
Vladislav Belov 0b33921c06 Removes GL code from the common GPU profiler. 2025-04-16 22:38:34 +02:00
Vladislav Belov 6ef6a87287 Adds queries implementation to renderer backends. 2025-04-16 22:38:32 +02:00
Vladislav Belov 0e7d193fcc Adds an interface for queries. 2025-04-16 22:38:24 +02:00
wowgetoffyourcellphone 8da6c758fc Add small metal/ore mine objects to the game.
New small metal mine models and actors.
New sparkle particles.
Remove refs to old metal ore mines from existing maps.

Fix refs to temperate_small_01_01, which should have been temperate_small_01
2025-04-15 18:14:37 +02:00
Vladislav Belov 9c560c36af Removes ARBShadersShadow IDevice capability.
According to our stats `GL_ARB_fragment_program_shadow` is supported
by all our GL users. Also we're going to remove OpenGL ARB in A29. So
I remove ARBShadersShadow completely.
2025-04-12 23:14:28 +02:00
Vladislav Belov fa3fb5d064 Allows compute shaders for GL only since 4.3.
It seems current checks for GL 4.2 aren't enough so just disable
compute shaders for GL 4.2. Fixes #7734.
2025-04-12 16:56:18 +02:00
Vladislav Belov bce6e2c238 Fixes out of bounds during GL buffer binding.
There was an out of bounds access during binding a uniform buffer on
GL. Fixes #7567, #7598.
2025-04-12 16:27:52 +02:00
ramtzok1 1b797ce0a0 Add specific tips for multiplayer sessions
A multi player loading screen will have possibility of showing single
and multi player tips while multi player tips are in favor.

Tips are now separated by categories. During loading those category
have an occurrence probability, where we are choosing a random category
based on chance and not by complete randomness. From there we just
picking a random tip from that category.
2025-04-12 10:38:57 +02:00
Dunedan 8482f25800 Fix a bunch of spelling mistakes
This fixes a bunch of spelling mistakes found in user facing strings.

Fixes #7716
2025-04-11 06:24:32 +02:00
Dunedan 9bae3c86d6 Fix LFS pull in checkrefs workflow
This fixes the pulling of objects from LFS in the checkrefs workflow. To
do so three steps were necessary:

- Don't fail immediately when encountering missing objects in LFS
- Fix the remote URL of the fork repository
- Fix the authentication for the LFS storage of the fork repository
2025-04-11 06:17:45 +02:00
Feldfeld 6224223807 Add myself (Feldfeld) to the programming credits 2025-04-10 18:57:40 +02:00
Feldfeld b5256ce014 Include Player Placement setting in Game Description
The option was missing, so player placement was not shown in the game
description part of the game setup, and it was not shown in the objectives
page in-game.
2025-04-10 18:57:40 +02:00
Viktor Semenov 683a9cb06e Not send redundant argument to StartNetworkGame
Engine part does not expect third argument to StartNetworkGame function.
All network games save replays by default.
2025-04-09 16:11:11 +00:00
Dunedan 11dd480b67 Add workaround to turn off nursery size heuristic
SpiderMonkey 98 introduced a size heuristic for the nursery GC region
(https://phabricator.services.mozilla.com/D136637). As this heuristic
uses a wall-clock time duration, it results in a severe performance
regression on slower systems for our use case.

This commit adds a workaround to turn off that heuristic, by telling
SpiderMonkey that a "page load" (something which doesn't have a meaning
in the context of pyrogenesis) is in progress, as that heuristic is
disabled for page loads.

Co-Authored by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Fixes #7714
2025-04-09 16:53:45 +02:00
phosit 56abf84da2 Catch all std::exception from a map in atlas
Since 0eed117e6d exceptions from the map generation script are rethrown
in the main thread but not all of them are catched.

This defect is already fixed in the engine with 82513c9104

Fixes: #7620
2025-04-09 15:02:33 +02:00
phosit 1a8757660f Get config values without using return parameters
Many temporaries can be removed.
2025-04-09 12:51:21 +02:00
Lancelot de Ferrière 874c4d1c59 Use __framestart only as frame references
Profiler2 currently explicitly considers 'frame' for frames, which is a bit annoying in replays as state hashes are computed outside of these. It's better to just rely on RecordFrameStart() calls.
2025-04-06 11:14:31 +02:00
Dunedan a917d393e1 Only autocomplete unambiguous words
Up to now the chat autocompletion did complete words, even if there were
multiple candidates which matched available. So if for example the
autocomplete list contained "bar" and "baz" and a user typed "ba",
autocompletion would complete it to "bar", ignoring that "baz" was
available as possibly desired result as well. In practice this lead to
people regularly getting completions they didn't intend to get. This
commit fixes that by only completing text, if there is only a single
candidate available.
2025-04-05 08:14:09 +02:00
Dunedan 312c6e8165 Properly terminate the XMPP connection
This ensures the XMPP connection gets properly terminated when leaving
the lobby.

Fixes #7504
2025-04-05 08:01:18 +02:00
Vantha 4d323177b8 Correct error message when the host disconnects
After 78900842b1, the following message was shown to clients when the
host disconnected during game setup:
"Lost connection to the server.
[Invalid value undefined]"

This patch fixes that.
2025-04-02 08:36:38 +02:00
Ralph Sennhauser 933f49722e Use js compiler option for strict-mode
The context option enabling strict mode was removed in sm-117 [1]
requiring to use the compiler option for the same purpose instead.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1621603

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-04-01 21:15:33 +02:00
Ralph Sennhauser 2ed912ae88 Disable push trigger for lint workflow
The event property github.event.push.before seems to not be supported
and therefore the workflow as is fails on main.

Ignoring the trigger means a slight loss in coverage but as it still
fully checks PRs we are mostly good.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-31 20:23:41 +02:00
Ralph Sennhauser 6562faa559 Simplify workflow expression
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-31 19:28:55 +02:00
Ralph Sennhauser 3c3c57d673 Fix base sha for lint workflow
The base sha for push events is determined differently than for pr.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-31 17:20:42 +02:00
Ralph Sennhauser 6da4e606d4 Add cppcheck workflow
Add a workflow for linting and add a cppcheck job.

The job is using cppcheck provided by package manager. Existing errors
are suppressed to get going with CI linting, ideally tho the suppression
list would be empty. Some of the suppressed errors are only found with
more recent cppcheck than what is available in the runner.

Also remove old arclint cppcheck setup.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-30 18:06:01 +02:00
Ralph Sennhauser 387ea927ac Add util.sh shell library
A shell utilities function library starting with a first utility
function for getting the number of online CPUs.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-30 18:05:56 +02:00
phosit 2d206708cd Start Atlas by closing the root page
Theere is now an  `Engine.startAtlas` property that will start Atlas
when it's returned from the root page. The `Engine.RestartInAtlas`
function is removed.
2025-03-26 13:07:57 +01:00
Itms c2d3595777 Remove LCC compiler defines 2025-03-25 12:30:01 +01:00
Itms 8f43dd53fc Remove ICC code paths 2025-03-25 12:29:51 +01:00
Itms 3f3bb8300e Remove ICC compiler support
The ICC compiler has not been used to our knowledge to build the game in
a decade, and is nowadays just a part of LLVM.

Fixes #2994
2025-03-25 12:22:04 +01:00
Stanislas Dolcini a8d7a3312c Pull LFS from forks as well. 2025-03-23 23:20:24 +01:00
Ralph Sennhauser a09b2cc242 Disable deprecation warning for old boost
There are a few version of boost which deprecated global placeholders
but do not yet support std placeholders. Simply suppress warning for
those cases.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-23 14:38:43 +01:00
Ralph Sennhauser 7494602de5 Avoid maybe uninitialized warning with gcc
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-23 14:38:43 +01:00
Ralph Sennhauser 9ef1bff6aa Disable dangling-pointer warning whith gcc-12
This is only an issue with gcc-12 to gcc-14, supress the warning on the
CI.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-23 14:38:42 +01:00
Ralph Sennhauser a2fdc3427e Remove unused Dockerfiles
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-23 14:38:42 +01:00
Ralph Sennhauser 84f626d2b5 Use Debian 12 in Linux pipeline
Use the single Debian 12 container image and inject CC, CXX and LDFLAGS
instead.

Further do the lfs checkout on the agent instead of inside the container
avoiding full rebuilds due to version mismatch.

Then split the debug and release builds using separate workspaces and
record warnings by build preventing gcc warnings leaking into clang
warnings.

Based on zero warning policy and incremental builds using a reference
build doesn't make sense. Removing that we can also drop an additional
generic workspace.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-23 14:38:42 +01:00
Ralph Sennhauser 0481f13fff Add Debian 12 Dockerfile
Debian 12 (bookworm) will soon be oldstable.

Most importantly this version comes with cmake-3.25, which will allow us
to use SDL3, cpp-httplib, fcollada fork and possibly others in the
future.

This also comes with gcc-12 and clang-14 by default, both implementing
almost all of c++17 and most of c++20.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-23 14:38:42 +01:00
Ralph Sennhauser 038decb12e Add Dockerfile to editorconfig
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-23 14:38:42 +01:00
Stan f3948fb9db Add more badges to the UI. 2025-03-22 14:11:24 +01:00
Dunedan e755ef7155 Improve performance and output of entvalidate.py
The most notable changes are:

- improved performance thanks to using `lxml` instead of `xmllint` for
  validating the templates
- improved performance by parallelizing the validation across multiple
  threads
- more meaningful output for detected validation errors
- easier to call from other scripts (like checkrefs.py)
2025-03-18 12:57:01 +01:00
Dunedan f68a8c2532 Verify the lobby certificate by default
When TLS for XMPP connections to the multiplayer lobby got implemented,
there was a bug in gloox [1] preventing the certificate verification to
succeed. This bug got fixed in gloox 1.0.22 five years ago, so it's safe
to enable certificate verification by default now.

[1]: https://web.archive.org/web/20200522184941/https://bugs.camaya.net/ticket/?id=280
2025-03-18 08:58:45 +01:00
phosit 771e33f462 Fix g_MainMenuItems "onPress"
Since 40762c257d there is a callback passed to the "onPress" function of
the `g_MainMenuItems`. If the "onPress" function is a bound
`Engine.OpenChildPage` with only the filename bound to it, the callback
becomes the second argument.
The second argument is cloned to pass it to the child page. Cloning the
callback crashed the engine.
2025-03-17 18:47:43 +01:00
Dunedan f4baf8944c Fix the import of datetime.UTC in bundle script 2025-03-17 13:39:38 +01:00
Ralph Sennhauser f10526284f Don't map unknown scancodes to hotkeys
Users may generate key presses that don't map to a distinct SDL scancode
and will be mapped SDL_SCANCODE_UNKNOWN instead. Using the same ID for
unmapped hotkeys means any such key press will execute unset hotkeys. As
luck would have it in #7644 this leads to calling "Custom exit to
desktop" if the hotkey is unbound as is the default.

So simply use a code for unused hotkeys that doesn't map to any SDL
scancodes.

Fixes: #7644
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-15 20:33:03 +01:00
Sanctorum Thomas 75f414c665 Clear filter when closing Map Browser 2025-03-15 09:27:29 +01:00
Vantha 78900842b1 Improve the "UDP port 20595" connection error dialog
Add a unique disconnect reason for timeouts of connection attempts.
Rewrite the displayed error message and provide a link directly to the FAQ entry.
(The old message was very misleading and only brought players on the
wrong track during troubleshooting)
2025-03-13 15:34:20 +01:00
phosit 40762c257d Quit Engine by closing the root page
When the root page gets closed the engine quits instead or crashing.
The root pages are changed to use that mechanism to quit the engine.
This removes the need of `Engine.Exit` for the GUI.
2025-03-12 12:07:37 +01:00
Ralph Sennhauser 71f78eb2ce Use JOBS var instead of hardcoding on Windows
Don't hardcode the number of parallel jobs in Windows based pipelines
but allow setting the desired number in the environment.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-09 11:14:16 +01:00
Ralph Sennhauser 2a0817d930 Add JOBS support to Unix build pipelines
Allow the number of concurrent build jobs in Unix build pipelines be
specified in the environment via the JOBS variable.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-09 11:14:16 +01:00
phosit df5fee6103 Rename PushGuiPage to OpenChildPage
There is no `PopGuiPage` anymore. For symmetry there should also be no
`PushGuiPage`.
2025-03-09 10:39:20 +01:00
phosit d0ab2cb783 Remove Engine.PopGuiPage
Remove the old now unused interface.
2025-03-09 10:39:20 +01:00
phosit 094a7c2268 Return a promise from most page-inits
Adopt the new interface by all pages which close themself. (Not thous
using `Engine.SwitchGuiPage`.)
2025-03-09 10:39:20 +01:00
phosit 4f62e9f6f0 Change the GuiManager tests to use promises
Adopt the new interface by the tests: as an example and to show that
it's sound.
2025-03-09 10:39:20 +01:00
phosit d3bc5bc802 Enable page-inits to return a Promise
Allows to return the page-completion-value instead of passing it to an
`Engine` function.

Closes: #7000
2025-03-09 10:39:20 +01:00
Vantha 5741f77c6e Add a 'team population' gamesetting
Remove the world population setting from the game setup.
Add a dropdown for choosing the "Population Cap Type".
(-> containing Player Population, World Population, Team Population)

Use a single "Population Cap" dropdown adapting to the pop cap types.
Move all population data into a single .json file.

New system component "PopulationCapManager" for distributing pop caps.

Resolves: #6918
2025-03-06 13:25:43 +01:00
Dunedan c448973398 Remove a bunch of unused scripts
Some of them were simply unused, while others got replaced by Python
scripts.
2025-03-03 20:57:49 +01:00
Dunedan 03cb24d400 Move xmlvalidator code to entity directory
The xmlvalidator logic is only used by the checkrefs.py script, so this
moves it to the same directory to have it co-located and avoid having to
modify sys.path to import it.
2025-03-03 17:45:08 +01:00
Dunedan 118ea18a58 Enable a few more ruff rules 2025-03-03 14:18:40 +01:00
Dunedan 3c57fdb4a9 Fix ruff linting for scripts in source/tools/dist/
By default ruff excludes all files in directories named "dist" from
linting (https://docs.astral.sh/ruff/settings/#exclude). This caused the
Python scripts in `source/tools/dist/` to not get linted. This commit
fixes that and adjusts their style to fit our ruff rules.
2025-03-03 12:45:33 +01:00
Itms b831b1f559 Fix Jenkins pipelines on Linux agent
The Linux agent now runs Docker in rootless mode for additional
security. Operations inside containers must be run as root to match the
underprivileged user running Docker.
2025-03-01 22:08:50 +01:00
Ralph Sennhauser 6738fdbab7 Remove root check in update-workspace.sh
If you run as root then created files will be owned by root, this is
expected behaviour and not messing with permissions as stated in the
error message.

Running in a container the root user may map to the user starting the
container while all other users would need mapping to be able to work
with a bind mounted a checkout.

Further Debian patches out the root check to be able to build on their
builder.

Given the above remove the check.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-01 18:36:44 +01:00
Vantha 13dd7c0bb7 Remove empty and invalid sprite assignments
(They were overwritten by the code anyway)
2025-02-26 16:20:27 +01:00
Vantha 0177b97c69 Complete the GUI XML checks in checkrefs.py
Add checks for sprites, styles, scrollbars, tooltips, and colors.
And too for entire objects referenced by the "use_object" attribute.
(even though that is currently unused)
2025-02-26 16:20:27 +01:00
Vantha 734f8e1192 Add an "OnAttackDetected" trigger 2025-02-26 11:56:52 +01:00
Stan 288f125178 Add three options to the autostart CLI.
- a speed option
- a placement option
- a map visibility option
2025-02-24 22:45:23 +01:00
phosit 40fe7df654 Silence dangling pointer warning for JS::Rooted
With much help by @sera.
2025-02-24 21:30:56 +01:00
Dunedan 18d7746c84 Fix adding port forwardings using UPnP
The UPnP implementation included a combination of two subtle bugs, which
resulted in failure to create port forwardings every time after the
first one.

When using UPnP, the internet gateway to create the port forwardings at
needs to discovered. As that takes a while, the its root descriptor URL
was supposed to be cached after successful discovery in the user config
in "network.upnprootdescurl". However, instead of caching the root
descriptor URL, the control URL got cached. That caused following
requests to the root descriptor URL to fail, as they ended up at the
control URL instead. As such requests might also fail when the network
topology changed, the code was supposed to fall back to discovering the
internet gateway again when the cached one didn't work. However, due to
the inner workings of miniupnpc the request using the cached root
descriptor URL didn't result in an error, so the new discovery was never
triggered. As the wrong value was persisted in the user config there was
also no way to get out of this situation again.

This commit fixes both of these bugs.

As far as I can tell these bugs existed since the introduction of the
caching of the root descriptor URL in 0ba25e9968, which means creating
port forwardings using UPnP has been broken since Alpha 15.
2025-02-24 08:23:07 +01:00
Dunedan 5696f063f5 Reduce time to discover the internet gateway
When adding a port forwarding via UPnP, pyrogenesis first needs to
discover the internet gateway to create the forwarding at. To do so, it
utilizes miniupnpc to send an SSDP request and waits 10 seconds until it
processes the responses and continues to add the port forwarding.
As that happens asynchronously it means if players hosting games rely on
UPnP for port forwarding and if their pyrogenesis instance doesn't have
the address of their internet gateway cached, it takes more than 10
seconds after starting to host a game, before players can join. However,
waiting for 10 seconds is completely unnecessary, because the internet
gateway responds immediately to the SSDP request. Therefore, this commit
reduces the time to wait for responses from 10 seconds to 2 seconds,
which is the timeout miniupnpc uses internally as well, when discovering
internet gateways.
2025-02-23 04:41:43 +01:00
Dunedan fcd3fc2aa3 Create port forwarding for correct port with UPnP
Up to know the UPnP logic ignored the port a user was hosting a game on
and always added a port forwarding for the default port UDP 20595. This
commit fixes that, so a port forwarding is added for the actual port a
game is hosted on.
2025-02-22 20:26:30 +01:00
Dunedan 75d343293f Remove "useLongStrings" logic
As it turns out we don't need that special logic for handling the "long"
locale properly and everything continues to work as before without it.

The only difference is that the number format not being the one from
en_us anymore when using the "long" locale, but the one of the
system-wide configured language, which should be an even better user
experience than before.
2025-02-22 18:18:42 +01:00
Lancelot de Ferrière c475cc2265 Cleaner debug serializer output
The debug serializer currently outputs data even for components where `Serialize = null`.
This leads to useless data being output, especially in OOS debug states which makes diffing more annoying.

Noted in #7634
2025-02-21 18:20:56 +01:00
Vantha aec5bf42da Layout and code improvements on the welcome screen
Move the lines from the .txt to the .xml .
Add separate objects for each paragraph and icon.
Position the icons depending on the paragraph length in the current
language.

This eliminates potential for breakage during translation.

Fixes #7484
2025-02-20 11:15:57 +01:00
Ralph Sennhauser 9a43c43a33 Avoid gcc warning in json_spirit
Gcc-14 triggers a warning for substitute_esc_chars in
json_spirit_reader_template.h if optimizations are enabled.

../../../source/third_party/jsonspirit/json_spirit_reader_template.h:138:62:
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/char_traits.h:427:56: warning: ‘void* __builtin_memcpy(void*, const void*, long unsigned int)’ accessing 9223372036854775808 or more bytes at offsets 0 and 0 may overlap up to 9223372036854775809 bytes at offset -1 [-Wrestrict]
  427 |         return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));

for with lto enabled

/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/char_traits.h:427:56: warning: ‘__builtin_memcpy’ specified bound between 9223372036854775808 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
  427 |         return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));

This looks like another incarnation of bugs like:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100366

Add quirk to avoid the warning

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-02-19 21:52:50 +01:00
Ralph Sennhauser 8baff65e95 Bump Windows libs for premake5 beta4
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-02-18 17:42:42 +01:00
Ralph Sennhauser df38d4e899 Use new premake lto api if available
Premake v5.0.0-beta4 replaces the LinkTimeOptimization flag with a
function linktimeoptimization, use it if available to avoid deprecation
warning.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-02-18 17:42:42 +01:00
Ralph Sennhauser 84b407aa35 Update premake to v5.0.0-beta4
https://github.com/premake/premake-core/releases/tag/v5.0.0-beta4

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-02-18 17:42:42 +01:00
Ralph Sennhauser 77256c8d32 Fix profiler2 webui html
Cleanup some bogus tags and outdated css attribute.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-02-17 21:22:30 +01:00
Ralph Sennhauser 4b59d6b739 Update jquery used by profiler2 webui
jquery 1 is for support of old version of browsers not even maintained
this days.

Updating prevents occasional hangs for me.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-02-17 21:22:30 +01:00
AFCMS 51bbdc6537 Improve the software center display of the application
- OARS content rating have been updated to version 1.1
- Touch Screens, Keyboard, Mouse have been marked as supported
- Laptop screens and bigger are marked as required to the minimum width of 1024 required by the game
- Fixes the device compatibility page on GNOME Software.
- added a "0AD" keyword to  fix an issue with Flathub search feature where searching for "0AD" instead of "0 A.D." returns no results.
2025-02-17 21:07:17 +01:00
Stan cf0c285d8e Patch metainfo file to to match the new requirements 2025-02-17 21:07:12 +01:00
Sanctorum Thomas 37065ebc71 Harmonized design between civinfo and structree 2025-02-16 09:10:16 +01:00
Vincent Cheng 026a668a0f Make sure mozjs patch FixFpNormIssue.diff applies cleanly on i386 2025-02-15 12:46:08 +01:00
Ralph Sennhauser 82ff0ea90b Remove CONFIG_ENABLE_BOOST
Code within CONFIG_ENABLE_BOOST is required to compile pyrogenesis.

As boost is required in many other places, making it truly optional in
the one case where there is currently a guard is meaningless.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-02-14 20:35:04 +01:00
scuti a9819e9865 Created hotkey to grab and release mouse.
Addresses #6790
2025-02-14 20:18:49 +01:00
phosit a786a1f3d8 Use std::variant in Future
Either a return value or an exception has to be stored. With
`std::variant` it's more explicit.
Also the return value is never empty, so there is no need for
`std::optional` anymore.
2025-02-10 18:11:02 +01:00
scuti e87d3e4137 Check if online before calling engine command. 2025-02-09 18:50:15 +01:00
scuti 490c3eb22b Fixed messages of type 'system' not-printing. 2025-02-09 18:50:15 +01:00
scuti 7d616763a4 Fix /kick or /ban segfaulting in singleplayer
Addresses #7467
2025-02-09 18:50:15 +01:00
Andreas Traber 33f332047d Add atraber to list of contributors. 2025-02-09 16:00:22 +01:00
Andreas Traber 05f31300a1 Fix multiple bugs where a wrong variable is used.
Those bugs stood out to me as I was experimenting with migrating petra
to ES6 classes. Since this give the code stronger typing, those kind of
errors stand out immediately.
For example, autoResearch is a function, thus referring to it by name
will always return the same result. In other cases the referenced
variables simply don't exist.
2025-02-09 16:00:22 +01:00
Langbart dffa892c60 fix: rlclient update resource gathering and map name
fix: #7540
2025-02-09 14:38:55 +01:00
Martijn van Duren 064ab14577 OpenBSD supports pkg-config 2025-02-09 14:32:38 +01:00
Martijn van Duren 2338473da1 Make libraries/*/build.sh use "${TAR}" instead of tar directly.
This allows systems using a tar version not supporting all the required
flags to easily switch to gnu tar.
2025-02-09 14:31:10 +01:00
Lancelot de Ferrière 5f117532a4 Map generation: speed up ParseEntities
When marking a tag dirty, the obstruction manager checks it has not already done so. This is un-necessary when the global state is marked dirty, and this check is rather slow since we do it once per entity, effectively leading to an o(n^2) runtime.
2025-02-09 11:30:35 +01:00
Feldfeld 5dcef8c17a Uniformize Han farming technologies
Reported by stevenlau in https://wildfiregames.com/forum/topic/127586-a27-disadvantageous-farming-tech-upgrade-time-cost-for-han/

Missed in b4155900d3 / D4720
2025-02-01 23:23:18 +01:00
Ștefan Talpalaru 3ff3f72890 build-source-libs.sh: fix "--with-system-premake" 2025-01-31 13:01:40 +01:00
Ralph Sennhauser bccd3db231 Add missing header in KeyName
Reported-by: @svenstaro
Ref: #7564
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-01-30 21:15:28 +01:00
drh 03ceb27e90 Add camera pan inversion option
Fixes: #6539
2025-01-30 18:42:59 +01:00
Carl-O 7d4a6c5d07 Capitalization of first letter of word 2025-01-29 22:58:51 +01:00
phosit b41ca5ad78 Replace FALLTHROUGH by the standard attribute 2025-01-29 19:34:12 +01:00
phosit 473f8ca72e Remove FALLTHROUGH on empty cases
`#include "lib/code_annotation.h"` can be removed in some places.
2025-01-29 19:34:12 +01:00
Langbart 2fe7555002 fix: git diff to work on LFS files for map xml files
Users can enable this by setting:
git config diff.lfs-xml.textconv cat

Ref: #7519
PR: https://gitea.wildfiregames.com/0ad/0ad/pulls/7539
2025-01-29 08:37:16 +01:00
Dunedan db35a8494c Update supported languages for the NSI installer
235ea5cfb4 updated the languages supported by 0 A.D., but missed
updating them for the installer. This commit makes up for that and
updates the languages for the installer as well.
2025-01-28 19:14:16 +01:00
Vladislav Belov a7ead4cf4c Disables compute shaders for GL ARB backend. 2025-01-28 18:56:15 +01:00
Vantha 1a7947f9c9 Remove empty duplicate of TipDisplay.js
It was accidentally only emptied instead of removed in 38b71c1bac.
2025-01-28 08:40:00 +01:00
Vladislav Belov 635a268dd9 Disables GL storage buffers on Mesa.
This is a workaround to avoid disabling GL storage buffers completely.
Because they might not work or might lead to a decreased performance.
We need to investigate that further when we have a local reproduce.
2025-01-28 01:40:47 +01:00
phosit ec6ed7f224 Remove deprecated functions in map generator
Map generation scripts should use the new interface introduced in
6ce2fc53ea.
2025-01-27 17:50:39 +01:00
phosit d3fc3c221e Remove last usage of Engine.SetProgress
On Danubius removing the usages was forgotten in e01ea16ae5.
In Coast Range and Migration they were newly introduced.

There are also some whitespace changes in Coast Range.
2025-01-27 17:50:39 +01:00
Itms 6ac5c376ea Fix crash when trying to join games in lobby dialog
This fixes an oversight from d655455304. During a code deduplication, a
check was removed. When looking at the lobby as a dialog (while in
gamesetup), it should be impossible to try to join a game.
2025-01-27 10:15:45 +01:00
Itms ffa11b37a8 Fix oversight from 726b07e209
This does not cause any actual bug, as the handler is called again when
a game is selected.
2025-01-27 10:14:17 +01:00
Langbart 1a154a5704 Bump OpenAL to 1.24.2 on macOS
Fixes #5978
2025-01-25 14:19:08 +01:00
Stan 6df98d8ed6 Fix broken ceasefire autostart option
Fixes: #7495
2025-01-25 12:41:30 +01:00
Paul Robinson 5b98a647dc Adding Engine Version and Mod name/version checks to multiplayer handshake.
Incrementing protocol version as handshake messages have changed.
2025-01-25 07:39:32 +01:00
real_tabasco_sauce 60d388804a Add gathering animations to the marian legionary
Fixes #7438
2025-01-22 15:01:23 +01:00
Dunedan 2ea183d744 Allow to check multiple locales at once 2025-01-21 11:01:42 +01:00
Dunedan bcdbe2e580 Add the ability to specify which rules to check 2025-01-21 11:01:40 +01:00
Dunedan 25e83d603f Check for wrong whitespaces in project name
This adds checks to check for missing non-breaking space in "0 A.D.".
2025-01-21 11:01:37 +01:00
Itms e1ecc4a743 Fix unix-build tarball inclusion of text files
The .txt were wrongly send to a subdirectory named `.` and the files
converted to Markdown were forgotten.
2025-01-20 22:03:07 +01:00
Itms 95fb0f9ed0 Remove unused Ptolemaic Juggernaut prop template
This is an oversight from 415304db8a and #6660.

This forgotten template cropped up in #7525. It does not contain the
needed components to interact correctly with the player.
2025-01-20 20:33:27 +01:00
Ralph Sennhauser efc9c09280 Remove spurious fi in build-source-libs.sh
d15f1c29e4 added an extra fi, remove it.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-01-20 16:58:37 +01:00
Ralph Sennhauser 3aa95b7a28 Prefetch tarballs in bundle pipline
Fetch third party tarballs for source packages so they will be bundled
in source release tarballs.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-01-20 16:58:37 +01:00
Ralph Sennhauser f9a43c8c40 Add support for fetch-only for libraries
Used to prefetch all required tarballs to build pyrogenesis later
without network access as is common for Linux package build and some
other CI environments.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-01-20 16:58:37 +01:00
Dunedan 4d19935f48 Ensure buttons on summary screen are always on top
On low vertical resolutions when playing games with 8 players in 4
different teams, the summary will overflow the available vertical space.
This commit ensures that in such a case the buttons below the summary
are still clickable by ensuring they stay always on top of the summary.
2025-01-20 15:55:41 +01:00
Dunedan 8b40ce59ad Fix vertical alignment of team summary
This fixes the vertical alignment of the team summarized values on the
summary screen.

Fixes #7527
2025-01-20 15:55:41 +01:00
Daniel Roschka 274500eb37 Always use STUN for hosting games using the lobby
This makes using STUN mandatory for games hosted using the multiplayer
lobby. The motivation for that is a reduction in complexity, because
right now if STUN is disabled we use a home-grown STUN-like logic, which
got implemented before Pyrogenesis got STUN support.

That home-grown logic relies on a custom ejabberd module (mod_ipstamp),
which inserts the external IP-address of a host in the response messages
when a host registers a game. Originally mod_ipstamp was also used to
inform all potential players of a hosts IP-address, however that has
already been removed to let hosts to only share their IP-address with
players actually joining their game.

Removing the home-grown logic and instead always relying on STUN removes
complexity in Pyrogenesis and the lobby server and also eases hosting
games for players, as they don't have to figure out anymore whether they
need to enable STUN or not.

These changes shouldn't negatively impact the ability of Pyrogenesis to
handle different types of NAT or broken networks. There is one
difference though: While the custom logic using mod_ipstamp utilized TCP
as transport protocol, the STUN implementation in Pyrogenesis currently
uses UDP. That doesn't allow hosts with UDP-connectivity issues to
resolve their external IP-address anymore, however without
UDP-connectivity they aren't able to successfully host games anyway, as
the actual game updates are transferred using UDP as well.
2025-01-20 06:52:14 +01:00
Vantha 7485b37ba3 Fix alignment issue with 'imgleft' and 'imgright'
Bug was introduced by f8d2927748.

Fixes #7397
2025-01-19 17:50:16 +01:00
Lancelot de Ferrière 1b1e00d6c4 Remove profiler 2 spike/aggregated regions
This code is unused and was never actually useful.
Fixes #6620.
2025-01-18 12:36:20 +01:00
Lancelot de Ferrière 34844ca9a4 Speedup StartProcessingMoves when mostly idle and many threads 2025-01-18 12:32:28 +01:00
Lancelot de Ferrière fed028a386 Prevent GameSettings from setting more players than the map supports 2025-01-18 12:18:33 +01:00
phosit 3a94cb0bfe Fix maybe-uninitialized warning in EntityMap test
Reading `second` on the end of the range is undefined behavior. Invoking
`test.find` in the test never evaluates to the past the end iterator.
GCC doesn't know that and issues a "maybe-uninitialized" warning.
2025-01-16 21:12:28 +01:00
phosit eb07f20f2f Translate "Changing password…"
Introduced in d0ebcbe038.
Reported-by: @elexis
2025-01-16 21:09:57 +01:00
phosit 068346b502 Always early return if no receiver is found
This lead to an error because `addressee` is `undefined`.

Defect introduced in dcb8ef9b52.
Fixes #7466
Reported-by: @Langbart
2025-01-16 18:27:55 +01:00
Stan 117b9ed9d4 Check more things in checkrefs hook 2025-01-16 09:27:11 +01:00
freagarach 1d6f7f3837 Always mark 'PromotedEntity' on transform
If the new entity did not have Promotion, we would fail to do so.
Not doing this caused ghost units to appear when promoting inside a GarrisonHolder.

Fixes #7472, reported by Langbart.
2025-01-15 19:22:54 +01:00
phosit 4be8e0bcfb Tell GCC the maximum value of m_BufLen
GCC thinks `m_Buf + m_BufLen` can be outside the bound of `m_Buf`.
That is because `m_BufLen + len < CHUNK_SIZE` can evaluate to `true`
even if `m_BufLen` is bigger than `CHUNK_SIZE` due to wrapping. Tell GCC
that it's not possible.
2025-01-13 20:05:43 +01:00
Dunedan b2f50519fa Remove one last mention of Trac 2025-01-13 16:28:46 +01:00
ramtzok1 11f4672fa5 None will be shown as the first option 2025-01-12 11:32:42 +01:00
Itms dc830ccf55 Switch main branch to Release 28 2025-01-12 01:27:02 +01:00
Dunedan 60c469bb64 Improve variable naming in check_diff.py 2025-01-11 21:44:52 +01:00
Dunedan a92a4ff45c Update the pre-commit hooks 2025-01-11 21:44:52 +01:00
Dunedan 5aa96cd282 Fix vertical alignment of main menu submenu items 2025-01-11 17:45:55 +01:00
Dunedan 5f086a7851 Improve colormixer layout 2025-01-11 17:45:55 +01:00
Dunedan 205cb812ea Refinement of space for multiplayer login 2025-01-11 17:45:55 +01:00
Dunedan 9a276c04ff Improve layout of the mod selection help window 2025-01-11 17:45:55 +01:00
Dunedan 5645aa7e97 Fix size of red buttons in options window 2025-01-11 17:45:55 +01:00
Dunedan 8a3719dc54 Fix size of red buttons on summary screen 2025-01-11 17:45:54 +01:00
Dunedan 4efc04e5dc Fix vertical alignment of dialog title 2025-01-11 17:45:54 +01:00
Dunedan a53cf7b963 Remove some white space around the tips window 2025-01-11 17:45:54 +01:00
Dunedan c7b6b5147f Improve spacing in the structure tree window 2025-01-11 17:45:32 +01:00
Dunedan 34ba0d1092 Improve spacing in the unit detail window 2025-01-11 17:45:22 +01:00
phosit 8292b0c646 Don't show warning on aichat messages
AI's chat messages are always received by every client. It's not
necesarry to warn about them.

Defect introduced in e04506814a.
Refs: #7466
2025-01-10 22:30:26 +01:00
phosit fde696a401 Don't show warning on ai -> ai messages
AI's can't receive chat messages. AI's sometimes send chat messages to
other AI's.

Defect introduced in e04506814a.
Refs: #7466
2025-01-10 22:30:26 +01:00
Dunedan 235ea5cfb4 Update supported languages for Alpha 27
This removes Catalan and Scottish Gaelic as supported languages, as they
now both have a coverage of less than 80% and adds Galician and
Portugese which both have 100% coverage right now.
2025-01-10 05:52:02 +01:00
Vladislav Belov cf9bc03ee9 Adds a temporary hack for grass lighting.
The hack uses per-vertex lighting for translucent objects. In the
future we need to use a separate shader.
2025-01-09 01:48:56 +01:00
Itms 3727c9dd3d Small improvement to JS props iteration
Based on a suggestion by phosit on #7404.
2025-01-08 17:55:56 +01:00
Dunedan 73af7e61dd Make more room for tooltips in game setup
b90280855f added an additional label to the bottom of the game setup
page for indicating that a game is started from a saved state. This
reduced the space available for tooltips and looked oddly placed.

This commit changes that, by resizing the `SavedGameLabel` and
`GameSettingWarning` objects dynamically so they only take the space
necessary to display their caption. It also tweaks the vertical margins
of the tooltip to allow more lines to be shown at once.

While this still doesn't allow to show all tooltips on low resolutions,
it's now better than with Alpha 26.
2025-01-08 14:04:21 +01:00
Langbart 6b87a9b932 fix: reset promoted worker metadata
fix: #7471
2025-01-08 13:46:00 +01:00
Itms e48b9ea106 Only freeze once the cached JS values of templates
CParamNodes can be quite large, thus we usually cache the JS::Value when
converting them. The AIInterface makes heavy use of it as detected in #7404.

However, the cached values are re-frozen everytime, which is a
significant waste of time on a large number of templates.
2025-01-08 11:39:17 +01:00
Ralph Sennhauser f97a1f1c54 Fix spidermonkey profiling build
Instruments is macOS only, so don't try to enable it on other platforms.

Also don't quote ${JOBS} as it might be unset and passing an empty
string to "mach build" may result in configure failing.

Fixes: #7470
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-01-08 07:32:59 +01:00
Lancelot de Ferrière e5c2193313 Fixup 6ab5483550 - handle unset values correctly 2025-01-07 18:14:59 +01:00
Itms 9f023825e0 Export a 10-char commit hash in the build version
This avoids collisions in the user report, fixes #7174.
Update the user report version to account for the new build version
format, fixes #7173.

The build version displayed in the GUI is kept at 5 characters for
main menu clutter concerns.
2025-01-07 13:51:45 +01:00
Vladislav Belov 8ee48a164a Fixes missing SPIR-V shader combinations.
We have multiple renderer backends for a while. So we can't rely on
a single CONFIG_GLES2 macro for disabling features.
2025-01-07 02:49:38 +01:00
phosit 16c0db12a9 Remove leftover from 113fefeeb7
The string literal was implicitly converted to `true`.
This is likely a leftover from testing.
2025-01-06 21:40:15 +01:00
phosit 9637fcdb56 Remove comment on the constructor of CNetServer
The second line was forgotten to remove in 8eecc39e71.
The first line is useless.
2025-01-06 21:40:15 +01:00
Ralph Sennhauser edde9fb4ee Avoid segfault with curl 8.10/8.11
With curl 8.10 [1] calling curl_multi_remove_handle retruns
CURLM_BAD_EASY_HANDLE iff the handle was removed already and no other
easy handle were registered. This resulted in ENUSRE triggering a
segfault during shutdown as reported. This was fixed upstream after
8.11.1 [2].

Do a runtime version check and for affected version allow
CURLM_BAD_EASY_HANDLE.

[1] curl ba235ab269080dc66e35835c829f7ac4290dbc1d
[2] curl 713182bd196bba014ba77f71176fea3de2236724

Fixes: #7295
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-01-06 06:59:14 +01:00
wowgetoffyourcellphone c798a12815 Fix projectile modifier oversight and references
Update trigger script
Update Attack.js component
Update the relevant techs
Update unit_tables.py
2025-01-05 22:49:18 +01:00
phosit 7c1a566d3e Consistent coment length to seperate message-types 2025-01-05 19:57:12 +01:00
phosit c32a747873 Use early return when there is no message 2025-01-05 19:57:12 +01:00
elexis c9e76efe7b Store whether a player is activ in C++
This prevents mods from mutating this value and revealing the map.

Part of this commit is written by @phosit.
2025-01-05 19:57:12 +01:00
elexis f932b8b9cc Fix subscription time of script component wrapper
Script component wrapper attempted to subscribe to messages before the
script component has been registered.
This defect existed since 7c2e9027c2 but was never noticed since there
is no script component wrapper which subscribes to messages. (Only the
script component it wrapps does.)
2025-01-05 19:57:12 +01:00
Cayleb-Ordo 90d276b0dc Make windows batch-scripts independent of calling directory
Change dir to batch-script location as first action. This
allows to run the script from outside the directory its stored.
2025-01-05 19:38:37 +01:00
phosit 21eddf0d39 Silence maybe-uninitialized warning in mongoose
Additionally list warnings in alphabetical order.
2025-01-05 15:30:41 +01:00
elexis e19a5eda9f Fix changing view to observer
`id` was compared to the wrong player.
This defect was introduced in 023527e56e.
2025-01-05 15:16:41 +01:00
Vladislav Belov 0467d27b07 Fixes slow-path texture conversion on RPI4.
RPI4 returns `false` for `textureCompressionBC` because it doesn't
support formats above BC3. As the Vulkan specification requires to
support all BC formats to have `true` for `textureCompressionBC`.
2025-01-05 00:27:02 +01:00
Vladislav Belov 54701868da Fixes GLES compilation. 2025-01-04 18:22:23 +01:00
elexis 88df5ec95f Don't focus on spies for non-following observers
Missing since introduction in e14ad3c771.
2025-01-04 18:01:29 +01:00
elexis 015aa0349b Fix vulnerability in spy-request
Introduced in d9d1f1bbeb.
This allowed draining an enemies metal resources by ordering spy-request
for that player.
Fixes #7230.
2025-01-04 18:01:29 +01:00
Lancelot de Ferrière c20ca02911 Fix AI errors when promoting an athenian spearman to champion.
Ideally the AI would try to carry on and recover gracefully but the code is setup in such a way that this seems like it would lead to a lot of different bugs down the line.

With help from @langbart on QA and code.

Fixes #7425
2025-01-04 15:44:05 +01:00
Lancelot de Ferrière a8fc3cf254 GameSettings: ensure savegameID is either a file name or undefined.
The current code could end up with savegameID being undefined, false, a filename string, or null depending on the code path taken.
Adapt C++ in consequence.
2025-01-04 15:01:27 +01:00
Lancelot de Ferrière fba5a23aad Fix sounds playing in the wrong places of the map
Introduced by a typo in f8afd49ae1.
Fixes #7345, reported by wowgetoffyourcellphone
2025-01-04 11:53:26 +01:00
Lancelot de Ferrière 3756e12701 Fix overlay renderer when changing displayed player.
Observers have the ability to change the currently displayed player, and this broke the logic of commit f3f695b90e.
By instead storing the displayed player in CmpOverlayRenderer, we can remove the workaround to set a 'dirty' flag as well.
2025-01-04 09:43:33 +01:00
Feldfeld b4443d396e Make Brit Crannog tooltip more accurate
Previously, arguably the tooltip hinted that naval technologies could be
researched which is not true. That could be a little confusing.
2025-01-03 22:15:17 +01:00
Feldfeld 5c25b6f644 Uniformize dock trainable entities
Docks are generic and have all ship entities. This comes to play notably when
they are captured. This is currently not the case for special docks (Crannog and
Cothon). For consistency they are given ship entities that are trainable by
other civilizations.

Also, the Crannog was not updated with the naval overhaul and still had the
trireme and bireme entities. They are now removed.

Fixes #7426
2025-01-03 22:15:17 +01:00
Itms 2482ecf9fe Sign and notarize macOS bundles 2025-01-03 17:05:15 +01:00
Itms 604d4ce29c Fix another macOS lib download source 2025-01-03 17:05:14 +01:00
Dunedan 33e9cd6126 Increase height of StoneButtons and TabButtons
This increases the height StoneButtons and TabButtons, so that a
double-spaced caption does fit on them without significant overflow.
Exempt from that are the StoneButtons resembling lists in the main menu
and the in-game menu, as changing their height didn't feel right and we
don't need double-spaced captions for them anyway, as they're wide
enough.

The height of StoneButtons got increased from 28px to 32px, while the
height of TabButtons got increased from 30px to 34px.
2025-01-03 16:33:51 +01:00
Lancelot de Ferrière 2f7ac026c1 Avoid idle 'flicker' because of regular formation regroups
Since 71a61d5f50, formations regularly regroup. However, units already at their correct offset should remain idle. This doesn't happen as we cannot check if we are at destination.
This exposes that and handles things properly... Unfortunately UnitAI has already left the IDLE state at this point, so we still get counted as no-longer idle for a turn.
To fix this, try and detect that particular situation without triggering infinite loops.
2025-01-02 16:59:13 +01:00
phosit a1a08f1890 Assign players to their slot from the savegame.
Based on a patch from @elexis.
2025-01-02 13:43:55 +01:00
phosit eafcb814cd Simplify playerassignments code
Deduplicate a check by moving it to isSlotAvailable.

Based on a patch by @elexis.
2025-01-02 13:43:55 +01:00
Stan fa19cb10fd Fix updating the OpenAL library
Some folders were not properly purged
2024-12-31 17:20:04 +01:00
Lancelot de Ferrière e24d01b0b1 Fix autostart issues reported by langbart in 2535e5f5b4 2024-12-31 10:09:07 +01:00
Lancelot de Ferrière e15ffd70b7 Fix Identity serialization following 533429e800
Failed to notice that name and controllable were sometimes changed.
2024-12-31 10:08:52 +01:00
phosit 9e740c84b9 Fix wrong variable name in caledonian_meadows
Defect introduced in 22a8f367f8.
2024-12-31 09:43:46 +01:00
phosit 54ce60e965 Fix error on large hights in Belgian Uplands
Defect introduced in 163063c2a4.
2024-12-31 09:43:46 +01:00
phosit 82513c9104 Catch all std::exception when loading a map
Since 0eed117e6d exceptions from the map generation script are rethrown
in the main thread but not all of them are catched.
2024-12-31 09:43:46 +01:00
wowgetoffyourcellphone da761ca501 Update the New Maps campaign file
Include new/updated skirmish maps and brand new random maps by @real_tabasco_sauce

Revert name and description strings only
2024-12-31 02:31:32 +01:00
Stan bce3a2a170 Fix the viking longship
- Apply Scale
- Rename mesh from Circle to viking_longship
- Remove useless material
- Add prop-projectile-prop point

Reported by: @Langbart
Fixes #7424
2024-12-31 02:25:35 +01:00
Stan 3499efe014 Add two missed files in previous commit 2024-12-30 23:42:34 +01:00
Stan df6ed56667 Add OpenAL Soft for macOS 2024-12-30 22:48:41 +01:00
Stan fd78034885 Mod Interface: Enable setting territory visibility
based on a patch by: aeonios

`off` means that the territory visibility cannot be changed
`hidden` means that it's hidden by default but can be enabled
`visible` means it's visible by default
2024-12-30 22:23:05 +01:00
Stan dc60a095dc Fix the statue_discobolus_cover.dae mesh
Reported by: @Langbart
- Add missing UVMap
- Apply scale
- Remove unused material
- Rename mesh from Plane.003 to discobolus_cover

Fixes #7423
2024-12-30 22:17:30 +01:00
Stan 7315b4e59f Rename Ship Combat Demo to match conventions
Reported by: @Langbart
Refs #7422
2024-12-30 22:12:54 +01:00
Dunedan 1aeb19b535 Improve alignment of in-game top menu
This improves the alignment of the items of the top menu in-game. Icons
are now better centered and don't overflow anymore and the build label
text doesn't stack on low resolutions anymore either.
2024-12-30 18:47:05 +01:00
phosit fb9b02a9ba Never change the names in the "Player Name" column
The intent of this branch was to not change the names when a saved game
is loaded. So that one can see who was where in the saved game.
It was implemented wrong: The names didn't change when no savegame was
loaded and changed when a saved game was loaded.

This commit make the soved game case and no saved game case consistent.

Defect introduced in b90280855f.
2024-12-30 15:23:31 +01:00
phosit 5c860c3121 Respect the enabledness in PlayerColor
There is no way to show the `PlayerColor` as disabled. As the player
color is vilible without this it can simble be hidden when it is
disabled.

Defect introduced in b90280855f.
2024-12-30 15:23:31 +01:00
phosit b52c1c137f Load the PlayerNames dependant on their origin
`PlayerData` didn't contain the playerNames when serialized because they
should not be loaded when a new game is made. This lead to the issue
that client didn't receive the initial player names of saved games.

Now `fromInitAttributes` gets as a second parameter whether the
initAttributus are from persistent settings.

Defect introduced in b90280855f.
2024-12-30 15:23:31 +01:00
phosit 199aa8ac35 Rebuild the selection list when rendering an ai
When a saved game gets loaded ai's aren't always selectable. This lead
to errors when an ai actually gets selected.

Defect introduced in b90280855f
2024-12-30 15:23:31 +01:00
phosit 8636e4d0fd Render GameSettingsWarning on construction
`GameSettingsWarning` where only rendered when the settings change. When
a saved game is loaded it's possible this setting is enablet without the
setting being changed.

Defect introduced in b90280855f.
2024-12-30 15:23:31 +01:00
phosit 4c48661b4f Disable mapbrowser when a saved game is loaded
Make it consistent with the "Browse Maps" buttow which is also
unavailable when a saved game is loaded.

Defect introduced in b90280855f.
2024-12-30 15:23:31 +01:00
phosit 96aa283e6a Make MapPreview always listen to map changes
When loading a saved game the user can't change the maps but when
receiving the initAttributes from the host the map is "changed".

Defect introduced in b90280855f.
2024-12-30 15:23:31 +01:00
Stan f14a98e26f Bump minimum macOS SDK to 10.15
According to https://firefox-source-docs.mozilla.org/widget/cocoa/sdks.html Firefox doesn't support anything lower than 10.15 at runtime. So neither do we.
Fixes #7370
2024-12-30 11:14:59 +01:00
Lancelot de Ferrière a6693e8c1f Fix samply profiling of SM JS code 2024-12-30 09:13:06 +01:00
Ralph Sennhauser 28b0801e82 Print diff for ruff-format if check fails
It's a bit hard for contributors to figure out what ruff-format is
unhappy about if all they get is a return status of non zero. Enable
printing a diff with suggested changes with the pre-commit hook.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-12-30 06:23:22 +01:00
Vantha 33111dc816 Fix phase names not updating on the structure tree
Reload all cached phase data when switching civ.
Add missing query for the generic phase technologies to the phase idents.
2024-12-29 22:21:28 +01:00
Vantha 314bc4185b Fix incorrect SpecificName syntax introduced in 94baa560b1 2024-12-29 22:21:28 +01:00
Dunedan 8a9813234e Remove GetFileMTime() 2024-12-29 09:32:17 +01:00
Dunedan 894e349ebf Add a deprecation warning for using GetFileMTime() 2024-12-29 09:32:17 +01:00
Dunedan ab0aee4cfa Use MD5 hash for splash screen version check
Instead of using the file modification date, this uses the MD5 hash of
the file holding the content of the splash screen for the version check.
This ensures the splash screen isn't unintentionally shown again when
just the modification date of the file changes.

Fixes #4399
2024-12-29 09:32:17 +01:00
Lancelot de Ferrière c2bb61fffc Fix terrain normals to account for angle 2024-12-28 13:25:07 +01:00
Dunedan 1268854587 Improve layout of the match summary screen
This improves the layout of the summary screen, so text and displayed
values fit better. By doing so this also removed the need to specify a
"verticalOffset" for values, as they get vertically centered now.
2024-12-28 12:10:07 +01:00
Dunedan fc7e4ae69e Small UI adjustments for better text fitting
When running 0ad with a language other than English, there are various
places where text doesn't properly fit. This adjusts the UI in a bunch
of these places to better accommodate longer strings as they appear in
other languages than English and to make the UI look more uniform in
general.
2024-12-28 08:52:13 +01:00
Lancelot de Ferrière 099a718e62 Fix pre A25 savegame compatibility 2024-12-28 08:47:35 +01:00
wowgetoffyourcellphone ba24b46693 Fix normal map orientation for terrains
Fix normal map orientation for Terrains

- Terrains use "OpenGL" style normal maps, while 3D assets use "DirectX" style normal maps. So, fix all of the normal maps I can find with incorrect style normal maps.
- Set most terrains to angle="0" for more accurate shading. This negatively affects "tile" terrains, which we want to have a 45 degree angle, but helps all other terrains. aegean_paving_01 is an example of a permanent fix for this, which I will work on with Stan for R28.
- Adds a couple of really nice paving terrains for a new "Italy" terrain set.
- Adds a nicer "furrows" normal map for farmland terrain
- Improved persian city tile normal by @wraitii
2024-12-28 00:34:14 +01:00
wowgetoffyourcellphone 67bed64fd1 Last minute art changes and fixes.
New AO maps for statues by @nifa (which fixes the Discobolus ao error)
New quiver for Persian Immortal
Remove bad smoothing for Chinese rice hat
Remove some noise from a couple of structure skins
Add garrison flag prop points to Greek theaters
Make garrisoned flags unselectable. Requested by @real_tabasco_sauce
Update han_ricehat.dae
2024-12-28 00:33:50 +01:00
phosit e04506814a Multicast chat messages
Only the sender and the recipients receive the chat messages.
This commit only has an affecto on messages where the addressee(s) are
selected through the dropdown. Addressee(s) selected with a "/" command
are still sent to evevyone and filteret by the receiver.
2024-12-27 19:32:03 +01:00
elexis 023527e56e Prevent players to reveal the map from GUI script
`Engine.SetViewedPlayer` and `Engine.SetPlayerID` could be used to
reveal the map from GUI scripts and the in game console.

This is prevented by querying the simulation whether this player is
allowed to call thous functions.

These two vulnerabilities were introduced with their respective
features:
20e7d2224a introduced SetPlayerID to allow controlling other players
	using the developer overlay.
a2f7d4d82a introduced SetViewedPlayer to allow observers to change the
	perspective.
2024-12-27 19:01:53 +01:00
Lancelot de Ferrière 40d3ea33d8 Fix tutorial autostart 2024-12-27 09:37:00 +01:00
scuti faa063ee42 Add myself to credits. 2024-12-26 16:14:38 +01:00
scuti a81c38bab9 Skip playing audio of corrupted files.
Prints a warning instead of crashing.

Fixes #7150
2024-12-26 16:14:38 +01:00
Ralph Sennhauser fb24d75f0e Bump release version to 0.27.0
Also drop build version component as we never used it in earlier
releases either. This will also make replays et al be stored in a
directory 0.27.0 similar to earlier releases.

The build version component was introduced in 028ec40165

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-12-26 14:11:43 +01:00
Dunedan 870b356ad9 Fix font size of error for incompatible save games
The font size in the error message dialog for incompatible save games
was way larger than usual. This fixes that, by removing the arbitrarily
applied font size.
2024-12-25 19:20:35 +01:00
real_tabasco_sauce a4541a1745 Add "new" keyword to migration, foothills, and coast range
Fixes #7362
2024-12-25 15:56:55 +01:00
Stan b579e68d5d Fix casting autostart-size 2024-12-24 12:30:23 +01:00
elexis d12c015d43 Erase client state hash on disconnect
Fix `NetServerTurnManager` from pausing the simulation forever after a
client sent a bad hash to it and disconnects before the bad hash has
been processed.

A client that sends a wrong simulation hash to the `NetServer` and
disconnects before the server compares that hash causes a message box to
appear and the game to be paused forever.
94e5d88169 introduced the bug by missing to delete `m_ClientStateHashes
upon `UninitialiseClient.
This causes `m_ClientData[hashPair.first].isOOS = true` to insert a
client with blank values that the `NetServerTurnManager` will wait
forever and hence the message box about an OOS with no players being OOS
is shown (the playername is emptystring).

5ebf2020b0 exposed the bug by making observers able to lag behind,
providing a longe enough timeframe for this to occur.

Fix:
Deleting `m_ClientStateHashes` upon disconnect solves the broken
message box and the pausing.
2024-12-23 08:09:18 +01:00
elexis 5b33dd0143 Exclude fireships and scoutships from Danubius
These ship types were introduced in d51b4687e9. Danubius isn't designed
to use these ship types, as it uses ships to garrison 30 units.
2024-12-23 08:00:41 +01:00
Ralph Sennhauser 3c8760aa43 Add option categories to premake
Adding a category to newoption calls groups our options together instead
of mixing them with premake General options in --help output.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-12-23 06:15:32 +01:00
5548 changed files with 3090055 additions and 167522 deletions
+15
View File
@@ -5,6 +5,13 @@ charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
[*.Dockerfile]
indent_size = 4
indent_style = space
[*.{js,mjs}]
indent_style = tab
[*.py]
indent_size = 4
indent_style = space
@@ -12,6 +19,7 @@ indent_style = space
[*.sh]
indent_style = tab
function_next_line = true
simplify = true
switch_case_indent = true
[*.{yaml,yml}]
@@ -20,3 +28,10 @@ indent_size = 2
[build/premake/premake5/**]
ignore = true
[*.Jenkinsfile]
indent_size = 4
# Jenkins recommends using spaces for indentation. See:
# https://wiki.jenkins.io/display/JENKINS/Code+Style+Guidelines
# Additionally, our linter npm-groovy-lint does not support tabs.
indent_style = space
+1 -1
View File
@@ -3,9 +3,9 @@
*.hmap filter=lfs diff=lfs merge=lfs -text
*.icns filter=lfs diff=lfs merge=lfs -text
*.ogg filter=lfs diff=lfs merge=lfs -text
*.otf filter=lfs diff=lfs merge=lfs -text
*.pmd filter=lfs diff=lfs merge=lfs -text
*.pmp filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.psa filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
binaries/data/mods/public/maps/**/*.xml filter=lfs diff=lfs merge=lfs -text
+10 -10
View File
@@ -6,18 +6,18 @@
ruff\\.toml @Dunedan
## == Build & Libraries
(build|libraries)/.* @Itms @Stan
(build|libraries)/.* @Itms @Stan @sera
## == Engine
source/(lib|maths|ps)/.* @vladislavbelov
source/(lib|maths|ps)/.* @vladislavbelov @sera
## GUI
#source/gui/
source/gui/.* @vladislavbelov @trompetin17
## Rendering
source/(collada|graphics|renderer)/.* @vladislavbelov
## Multiplayer
#source/(lobby|network)/.*
source/(lobby|network)/.* @Phosit
## Simulation
source/simulation2/.* @wraitii @Itms
source/simulation2/.* @wraitii @Itms @Phosit @sera
## == Tools
source/tools/.*\\.py @Dunedan
@@ -28,19 +28,19 @@ source/tools/spirv/.* @vladislavbelov
## == Scripts
## GUI
binaries/data/mods/public/gui/.* @Imarok @s0600204 @wraitii @marder
binaries/data/mods/public/gui/.* @Vantha @wraitii
## AI
binaries/data/mods/public/simulation/ai/.* @Freagarach
binaries/data/mods/public/simulation/ai/.* @Phosit
## Balancing
binaries/data/mods/public/simulation/(data|templates)/.* @0ad/Balancers
binaries/data/mods/public/simulation/(data|templates)/.* @real_tabasco_sauce
## == Assets
## Art
binaries/data/mods/public/art/.* @wowgetoffyourcellphone @wackyserious @Stan
binaries/data/mods/public/art/.* @wowgetoffyourcellphone @Stan
binaries/data/mods/(mod|public)/art/materials/.* @vladislavbelov
## Sound
binaries/data/mods/public/audio/.* @Samulis @Stan
## Maps
binaries/data/mods/public/maps/.* @smiley @marder
binaries/data/mods/public/maps/.* @Phosit @real_tabasco_sauce
## Shaders
binaries/data/mods/(mod|public)/shaders/.* @vladislavbelov
+7
View File
@@ -0,0 +1,7 @@
---
blank_issues_enabled: false
contact_links:
- name: Help & Feedback
url: https://wildfiregames.com/forum/forum/145-help-amp-feedback/
about: >
If you need help or have feedback, please open a thread in the forums.
+35 -8
View File
@@ -1,8 +1,8 @@
---
name: "Release Process Task"
about: "This is a special issue template for planning Alpha releases. DO NOT USE it for normal issue reports."
title: "[RELEASE PROCESS] Alpha XX"
about: "This is a special issue template for planning releases. DO NOT USE it for normal issue reports."
title: "[RELEASE PROCESS] Release XX"
labels:
- "Type/Task"
@@ -10,14 +10,16 @@ labels:
---
*Please fill out relevant information in the next line, set Milestone to the relevant Alpha and Branch/Tag to the relevant release branch when it's created. Then delete this line.*
*Please fill out relevant information in the next line, set Milestone to the relevant Release, then delete this line.*
# Alpha XX Release Process
# Release XX Process
This task tracks the progress of the next Alpha release. **Please do not report issues with the nightly build or with release candidates here:** instead create a new issue and set its Milestone to the relevant Alpha.
This task tracks the progress of the next release. **Please do not report issues with the nightly build or with release candidates here:** instead create a new issue and set its Milestone to the relevant release.
All details about each step are documented in [ReleaseProcess](wiki/ReleaseProcess).
After performing steps, post a comment on the task, so that it appears in the activity feed and notifies followers.
**Release Manager:** @
**Translations Officer:** @
@@ -36,15 +38,19 @@ Here are the Release Blocking issues currently delaying the release:
- [ ] [Test the tutorials](wiki/ReleaseProcess#test-the-tutorials)
- [ ] [Organize a first staff match](wiki/ReleaseProcess#organize-a-first-staff-match)
- [ ] [Prepare for branching](wiki/ReleaseProcess#prepare-for-branching)
- [ ] [Create a `release-aXX` branch](wiki/ReleaseProcess#create-a-release-axx-branch)
- [ ] [Create a `release-XX` branch](wiki/ReleaseProcess#create-a-release-xx-branch)
- [ ] [Adapt Jenkins for the release](wiki/ReleaseProcess#adapt-jenkins-for-the-release)
- [ ] [Announce the start of the process](wiki/ReleaseProcess#announce-the-start-of-the-process)
- [ ] [Prepare next multiplayer lobby in `main`](wiki/ReleaseProcess#prepare-next-multiplayer-lobby-in-main)
- [ ] [Generate next signing key for mods in `main`](wiki/ReleaseProcess#generate-next-signing-key-for-mods-in-main)
- [ ] [Update the Changelog](wiki/ReleaseProcess#update-the-changelog)
- [ ] [Create the next Changelog and Porting guide](wiki/ReleaseProcess#update-the-changelog)
- [ ] [Start writing release announcement](wiki/ReleaseProcess#start-writing-release-announcement)
- [ ] [Start creating the release video](wiki/ReleaseProcess#start-creating-the-release-video)
### String Freeze
- [ ] [Cleanup empty languages](wiki/ReleaseProcess#cleanup-empty-languages)
- [ ] [Announce string freeze](wiki/ReleaseProcess#announce-string-freeze)
- [ ] [Long strings check](wiki/ReleaseProcess#long-strings-check)
@@ -66,17 +72,38 @@ Before moving on with Full Freeze, make sure that:
### Full Freeze
- [ ] [Update appdata.xml](wiki/ReleaseProcess#update-appdataxml)
- [ ] [Freeze Jenkins](wiki/ReleaseProcess#freeze-jenkins)
- [ ] [Confirm full freeze](wiki/ReleaseProcess#confirm-full-freeze)
- [ ] [Package East Asian mods](wiki/ReleaseProcess#package-east-asian-mods)
- [ ] [Announce Release Candidates](wiki/ReleaseProcess#announce-release-candidates)
- [ ] Release Testing: [link to RC]( )
---
When RCs are released, a planned release date is decided with the team and published here. This improves internal coordination and allows us to release announcements on all platforms at the same time.
---
Release Preparation: Please list here all the changes to BuildInstructions and System requirements that will have to be published on release day.
- [ ] Linux changes: TBD
- [ ] Windows changes : TBD
- [ ] macOS changes: TBD
- [ ] BSD changes: TBD
---
### Eve of Release
- [ ] [Schedule the video publication](wiki/ReleaseProcess#schedule-the-video-publication)
### Release
- [ ] [Tag the release commit](wiki/ReleaseProcess#tag-the-release-commit)
- [ ] [Create torrents and checksum files](wiki/ReleaseProcess#create-torrents-and-checksum-files)
- [ ] [Upload to Sourceforge and IndieDB](wiki/ReleaseProcess#upload-to-sourceforge-and-indiedb)
- [ ] [Update website](wiki/ReleaseProcess#update-website)
- [ ] [Update BuildInstructions](wiki/ReleaseProcess#update-buildinstructions)
- [ ] [Upload to Sourceforge](wiki/ReleaseProcess#upload-to-sourceforge)
- [ ] [Move the lobby](wiki/ReleaseProcess#move-the-lobby)
- [ ] [Publish announcement](wiki/ReleaseProcess#publish-announcement)
- [ ] [Notify packagers](wiki/ReleaseProcess#notify-packagers)
+61 -7
View File
@@ -3,20 +3,74 @@ name: checkrefs
on:
- push
- pull_request
env:
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.event.after }}
jobs:
checkrefs:
lfscheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Fetch the base branch
run: git fetch origin ${{ env.BASE_SHA }}
- name: Check that LFS files are correctly stored as pointers
run: git-lfs fsck --pointers ${{ env.BASE_SHA }}..${{ env.HEAD_SHA }}
checkrefs:
runs-on: ubuntu-latest
env:
GIT_LFS_SKIP_SMUDGE: "1"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install lxml
run: pip3 install lxml
with:
python-version: "3.11"
- name: Add remote fork origin for LFS
run: |
PR_REPO="${{ gitea.event.pull_request.head.repo.full_name || gitea.repository }}"
git remote add ${{ gitea.actor }} https://gitea.wildfiregames.com/${PR_REPO}.git
- name: Workaround for authentication problem with LFS
# https://gitea.com/gitea/act_runner/issues/164
run: >
git config --local
run: |
git config --local \
http.${{ gitea.server_url }}/${{ gitea.repository }}.git/info/lfs/objects/.extraheader ''
PR_REPO="${{ gitea.event.pull_request.head.repo.full_name || gitea.repository }}"
EXTRAHEADER="$(git config --get --local http.${{ gitea.server_url }}/.extraheader)"
git config --local \
http.${{ gitea.server_url }}/${PR_REPO}.git/info/lfs/objects/batch.extraheader \
'${EXTRAHEADER}'
git config --local \
http.${{ gitea.server_url }}/${PR_REPO}.git/info/lfs/objects/.extraheader ''
- name: Download necessary LFS assets
run: git lfs pull -I binaries/data/mods/public/maps
shell: sh {0}
run: |
git lfs pull -I binaries/data/mods/public/art/meshes,binaries/data/mods/public/maps
ORIGIN_LFS_PULL_RESULT=$?
git lfs pull ${{ gitea.actor }} \
-I binaries/data/mods/public/art/meshes,binaries/data/mods/public/maps
FORK_LFS_PULL_RESULT=$?
PR_REPO="${{ gitea.event.pull_request.head.repo.full_name || gitea.repository }}"
if [ "$ORIGIN_LFS_PULL_RESULT" = "0" ]; then
echo "SUCCESS: Found all LFS assets in the LFS storage of ${{ gitea.repository }}."
elif [ "$FORK_LFS_PULL_RESULT" = "0" ]; then
echo "SUCCESS: Found all LFS assets in the LFS storage of ${PR_REPO}."
else
echo "ERROR: Couldn't find all LFS assets in either of the LFS storages."
false;
fi
- name: Install lxml
run: pip3 install lxml
- name: Install collada
run: pip3 install "pycollada>=0.9"
- name: Check for missing references
run: ./source/tools/entity/checkrefs.py
run: |
./source/tools/entity/checkrefs.py \
--check-map-xml \
--validate-templates \
--validate-actors \
--validate-meshes
+83
View File
@@ -0,0 +1,83 @@
---
# yamllint disable rule:line-length
name: lint
on:
- push
- pull_request
env:
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.event.after }}
jobs:
cppcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# cache only works for items in workspace, so configure apt to allow for caching.
- name: Setup apt cache locations
id: apt-cache-location
run: |
mkdir -p apt-cache/archives/partial
mkdir -p apt-lists/partial
mkdir -p apt-lists/auxfiles
sudo echo "Dir::Cache \"$(realpath apt-cache)\";" >/etc/apt/apt.conf.d/99cachelocation
sudo echo "Dir::State::lists \"$(realpath apt-lists)\";" >>/etc/apt/apt.conf.d/99cachelocation
- name: Cache apt pkg db and and deb files
id: apt-cache
uses: actions/cache@v4
with:
path: |
apt-cache
apt-lists
key: ${{ runner.os }}-apt-cache-4
- name: Update package db
if: steps.apt-cache.outputs.cache-hit != 'true'
run: sudo apt-get update
- name: Install cppcheck
run: sudo apt-get --assume-yes --no-install-recommends install cppcheck
- name: Fetch the base branch, so we can use `git diff`
run: git fetch origin ${{ env.BASE_SHA }}
- name: Check for issues
run: ./source/tools/lint/cppcheck/cppcheck.sh --diff ${{ env.BASE_SHA }}
copyright:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 100
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Fetch the base branch, so we can use `git diff`
run: git fetch origin ${{ env.BASE_SHA }}
- name: Check for issues with copyright
run: ./source/tools/lint/copyright/copyright.sh --from ${{ env.BASE_SHA }} --to ${{ env.HEAD_SHA }}
jenkinsfiles:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Fetch the base branch, so we can use `git diff`
run: git fetch origin ${{ env.BASE_SHA }}
- name: Install npm-groovy-lint
run: npm install -g npm-groovy-lint
- name: Check for issues with jenkins files
run: ./source/tools/lint/jenkinsfiles/jenkinsfiles.sh --from ${{ env.BASE_SHA }} --to ${{ env.HEAD_SHA }}
+2
View File
@@ -9,6 +9,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- id: restore-pip-cache
uses: actions/cache/restore@v4
with:
+13 -1
View File
@@ -12,7 +12,9 @@ build/workspaces/*
# Libraries
libraries/macos
libraries/win32
libraries/win64
libraries/source/cpp-httplib/*
libraries/source/cxxtest-4.4/*
libraries/source/fcollada/*
libraries/source/nvtt/*
@@ -24,9 +26,14 @@ libraries/source/spirv-reflect/*
!libraries/source/**/patches/
# Tools
appimage-build/
archives/
build/bin/
source/tools/spirv/rules.*.json
source/tools/spirv/rules.json
# Linting
cppcheck-error.log
copyright-check-error.log
# Files generated by running premake5
build/premake/.gccmachine.tmp
@@ -63,6 +70,7 @@ binaries/data/mods/public/gui/credits/texts/translators.json
*.pot
# Packaged mods and tarballs
*.AppImage
*.pyromod
*.zip
*.tar
@@ -83,6 +91,10 @@ binaries/data/mods/**/*.jpg
# Vulkan SPIR-V shaders
binaries/data/mods/*/shaders/spirv
# eslint
node_modules
package-lock.json
# Windows specific data
desktop.ini
Thumbs.db
+15
View File
@@ -0,0 +1,15 @@
{
"extends": "recommended-jenkinsfile",
"rules": {
"formatting.LineLength": {
"length": 300,
"severity": "info"
},
"size.NestedBlockDepth": {
"maxNestedBlockDepth": 15
},
"formatting.DuplicateNumberLiteral": "off",
"formatting.DuplicateMapLiteral": "off",
"formatting.DuplicateStringLiteral": "off"
}
}
+8
View File
@@ -0,0 +1,8 @@
# If you are using ssh [1] to push and want to use it to obtain a token instead
# of using basic auth override this with:
# git config lfs.url git@gitea.wildfiregames.com:0ad/0ad.git
#
# [1] https://github.com/git-lfs/git-lfs/blob/main/docs/api/server-discovery.md#ssh
[lfs]
url = https://gitea.wildfiregames.com/0ad/0ad.git/info/lfs
+34 -9
View File
@@ -1,8 +1,13 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v6.0.0
hooks:
- id: check-added-large-files
args:
- --maxkb=1024
- --enforce-all
exclude: (^binaries/data/mods/public/maps/.*\.xml$)
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
@@ -18,16 +23,26 @@ repos:
^binaries/data/mods/_test.sim/simulation/templates.illformed.xml|
^binaries/data/mods/public/maps/.*\.xml
)
- id: trailing-whitespace
exclude: |
(?x)(
^libraries/|
^source/third_party/glad/src|
^source/tools/replayprofile/jquery|
^source/tools/templatesanalyzer/tablefilter|
\.dae|
\.patch$
)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.1
rev: v0.12.9
hooks:
- id: ruff
- id: ruff-check
args:
- --output-format=full
exclude: ^source/tools/webservices/
- id: ruff-format
args:
- --check
- --diff
exclude: ^source/tools/webservices/
- repo: local
hooks:
@@ -41,29 +56,39 @@ repos:
files: ^binaries/
exclude: (^binaries/data/mods/(mod|public)/art/.*\.xml|\.dae$)
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.9.0-1
rev: v3.12.0-2
hooks:
- id: shfmt
args:
- --diff
- --simplify
stages: [pre-commit]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
rev: v0.11.0.1
hooks:
- id: shellcheck
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.41.0
rev: v0.45.0
hooks:
- id: markdownlint
language_version: 22.14.0
exclude: |
(?x)(
^.gitea/ISSUE_TEMPLATE/|
^source/third_party/
)
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
rev: v1.37.1
hooks:
- id: yamllint
args:
- --strict
- repo: https://github.com/eslint/eslint
rev: v9.39.2
hooks:
- id: eslint
language_version: 22.14.0
additional_dependencies:
- "@stylistic/eslint-plugin@5.6.1"
args:
- --max-warnings=0
- --no-warn-ignored
+2
View File
@@ -0,0 +1,2 @@
external-sources=true
source-path=source/tools
+4 -7
View File
@@ -27,10 +27,10 @@ please inform Wildfire Games at webmaster at wildfiregames dot com.
- binaries/data/mods/*/maps/
- see LICENSE.txt within those directories
- binaries/data/mods/public/shaders/glsl/fxaa.fs
- binaries/data/mods/mod/shaders/glsl/fxaa.fs
- BSD
- binaries/data/mods/public/shaders/glsl/cas.fs
- binaries/data/mods/mod/shaders/glsl/cas.fs
- MIT
- binaries/system/
@@ -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
@@ -96,8 +93,8 @@ please inform Wildfire Games at webmaster at wildfiregames dot com.
- source/tools/atlas/
- GPL version 2 (or later) - see license_gpl-2.0.txt
- binaries/data/mods/public/gui/prelobby/common/terms/
binaries/data/mods/public/gui/userreport/Terms_and_Conditions.txt
- binaries/data/mods/public/gui/prelobby/common/terms/
binaries/data/mods/public/gui/userreport/Terms_and_Conditions.txt
binaries/data/mods/mod/gui/modio/Disclaimer.txt
- Redistributing modified Terms and Conditions of online services may be within the licensing,
but may not change the legality or enforceability of the terms of the service provider.
+4
View File
@@ -8,6 +8,10 @@
[![Game References Checks Status](https://gitea.wildfiregames.com/0ad/0ad/actions/workflows/checkrefs.yml/badge.svg?branch=main)](https://gitea.wildfiregames.com/0ad/0ad/actions?workflow=checkrefs.yml)
[![Pre-commit Checks Status](https://gitea.wildfiregames.com/0ad/0ad/actions/workflows/pre-commit.yml/badge.svg?branch=main)](https://gitea.wildfiregames.com/0ad/0ad/actions?workflow=pre-commit.yml)
[![Bi-Weekly Bundles Status](https://jenkins.wildfiregames.com/job/0ad-bundles/badge/icon?subject=Bi-Weekly%20Bundles&style=plastic)](https://jenkins.wildfiregames.com/job/0ad-bundles)
[![Technical Docs Status](https://jenkins.wildfiregames.com/job/0ad-technical-docs/badge/icon?subject=Technical%20Docs&style=plastic)](https://docs.wildfiregames.com/)
[![Nightly Build Status](https://jenkins.wildfiregames.com/job/0ad-nightly/badge/icon?subject=Nightly%20Build&style=plastic)](https://gitea.wildfiregames.com/0ad/0ad/wiki/NightlyBuild)
0 A.D. (pronounced "zero ey-dee") is a free, open-source, cross-platform
real-time strategy game of ancient warfare.
+133 -31
View File
@@ -138,6 +138,10 @@ renderer.backend.gl.enableframebufferinvalidating = false
renderer.backend.vulkan.disabledescriptorindexing = false
renderer.backend.vulkan.deviceindexoverride = -1
renderer.backend.vulkan.destroyoldswapchainbefore = false
; In case index override isn't enough we might choose a device automatically.
renderer.backend.vulkan.choosebestdevice = false
renderer.backend.vulkan.debugbarrierafterframebufferpass = false
renderer.backend.vulkan.debugwaitidlebeforeacquire = false
@@ -156,6 +160,15 @@ 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
@@ -186,8 +199,15 @@ menu = 60 ; Throttle FPS in menus only.
[profiler2]
server = "127.0.0.1"
server.port = "8000" ; Use a free port on your machine.
server.threads = "6" ; Enough for the browser's parallel connection limit
server.port = "8000" ; Use a free port on your machine.
server.threads = "6" ; Enough for the browser's parallel connection limit
autoenable = false ; Enable HTTP server output at startup (default off for security/performance)
gpu.enable = true ; Allow GPU timing mode when available.
[console]
font = "mono-10"
history.size = 200
history.ignore_duplicates = true ; Don't store consecutive identical commands twice
[hotkey]
; Each one of the specified keys will trigger the action on the left
@@ -205,6 +225,7 @@ togglefullscreen = "Alt+Return" ; Toggle fullscreen/windowed mode
screenshot.watermark = "Alt+K" ; Toggle product/company watermark for official screenshots
wireframe = "Alt+Shift+W" ; Toggle wireframe mode
silhouettes = "Alt+Shift+S" ; Toggle unit silhouettes
mousegrabtoggle = F3 ; Toggle mouse grabbing mode
; > DIALOG HOTKEYS
summary = "Ctrl+Tab" ; Toggle in-game summary
@@ -218,7 +239,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
@@ -239,7 +260,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
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)
@@ -255,12 +277,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
@@ -305,6 +327,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"
@@ -338,6 +366,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.structures.place]
house = "Space+H"
storehouse = "Space+S"
farmstead = "Space+G"
field = "Space+F"
corral = "Space+J"
barracks = "Space+B"
stable = "Space+V"
temple = "Space+T"
arsenal = "Space+A"
fortress = "Space+F"
forge = "Space+K"
sentry_tower = "Space+Q"
defense_tower = "Space+W"
market = "Space+M"
dock = "Space+D"
[hotkey.gamesetup]
mapbrowser.open = "M"
@@ -379,21 +428,21 @@ 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
menu.toggle = "F10" ; Toggle in-game menu
diplomacy.toggle = "Ctrl+H" ; Toggle in-game diplomacy page
barter.toggle = "Ctrl+B" ; Toggle in-game barter/trade page
objectives.toggle = "Ctrl+O" ; Toggle in-game objectives page
matchsettings.toggle = "Ctrl+O" ; Toggle in-game match settings page
tutorial.toggle = "Ctrl+P" ; Toggle in-game tutorial panel
[hotkey.session.savedgames]
@@ -470,6 +519,7 @@ selectformationasone = "true" ; Whether to select formations as a whole by defau
icons.enabled = "true"
icons.opacity = 1.0
icons.sizescale = 1.0
entityradiusscale = 1.0
blinkduration = 1.7 ; The blink duration while pinging
pingduration = 50.0 ; The duration for which an entity will be pinged after an attack notification
@@ -482,7 +532,7 @@ phase = completed ; Show a chat notification if you or an ally h
[gui.splashscreen]
enable = true ; Enable/disable the splashscreen
version = 0 ; Splashscreen version (date of last modification). By default, 0 to force splashscreen to appear at first launch
version = 0 ; Splashscreen version (MD5 hash of file content). By default, 0 to force splashscreen to appear at first launch
[gui.session.diplomacycolors]
self = "21 55 149" ; Color of your units when diplomacy colors are enabled
@@ -502,16 +552,16 @@ extended = true ; Whether to display the chat history
[lobby]
history = 0 ; Number of past messages to display on join
room = "arena27" ; 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 = false ; Whether to reject connecting to the lobby if the TLS certificate is invalid (TODO: wait for Gloox GnuTLS trust implementation to be fixed)
verify_certificate = true ; Whether to reject connecting to the lobby if the TLS certificate is invalid
terms_url = "https://gitea.wildfiregames.com/0ad/0ad/src/branch/main/binaries/data/mods/public/gui/prelobby/common/terms/"; Allows the user to save the text and print the terms
terms_of_service = "0" ; Version (hash) of the Terms of Service that the user has accepted
terms_of_use = "0" ; Version (hash) of the Terms of Use that the user has accepted
privacy_policy = "0" ; Version (hash) of the Privacy Policy that the user has accepted
xpartamupp = "wfgbot27" ; Name of the server-side XMPP-account that manage games
echelon = "echelon27" ; 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
@@ -519,8 +569,6 @@ rememberpassword = true ; Whether to store the encrypted password in
gamerating = false ; Show the average rating of the participating players in a column of the gamelist
[lobby.stun]
enabled = true ; The STUN protocol allows hosting games without configuring the firewall and router.
; If STUN is disabled, the game relies on direct connection, UPnP and port forwarding.
server = "lobby.wildfiregames.com" ; Address of the STUN server.
port = 3478 ; Port of the STUN server.
delay = 10 ; Duration in milliseconds that is waited between checking for retrieved STUN responses.
@@ -536,7 +584,7 @@ enabledmods = "mod public"
[modio]
public_key = "RWQv2alKl8D0zMDJR766jpYvPy4u3y77HL/iKb/lsT1Fnf6ezoMb2x8+" ; Public key corresponding to the private key valid mods are signed with
public_key = "RWRoZZuNzi1wX+Hs5NKAf+GghHwye3mFePfBzOFt3mqYUZAkqAvs69W2" ; Public key corresponding to the private key valid mods are signed with
disclaimer = "0" ; Version (hash) of the Disclaimer that the user has accepted
[modio.v1]
@@ -557,13 +605,13 @@ fps = "false" ; Show frames per second in top right corner
realtime = "false" ; Show current system time in top right corner
netwarnings = "true" ; Show warnings if the network connection is bad
[profiler2]
autoenable = false ; Enable HTTP server output at startup (default off for security/performance)
gpu.arb.enable = true ; Allow GL_ARB_timer_query timing mode when available.
[rlinterface]
address = "127.0.0.1:6000"
[dapinterface]
address = "127.0.0.1"
port = 9229
[sound]
mastergain = 0.9
musicgain = 0.2
@@ -600,6 +648,7 @@ rotate.y.speed.wheel = 0.45
rotate.y.default = 0.0
rotate.speed.modifier = 1.05 ; Multiplier for changing rotation speed
drag.speed = 0.5
drag.inverted = false ; Pan in the opposite direction of drag movement
zoom.speed = 256.0
zoom.speed.wheel = 32.0
zoom.min = 50.0
@@ -615,3 +664,56 @@ far = 4096.0 ; Far plane distance
fov = 45.0 ; Field of view (degrees), lower is narrow, higher is wide
height.smoothness = 0.5
height.min = 16
[fonts]
default = "LinBiolinum_Rah.ttf", "FreeSans.ttf" ; Default font to use for all text
debugbox = false ; Whether to draw a debug box around text, useful for debugging text rendering issues
; Color of the debug box, if enabled.
; When A8 or R8 "R G B" only take R as alpha channel.
; When R8G8B8A: "R G B" where R, G, B are integers from 0 to 255.
debugboxcolor = "128 0 128"
;;;;;;;;;;;;;;;;;;;;;;;;
; **************************************************************
; Font format in configuration is
; [fonts.<locale>.<fontalias>]
; In GUI XML files, use the font alias.
; Example for regular: font="<fontalias>-<fontsize>"
; Example for bold: font="<fontalias>-bold-<fontsize>"
; Example for italic: font="<fontalias>-italic-<fontsize>"
; If you need troke font use the following format:
; Example for stroke: font="....-stroke-<fontsize>"
;
; Support for locale fonts
; [fonts.<locale>.<fontalias>]
; Example: fonts.jp.sans = "font.ttf"
;
; Each value is a comma separated list of font files
; Example: fonts.sans.regular = "font.ttf", "font2.ttf"
; Example: fonts.sans.bold = "font.ttf"
; **************************************************************
[fonts.sans]
regular = "LinBiolinum_Rah.ttf", "FreeSans.ttf"
bold = "LinBiolinum_RBah.ttf", "FreeSansBold.ttf"
italic = "LinBiolinum_RIah.ttf", "FreeSansOblique.ttf"
[fonts.mono]
regular = "DejaVuSansMono.ttf", "FreeMono.ttf"
[fonts.ja.sans]
regular = "SourceHanSansJP-Regular.otf"
bold = "SourceHanSansJP-Bold.otf"
[fonts.zh.sans]
regular = "SourceHanSansCN-Regular.otf"
bold = "SourceHanSansCN-Bold.otf"
[fonts.zh_TW.sans]
regular = "SourceHanSansTW-Regular.otf"
bold = "SourceHanSansTW-Bold.otf"
[fonts.ko.sans]
regular = "SourceHanSansKR-Regular.otf"
bold = "SourceHanSansKR-Bold.otf"
+2 -2
View File
@@ -7,5 +7,5 @@
; order. The precense of this file suppresses loading of mods in the user mod
; path (see https://gitea.wildfiregames.com/0ad/0ad/wiki/GameDataPaths) if the same mod is
; present in binaries/data/mods. It also implies -noUserMod.
; This is done to make saved maps end up in the right mod folder (and in the
; game-relative data path) to commit them later on.
; This is done to make saved maps end up in the right mod folder (and in the
; game-relative data path) to commit them later on.
@@ -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;
};
});
}
@@ -0,0 +1,4 @@
async function init(arg)
{
return arg ? Engine.startAtlas : undefined;
}
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<objects>
<script file="gui/Result/Result.js"/>
</objects>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<page>
<include>Result/Result.xml</include>
</page>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<objects>
<script module="gui/await/script.js"/>
</objects>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<page>
<include>await/object.xml</include>
</page>
@@ -0,0 +1 @@
await new Promise(() => {});
@@ -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;
+3
View File
@@ -26,6 +26,9 @@
<element name="script">
<interleave>
<text/>
<optional>
<attribute name="module"/>
</optional>
<optional>
<attribute name="file"/>
</optional>
@@ -1,13 +1,15 @@
var state_before;
var state_after;
function handleInputBeforeGui(ev) {
function handleInputBeforeGui(ev)
{
if ((ev.type == "hotkeydown" || ev.type == "hotkeyup") && ev.hotkey == "test")
state_before = Engine.HotkeyIsPressed("test");
return false;
}
function handleInputAfterGui(ev) {
function handleInputAfterGui(ev)
{
if ((ev.type == "hotkeydown" || ev.type == "hotkeyup") && ev.hotkey == "test")
state_after = Engine.HotkeyIsPressed("test");
return false;
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<objects>
<script module="gui/multiple_root-modules/script.js"/>
<script module="gui/multiple_root-modules/script.js"/>
</objects>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<page>
<include>multiple_root-modules/object.xml</include>
</page>
@@ -0,0 +1,4 @@
function init()
{
return new Promise(closePageCallback => { globalThis.closePageCallback = closePageCallback; });
}
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<objects>
<script file="gui/regainFocus/emptyPage.js"/>
</objects>
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<page>
<include>common/styles.xml</include>
<include>regainFocus/emptyPage.xml</include>
</page>
@@ -1 +1,4 @@
Engine.PushGuiPage("regainFocus/page_emptyPage.xml").then(Engine.PopGuiPage);
function init()
{
return Engine.OpenChildPage("regainFocus/page_emptyPage.xml");
}
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<page>
<include>common/styles.xml</include>
<include>resolveReject/resolveReject.xml</include>
</page>
@@ -0,0 +1,5 @@
async function init(reject)
{
if (reject)
throw new Error();
}
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<objects>
<script file="gui/resolveReject/resolveReject.js"/>
</objects>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<page>
<include>common/styles.xml</include>
<include>sequential/sequential.xml</include>
</page>
@@ -0,0 +1,5 @@
async function init()
{
await Engine.OpenChildPage("regainFocus/page_emptyPage.xml");
await Engine.OpenChildPage("regainFocus/page_emptyPage.xml");
}
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<objects>
<script file="gui/sequential/sequential.js"/>
</objects>
@@ -0,0 +1,4 @@
testObject.size = {
"left": 3,
"bottom": 2
};
@@ -0,0 +1 @@
testObject.size.left += 5;
@@ -0,0 +1 @@
testObject.getComputedSize();
@@ -0,0 +1 @@
testObject.size.left = 5;
@@ -0,0 +1,3 @@
Object.assign(testObject.size, {
"rleft": 4, "rbottom": 20
});
@@ -1,612 +0,0 @@
101
256 256
a
606
15
12
32 0 256 0 0 0 0 5
33 250 154 3 11 1 11 4
34 121 18 5 4 0 11 5
35 80 214 12 11 0 11 12
36 190 39 10 13 0 12 10
37 204 11 15 11 0 11 15
38 187 25 13 11 0 11 12
39 253 188 3 4 0 11 3
40 252 79 4 11 0 11 4
41 251 67 5 11 0 11 5
42 73 186 7 7 1 12 8
43 48 138 9 9 2 9 13
44 253 184 3 4 2 2 6
45 20 226 4 2 1 5 6
46 253 180 3 2 0 2 5
47 146 89 6 13 -1 11 4
48 154 73 10 11 0 11 10
49 250 11 6 11 2 11 11
50 164 73 10 11 0 11 10
51 86 75 10 11 1 11 11
52 174 75 10 11 0 11 10
53 232 75 10 11 0 11 10
54 12 77 10 11 0 11 10
55 226 166 8 11 1 11 10
56 72 77 10 11 0 11 10
57 96 79 10 11 0 11 10
58 32 224 3 8 1 8 5
59 29 224 3 10 1 8 5
60 74 138 9 9 2 9 13
61 111 61 9 5 2 7 13
62 84 138 9 9 2 9 13
63 81 190 9 11 0 11 8
64 0 14 16 14 0 11 16
65 39 49 11 11 0 11 11
66 204 79 10 11 1 11 11
67 51 49 11 11 0 11 11
68 63 49 11 11 1 11 12
69 117 190 9 11 1 11 10
70 122 162 8 11 1 11 10
71 161 49 11 11 0 11 11
72 173 49 11 11 1 11 12
73 58 128 3 11 1 11 4
74 145 188 9 11 0 11 9
75 214 79 10 11 1 11 11
76 13 186 9 11 1 11 10
77 204 23 14 11 1 11 15
78 97 51 11 11 1 11 12
79 185 51 11 11 0 11 11
80 242 79 10 11 1 11 11
81 201 48 11 12 0 11 11
82 0 81 10 11 1 11 11
83 241 51 11 11 0 11 11
84 23 186 9 11 0 11 9
85 75 53 11 11 0 11 11
86 184 83 10 11 0 11 10
87 126 11 16 11 0 11 16
88 122 214 12 11 -1 11 10
89 109 55 11 11 -1 11 9
90 170 156 8 11 1 11 10
91 185 107 5 11 0 11 5
92 114 99 6 13 -1 11 4
93 191 107 5 11 0 11 5
94 150 124 10 4 3 11 16
95 12 242 8 2 0 -3 8
96 12 49 3 3 2 11 8
97 145 132 9 8 0 8 9
98 33 186 9 11 0 11 9
99 155 132 9 8 0 8 9
100 43 186 9 11 0 11 9
101 165 132 9 8 0 8 9
102 197 107 5 11 0 11 5
103 53 186 9 11 0 8 9
104 178 156 8 11 0 11 8
105 62 128 3 11 0 11 3
106 230 192 4 14 0 11 4
107 227 142 7 11 0 11 7
108 84 128 3 11 0 11 3
109 157 200 13 8 1 8 14
110 224 76 8 8 0 8 8
111 175 132 9 8 0 8 9
112 63 186 9 11 0 8 9
113 91 186 9 11 0 8 9
114 74 106 8 8 0 8 7
115 185 132 9 8 0 8 9
116 57 138 7 10 0 10 7
117 136 106 8 8 0 8 8
118 144 106 8 8 0 8 7
119 60 94 12 8 0 8 12
120 222 106 8 8 0 8 8
121 101 186 9 11 -1 8 7
122 146 114 6 8 1 8 8
123 142 76 6 14 1 11 8
124 252 55 3 15 3 11 9
125 148 76 6 14 1 11 8
126 160 124 10 4 1 7 12
160 0 256 0 0 0 0 11
161 88 128 3 11 1 11 4
162 127 186 9 11 1 9 11
163 194 83 10 11 1 11 11
164 235 132 9 8 0 10 10
165 213 55 11 11 -1 11 9
166 250 192 3 14 3 11 9
167 1 184 9 11 0 11 9
168 121 24 5 2 1 11 7
169 97 27 13 11 0 11 13
170 103 174 7 7 0 11 7
171 40 115 7 5 0 7 8
172 134 136 11 5 2 7 14
173 128 202 4 2 1 5 6
174 29 35 13 11 0 11 13
175 0 186 4 2 2 11 8
176 238 108 6 6 0 11 5
177 102 138 9 9 2 8 13
178 10 108 8 8 0 11 8
179 176 116 7 8 0 11 7
180 200 17 4 3 2 11 8
181 22 85 10 11 -1 8 9
182 186 156 8 11 0 11 8
183 207 168 3 2 1 7 5
184 28 19 5 5 2 0 8
185 125 150 5 7 1 11 8
186 171 124 7 7 0 11 7
187 55 115 7 5 0 7 8
188 220 11 15 11 1 11 16
189 142 11 16 11 1 11 17
190 158 11 16 11 0 11 16
191 155 184 9 11 0 11 9
192 139 256 11 15 0 15 11
193 151 256 11 15 0 15 11
194 163 256 11 15 0 15 11
195 113 240 11 14 0 14 11
196 137 240 11 14 0 14 11
197 112 256 12 15 0 15 12
198 52 256 17 11 -2 11 15
199 175 256 11 15 0 11 11
200 246 27 9 15 1 15 10
201 88 29 9 15 1 15 10
202 112 29 9 15 1 15 10
203 216 226 9 14 1 14 10
204 8 200 4 15 0 15 4
205 112 200 4 15 1 15 4
206 15 53 5 15 0 15 4
207 48 242 5 14 -1 14 3
208 0 212 12 11 0 11 12
209 149 240 11 14 1 14 12
210 187 256 11 15 0 15 11
211 199 256 11 15 0 15 11
212 211 256 11 15 0 15 11
213 161 240 11 14 0 14 11
214 173 240 11 14 0 14 11
215 112 138 9 9 2 9 13
216 136 226 11 13 0 12 11
217 223 256 11 15 0 15 11
218 235 256 11 15 0 15 11
219 53 244 11 15 0 15 11
220 185 240 11 14 0 14 11
221 65 244 11 15 -1 15 9
222 32 85 10 11 1 11 11
223 194 156 8 11 0 11 8
224 165 180 9 11 0 11 9
225 175 180 9 11 0 11 9
226 185 180 9 11 0 11 9
227 195 180 9 11 0 11 9
228 205 180 9 11 0 11 9
229 103 224 9 12 0 12 9
230 212 44 14 8 0 8 14
231 13 198 9 12 0 8 9
232 235 180 9 11 0 11 9
233 73 178 9 11 0 11 9
234 111 178 9 11 0 11 9
235 215 178 9 11 0 11 9
236 56 109 4 11 -1 11 3
237 70 109 4 11 0 11 3
238 20 109 5 11 -1 11 3
239 26 109 5 11 -1 11 3
240 93 198 9 12 0 12 9
241 234 156 8 11 0 11 8
242 225 178 9 11 0 11 9
243 245 178 9 11 0 11 9
244 137 176 9 11 0 11 9
245 11 174 9 11 0 11 9
246 21 174 9 11 0 11 9
247 184 71 9 7 2 8 13
248 243 142 9 10 0 9 9
249 70 154 8 11 0 11 8
250 100 154 8 11 0 11 8
251 202 154 8 11 0 11 8
252 210 154 8 11 0 11 8
253 226 226 9 14 -1 11 7
254 236 226 9 14 0 11 9
255 0 200 8 14 0 11 8
884 121 22 5 4 0 11 5
885 241 28 5 4 0 2 5
890 200 21 4 3 1 0 5
894 253 200 3 11 1 8 4
900 12 53 3 3 1 11 4
901 94 228 7 3 -1 11 5
902 104 212 12 11 -1 11 10
903 211 168 3 2 1 6 5
904 225 55 11 11 -1 11 11
905 134 212 12 11 -1 11 11
906 32 109 5 11 -1 11 5
908 122 35 13 11 -1 11 12
910 136 35 13 11 -1 11 12
911 150 35 13 11 -1 11 12
912 9 138 7 11 -2 11 3
913 146 212 12 11 -1 11 10
914 42 85 10 11 0 11 10
915 218 154 8 11 1 11 9
916 1 57 11 11 0 11 11
917 52 85 10 11 1 11 11
918 31 174 9 11 0 11 10
919 62 85 10 11 1 11 11
920 158 212 12 11 0 11 12
921 253 154 3 11 1 11 5
922 106 85 10 11 0 11 10
923 197 59 11 11 0 11 10
924 170 212 12 11 0 11 12
925 116 85 10 11 1 11 11
926 226 154 8 11 1 11 10
927 182 212 12 11 0 11 12
928 154 85 10 11 1 11 11
929 164 85 10 11 0 11 10
931 242 154 8 11 1 11 10
932 41 174 9 11 0 11 9
933 27 61 11 11 0 11 11
934 48 26 13 12 0 11 13
935 194 212 12 11 -1 11 10
936 200 35 13 11 0 11 13
937 206 212 12 11 0 11 12
938 120 99 6 13 -1 13 4
939 58 228 12 13 -1 13 10
940 82 87 10 11 0 11 10
941 17 138 7 11 0 11 7
942 24 200 8 14 0 11 8
943 113 128 3 11 0 11 3
944 130 152 8 11 0 11 8
945 244 100 10 8 0 8 10
946 246 226 9 14 0 11 9
947 51 174 9 11 0 8 8
948 61 174 9 11 0 11 9
949 184 116 7 8 0 8 7
950 32 200 8 14 0 11 7
951 10 150 8 11 0 8 8
952 83 174 9 11 0 11 9
953 10 184 3 8 0 8 3
954 82 108 8 8 0 8 8
955 18 150 8 11 0 11 8
956 26 150 8 11 0 8 8
957 114 108 8 8 0 8 8
958 40 200 8 14 0 11 7
959 245 132 9 8 0 8 9
960 0 102 10 8 -1 8 9
961 93 174 9 11 0 8 9
962 34 150 8 11 0 8 8
963 224 97 10 9 0 9 10
964 66 118 6 8 0 8 6
965 202 108 8 8 0 8 8
966 39 61 11 11 0 8 11
967 121 174 9 11 0 8 8
968 51 61 11 11 0 8 11
969 171 200 13 8 0 8 13
970 38 109 5 11 -1 11 3
971 42 150 8 11 0 11 8
972 1 172 9 11 0 11 9
973 50 150 8 11 0 11 8
974 214 35 13 11 0 11 13
976 147 172 9 11 0 11 9
977 126 87 10 11 0 11 10
978 63 61 11 11 0 11 10
979 228 35 13 11 -1 11 11
980 147 226 11 13 -1 13 10
981 197 240 11 14 0 11 11
982 185 200 13 8 0 8 13
986 209 240 11 14 0 11 11
988 48 200 8 14 1 11 9
990 20 224 9 14 0 11 9
992 121 61 11 11 0 11 11
994 98 15 13 15 1 11 14
995 61 26 13 12 0 8 13
996 146 200 10 12 0 12 10
997 169 192 9 12 0 9 9
998 246 256 10 15 1 11 11
999 0 136 9 9 0 9 9
1000 157 168 9 11 0 11 9
1001 58 150 8 11 0 8 8
1002 136 87 10 11 0 11 10
1003 60 102 10 8 0 8 9
1004 179 192 9 12 0 12 9
1005 10 99 10 9 0 9 10
1006 174 87 10 11 0 11 9
1007 234 192 8 12 -1 9 6
1008 94 102 10 8 0 8 10
1009 189 192 9 12 0 8 9
1010 244 108 8 8 0 8 8
1011 219 192 5 14 -2 11 3
1025 110 43 10 13 1 13 11
1026 1 37 13 11 0 11 13
1027 134 75 8 13 1 13 9
1028 133 61 11 11 0 11 11
1029 224 87 10 11 0 11 10
1030 117 128 3 11 1 11 5
1031 152 99 6 13 -1 13 4
1032 78 150 8 11 0 11 8
1033 32 11 18 11 -1 11 17
1034 174 11 16 11 1 11 17
1035 15 37 13 11 0 11 13
1036 136 200 9 13 1 13 10
1038 221 240 11 14 0 14 10
1039 0 226 10 14 1 11 11
1040 218 212 12 11 -1 11 10
1041 10 89 10 11 1 11 11
1042 72 89 10 11 0 11 10
1043 86 150 8 11 1 11 9
1044 36 242 12 14 -1 11 11
1045 92 91 10 11 1 11 11
1046 235 11 15 11 0 11 15
1047 204 91 10 11 0 11 10
1048 214 91 10 11 1 11 11
1049 28 49 10 13 1 13 11
1050 167 168 9 11 1 11 10
1051 145 61 11 11 -1 11 10
1052 230 212 12 11 0 11 12
1053 234 91 10 11 1 11 11
1054 242 212 12 11 0 11 12
1055 244 91 10 11 1 11 11
1056 0 93 10 11 0 11 10
1057 157 61 11 11 0 11 11
1058 177 168 9 11 0 11 9
1059 169 61 11 11 0 11 10
1060 12 210 12 11 0 11 12
1061 92 210 12 11 -1 11 10
1062 88 242 12 14 1 11 13
1063 184 95 10 11 0 11 10
1064 43 37 13 11 1 11 14
1065 51 14 15 14 1 11 16
1066 57 37 13 11 0 11 13
1067 71 37 13 11 1 11 14
1068 194 95 10 11 1 11 11
1069 87 63 11 11 0 11 11
1070 33 23 15 11 1 11 16
1071 80 202 12 11 -1 11 11
1072 65 130 9 8 0 8 9
1073 187 168 9 11 0 11 9
1074 0 110 8 8 0 8 8
1075 92 118 6 8 0 8 6
1076 86 52 10 10 -1 8 9
1077 93 130 9 8 0 8 9
1078 158 94 11 8 0 8 11
1079 192 116 7 8 0 8 7
1080 60 110 8 8 0 8 8
1081 108 150 8 11 0 11 8
1082 200 116 7 8 0 8 7
1083 121 130 9 8 0 8 9
1084 104 102 10 8 0 8 10
1085 90 110 8 8 0 8 8
1086 131 130 9 8 0 8 9
1087 98 110 8 8 0 8 8
1088 197 168 9 11 0 8 9
1089 106 110 8 8 0 8 8
1090 238 116 7 8 0 8 7
1091 116 150 8 11 0 8 8
1092 191 14 13 14 0 11 13
1093 152 110 8 8 0 8 8
1094 235 168 9 11 0 8 9
1095 160 110 8 8 0 8 8
1096 198 200 13 8 0 8 13
1097 163 37 13 11 0 8 13
1098 158 102 10 8 0 8 10
1099 127 96 11 8 0 8 11
1100 230 110 8 8 0 8 8
1101 246 116 7 8 0 8 8
1102 102 94 12 8 0 8 12
1103 122 112 8 8 0 8 8
1105 71 166 9 11 0 11 9
1106 94 224 9 14 0 11 9
1107 216 103 6 11 0 11 6
1108 0 118 7 8 1 8 8
1109 168 112 8 8 0 8 8
1110 41 126 3 11 0 11 3
1111 44 109 5 11 -1 11 4
1112 224 192 5 14 -2 11 3
1113 226 44 14 8 0 8 14
1114 212 200 13 8 0 8 13
1115 103 166 9 11 0 11 9
1116 25 138 7 11 0 11 7
1118 56 200 8 14 0 11 8
1119 0 148 8 11 0 8 8
1120 127 23 15 11 0 11 15
1121 226 200 13 8 0 8 13
1122 181 63 11 11 0 11 11
1123 207 166 9 11 0 11 9
1124 218 23 14 11 1 11 15
1125 170 96 11 8 0 8 11
1126 237 63 11 11 0 11 11
1127 72 98 11 8 -1 8 9
1128 232 23 14 11 1 11 15
1129 240 200 13 8 0 8 12
1130 13 65 11 11 -1 11 9
1131 138 98 11 8 -1 8 9
1132 143 23 15 11 1 11 15
1133 156 192 13 8 0 8 12
1134 102 256 10 17 0 14 10
1135 64 200 8 14 0 11 8
1136 177 37 13 11 0 11 13
1137 75 65 11 11 0 8 11
1138 99 67 11 11 1 11 13
1139 210 112 8 8 1 8 10
1140 209 67 11 11 0 11 11
1141 74 114 8 8 0 8 8
1142 232 240 11 14 0 14 11
1143 138 148 8 11 0 11 8
1144 0 256 20 14 0 11 20
1145 70 256 17 11 0 8 17
1146 84 42 12 12 0 11 12
1147 195 130 9 8 0 8 9
1148 20 256 15 15 0 15 15
1149 75 26 13 12 0 12 13
1150 67 14 15 14 0 14 15
1151 97 39 13 11 0 11 13
1152 158 226 11 13 0 11 11
1153 136 186 9 10 0 8 9
1154 20 97 10 11 0 11 11
1155 110 184 7 3 -1 12 5
1156 146 176 6 3 0 12 6
1157 82 178 7 3 -1 12 6
1158 120 178 7 3 0 12 6
1168 20 52 7 14 1 14 7
1169 178 107 6 11 0 11 5
1170 217 166 9 11 0 11 9
1171 98 118 6 8 0 8 6
1172 10 226 10 14 1 11 11
1173 72 200 8 14 0 11 8
1174 16 14 16 14 0 11 15
1175 116 202 12 11 0 8 11
1176 30 214 9 14 0 11 9
1177 33 138 7 11 0 8 7
1178 40 214 9 14 1 11 9
1179 146 144 8 11 0 8 7
1180 245 166 9 11 1 11 10
1181 16 118 7 8 0 8 7
1182 30 97 10 11 0 11 10
1183 24 118 7 8 0 8 7
1184 242 39 13 11 -1 11 12
1185 126 104 10 8 0 8 9
1186 244 240 11 14 1 11 12
1187 131 164 9 11 0 8 9
1188 0 25 14 11 1 11 15
1189 168 104 10 8 0 8 10
1190 76 244 11 15 1 11 12
1191 199 192 9 12 0 8 9
1192 124 242 12 14 0 11 12
1193 11 162 9 11 0 8 9
1194 101 238 11 14 0 11 11
1195 21 162 9 11 0 8 9
1196 50 214 9 14 0 11 9
1197 41 138 7 11 0 8 7
1198 221 67 11 11 0 11 11
1199 31 162 9 11 0 8 8
1200 1 69 11 11 0 11 10
1201 41 162 9 11 -1 8 7
1202 12 240 12 14 -1 11 10
1203 51 162 9 11 0 8 8
1204 83 14 15 14 0 11 15
1205 193 71 11 11 0 8 11
1206 35 228 11 14 0 11 10
1207 61 162 9 11 0 8 8
1208 40 97 10 11 0 11 10
1209 130 114 8 8 0 8 8
1210 50 97 10 11 1 11 11
1211 154 144 8 11 0 11 8
1212 14 25 14 11 -1 11 13
1213 83 100 11 8 -1 8 10
1214 112 14 14 14 -1 11 13
1215 25 73 11 11 -1 8 10
1216 45 126 3 11 1 11 5
1217 87 256 15 13 0 13 15
1218 37 73 11 11 0 11 11
1219 24 240 10 15 1 11 10
1220 242 192 8 12 0 8 7
1223 0 242 11 15 1 11 12
1224 209 192 9 12 0 8 9
1227 112 226 10 14 0 11 10
1228 162 144 8 11 0 8 8
1232 70 228 12 13 -1 13 10
1233 81 162 9 11 0 11 9
1234 82 228 12 13 -1 13 10
1235 170 144 8 11 0 11 9
1236 158 23 15 11 0 11 16
1237 0 46 14 8 0 8 15
1238 60 214 9 14 1 14 11
1239 91 162 9 11 0 11 9
1240 49 73 11 11 0 11 11
1241 205 130 9 8 0 8 9
1242 169 226 11 13 0 13 11
1243 113 162 9 11 0 11 9
1244 36 256 16 13 -1 13 14
1245 61 73 11 11 0 11 11
1246 120 49 10 13 0 13 10
1247 178 144 8 11 0 11 8
1248 1 160 9 11 0 11 9
1249 186 144 8 11 0 8 8
1250 130 49 10 13 1 13 11
1251 194 144 8 11 0 11 8
1252 140 49 10 13 1 13 11
1253 234 144 8 11 0 11 9
1254 124 228 12 13 0 13 12
1255 141 160 9 11 0 11 9
1256 111 73 11 11 1 11 13
1257 138 114 8 8 1 8 10
1258 181 226 11 13 1 13 13
1259 66 142 8 11 1 11 10
1262 193 226 11 13 0 13 10
1263 70 214 9 14 0 11 8
1264 205 226 11 13 0 13 11
1265 104 200 8 14 0 11 8
1266 46 228 11 14 0 14 10
1267 128 200 8 14 0 11 8
1268 150 49 10 13 0 13 10
1269 94 142 8 11 0 11 8
1272 173 25 13 13 1 13 14
1273 123 73 11 11 0 11 11
1425 43 26 5 2 1 -1 7
1426 12 212 6 2 0 10 6
1427 34 240 2 5 2 12 6
1428 24 55 3 3 2 11 6
1429 84 29 4 3 1 11 6
1430 131 166 3 2 1 -1 5
1431 48 14 2 2 2 10 6
1432 28 23 5 3 1 10 6
1433 243 68 5 4 -1 11 6
1434 90 190 3 4 3 0 6
1435 4 186 4 2 1 -1 6
1436 152 176 3 4 1 11 5
1437 162 172 3 4 3 11 6
1438 196 43 5 3 1 11 6
1439 99 56 7 4 -1 11 5
1440 164 184 4 4 3 11 6
1441 196 47 5 3 0 11 6
1443 110 180 4 2 1 -1 6
1444 80 166 3 4 1 0 6
1445 186 14 5 2 1 -1 7
1446 156 172 6 3 0 0 6
1447 208 55 4 3 1 0 6
1448 83 92 5 4 1 11 7
1449 140 164 4 4 -1 11 6
1450 164 26 5 2 1 -1 7
1451 109 154 3 4 1 12 6
1452 214 180 4 2 1 11 6
1453 203 156 3 2 3 -1 6
1454 236 47 5 3 -1 10 6
1455 192 59 4 3 1 10 6
1456 106 55 3 3 2 0 6
1457 112 166 6 3 0 0 6
1458 208 51 5 3 0 0 5
1459 236 51 5 3 0 0 5
1460 67 150 3 2 2 -1 6
1461 244 180 4 2 1 -1 6
1462 232 59 4 3 1 0 6
1463 67 148 3 2 1 -1 5
1464 147 148 3 2 1 -1 5
1465 67 146 3 2 2 10 6
1467 192 55 5 3 0 0 6
1468 147 146 3 2 2 5 6
1469 67 144 3 2 2 -1 7
1470 38 38 5 2 0 8 5
1471 75 142 3 2 1 10 5
1472 117 212 3 10 0 9 3
1473 103 142 3 2 2 10 6
1474 125 142 3 2 2 10 6
1475 70 174 3 8 0 8 3
1476 253 142 3 2 2 10 6
1488 215 130 9 8 0 8 9
1489 218 114 8 8 1 8 9
1490 32 118 7 8 0 8 7
1491 48 118 7 8 0 8 7
1492 225 130 9 8 0 8 9
1493 130 174 5 8 0 8 5
1494 24 210 5 9 0 9 5
1495 49 128 9 8 0 8 9
1496 75 128 9 8 0 8 9
1497 211 104 5 4 0 8 5
1498 202 142 8 11 0 8 8
1499 8 116 8 8 0 8 8
1500 210 142 8 11 0 11 8
1501 103 128 9 8 0 8 9
1502 1 126 9 8 0 8 9
1503 50 109 5 11 0 8 5
1504 94 150 5 8 0 8 5
1505 11 126 9 8 0 8 9
1506 124 140 9 10 0 8 9
1507 151 156 9 11 0 8 9
1508 21 126 9 8 0 8 9
1509 218 142 8 11 0 8 8
1510 82 116 8 8 0 8 8
1511 161 156 9 11 0 8 9
1512 114 116 8 8 0 8 8
1513 204 100 11 8 0 8 11
1514 234 101 10 9 0 8 10
1520 31 126 9 8 0 8 9
1521 141 124 9 8 0 8 9
1522 75 42 9 4 0 8 9
1523 150 160 4 4 0 10 3
1524 235 80 7 4 0 10 6
65075 248 67 3 15 -1 13 16
65533 124 256 14 13 1 12 16
Binary file not shown.
@@ -2,7 +2,7 @@ vec4 InstancingPosition(vec4 position);
void main()
{
vec4 worldPos = InstancingPosition(gl_Vertex);
vec4 worldPos = InstancingPosition(gl_Vertex);
gl_FrontColor = gl_Color;
gl_TexCoord[0] = gl_MultiTexCoord0;
@@ -12,7 +12,7 @@ vec3 InstancingNormal(vec3 normal)
tmp.x = dot(vec3(Instancing1), normal);
tmp.y = dot(vec3(Instancing2), normal);
tmp.z = dot(vec3(Instancing3), normal);
return tmp;
}
@@ -24,6 +24,6 @@ vec4 InstancingPosition(vec4 position)
tmp.x = dot(Instancing1, position);
tmp.y = dot(Instancing2, position);
tmp.z = dot(Instancing3, position);
return vec4(tmp, 1.0);
}
@@ -6,7 +6,7 @@ vec4 InstancingPosition(vec4 position);
void main()
{
vec3 normal = InstancingNormal(gl_Normal);
vec4 worldPos = InstancingPosition(gl_Vertex);
vec4 worldPos = InstancingPosition(gl_Vertex);
gl_FrontColor = vec4(lighting(normal),1.0) * gl_Color;
gl_TexCoord[0] = gl_MultiTexCoord0;
@@ -28,36 +28,36 @@ void main()
float t; // Temporary variable
vec2 reflCoords, refrCoords;
vec3 reflColor, refrColor, specular;
n = normalize(texture2D(normalMap, gl_TexCoord[0].st).xzy - vec3(0.5, 0.5, 0.5));
l = -sunDir;
v = normalize(cameraPos - worldPos);
h = normalize(l + v);
ndotl = dot(n, l);
ndoth = dot(n, h);
ndotv = dot(n, v);
myMurkiness = murkiness * min(waterDepth / fullDepth, 1.0);
fresnel = pow(1.0 - ndotv, 0.8); // A rather random Fresnel approximation
refrCoords = 0.5 * (gl_TexCoord[2].xy / gl_TexCoord[2].w) + 0.5; // Unbias texture coords
refrCoords -= 0.8 * waviness * n.xz / w; // Refractions can be slightly less wavy
reflCoords = 0.5 * (gl_TexCoord[1].xy / gl_TexCoord[1].w) + 0.5; // Unbias texture coords
reflCoords += waviness * n.xz / w;
reflColor = mix(texture2D(reflectionMap, reflCoords).rgb, sunColor * reflectionTint,
reflColor = mix(texture2D(reflectionMap, reflCoords).rgb, sunColor * reflectionTint,
reflectionTintStrength);
refrColor = (0.5 + 0.5*ndotl) * mix(texture2D(refractionMap, refrCoords).rgb, sunColor * tint,
myMurkiness);
specular = pow(max(0.0, ndoth), shininess) * sunColor * specularStrength;
gl_FragColor.rgb = mix(refrColor + 0.3*specular, reflColor + specular, fresnel) * losMod;
// Make alpha vary based on both depth (so it blends with the shore) and view angle (make it
// become opaque faster at lower view angles so we can't look "underneath" the water plane)
t = 18.0 * max(0.0, 0.7 - v.y);
@@ -0,0 +1,2 @@
a = 10
atext = "dummy"
@@ -0,0 +1 @@
b = 10
@@ -0,0 +1,7 @@
a = 8
atext = "dummyreplaced"
b = 8
c = 8
[scoped]
e = 8
@@ -0,0 +1,2 @@
[scoped]
e = 10
@@ -0,0 +1,8 @@
a = 1
b = 2
c = 3
d = 4
[scoped]
e = 5
f = 6
@@ -0,0 +1,8 @@
try
{
Engine.callback();
}
catch(e)
{
log(e.message);
}
@@ -0,0 +1 @@
log("blah blah blah");
@@ -0,0 +1,3 @@
await undefined;
// `import "blabbermouth.js";` would be hoisted before the await resulting in it not being delayed.
log("blah blah blah");
@@ -0,0 +1,4 @@
export default function()
{
return import("include/pi.js");
}
@@ -0,0 +1,6 @@
export let value = 6;
export function mutate(newValue)
{
value = newValue;
}
@@ -0,0 +1,4 @@
let value = 6;
export default value;
// eslint-disable-next-line no-useless-assignment
value = 36;
@@ -0,0 +1 @@
export default 36;
@@ -0,0 +1,2 @@
export default let value = 6;
value = 36;
@@ -0,0 +1,3 @@
let value = 6;
export { value as default };
value = 36;
@@ -0,0 +1,4 @@
function foo()
{
import "include/pi.js";
}
@@ -0,0 +1,18 @@
import { circleArea } from "include/geometry/area.js";
class Circle
{
radius;
constructor(radius)
{
this.radius = radius;
}
get area()
{
return circleArea(this.radius);
}
}
export default Circle;
@@ -0,0 +1,8 @@
import RenamedCircle from "include/circle.js";
const area = new RenamedCircle(10).area;
if (area === (Math.PI * 100))
log("Test succeeded");
else
throw new Error("Module Evalutation Error");
@@ -0,0 +1,6 @@
import importedPi from "include/pi.js";
export function circleArea(radius)
{
return importedPi * (radius * radius);
}
@@ -0,0 +1 @@
export default Math.PI;
@@ -0,0 +1 @@
export * from "export.js";
@@ -0,0 +1,4 @@
export function getMeta()
{
return import.meta;
}
@@ -0,0 +1,4 @@
export function fn()
{
return "Base";
}
@@ -0,0 +1 @@
throw new Error("This script should't be evaluated.");
@@ -0,0 +1,7 @@
// Even though this is local to the module, it's visible to other appendixes.
function appendToResult(fun, str)
{
return () => fun() + str;
}
fn = appendToResult(fn, "0");
@@ -0,0 +1,4 @@
if (import.meta.path !== "modified/base.js")
throw new Error("import.meta.path should be the path of the base.");
fn = appendToResult(fn, "1");
@@ -0,0 +1 @@
throw new Error("This script should't be evaluated.");
@@ -0,0 +1 @@
import("restriction/disallowedfile.js");
@@ -0,0 +1 @@
import "restriction/../restriction/disallowedfile.js";
@@ -0,0 +1 @@
import "restriction/disallowedfile.js";
@@ -0,0 +1,2 @@
await undefined;
await undefined;
@@ -0,0 +1 @@
await new Promise(() => {});
@@ -0,0 +1 @@
throw new Error("Test reason");
@@ -13,7 +13,8 @@ async function waitAndIncrement(promise)
{
let resolve;
const promise = new Promise(res => {
const promise = new Promise(res =>
{
incrementTest();
resolve = res;
});
@@ -11,7 +11,10 @@ function Vector2D(x, y)
this.y = y;
}
else
this.x = this.y = 0;
{
this.x = 0;
this.y = 0;
}
}
Vector2D.prototype.add = function(v)
@@ -30,7 +33,11 @@ function Vector3D(x, y, z)
this.z = z;
}
else
this.x = this.y = this.z = 0;
{
this.x = 0;
this.y = 0;
this.z = 0;
}
}
Vector3D.prototype.add = function(v)
{
@@ -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;
};

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