Commit graph

1495 commits

Author SHA1 Message Date
wowgetoffyourcellphone
5268cb62a6 Persians -> Achaemenids
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
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
joeybadz
77a53121e0 Handle module attributes in checkrefs
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
Prevents GUI modules from being incorrectly reported as unused files

Fixes #8147
2026-04-20 21:09:25 +02:00
Atrik
0171a58f26 Handle empty Auras reference in checkrefs
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
2026-04-17 12:32:08 +02: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
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
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
Vladislav Belov
70c15abadb
Fixes Atlas Terrain panel in dark mode 2026-02-06 15:21:15 +01:00
Vladislav Belov
cce01f4d6c
Fixes compilation after #8621
Fixes #8685
2026-01-25 16:29:16 +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
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
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
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
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
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
phosit
b67faf35c3
Switch main branch to Release 29 2025-12-18 18:16:11 +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
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
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
3c9b4b922e
Make getCameraProperty a lambda
A lambda is more explicit which argument it takes.
2025-11-18 20:02:06 +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
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
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
phosit
d786ac2dce
Suppress wrong positive of cppcheck in Game.cpp 2025-11-01 17:52:35 +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
Vladislav Belov
f2752f7230
Removes ARBShader capability 2025-10-14 13:04:16 +02:00
Vladislav Belov
c99345a24b Adds MapReader to cppcheck ignore. 2025-10-13 16:57:15 +02:00
Itms
acf0ccc8dc Create a 64-bit Windows installer in bundles 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
8f4aa8ddbd
Adds a script to modify rules and tests to it. 2025-10-08 13:56:48 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
eb3f0166f8 Prefer [[maybe_unused]] over UNUSED2
`[[maybe_unused]]` is in the C++ standard.
2025-07-28 13:16:37 +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