Commit graph

25174 commits

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