1
0
forked from mirrors/0ad
Commit Graph

25394 Commits

Author SHA1 Message Date
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