Commit graph

25218 commits

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