Use `<filesystem>` instead of `truncate` and remove `truncate`
portability wrapper.
Add a helper function `StatusFromSystemError` to convert error_code to
`Status`.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Drop the use of lowlevel interfaces and consitently use the cpp
interface decupling it from systm dependent code.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
`this.events` is only valid during one turn. When it is used in the next
turnn it might be outdated. So it makes no sense to keep it alive untill
the next turn.
There is a workaround for an old bug with the use of wxCollapsiblePane.
As the widget itself is no longer in use, just remove the now dead code.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The terrain selection notebook is painful to navigate with a large
amount of tabs. Further the control is broken on macOS. As such replace
the wxNotebook with a wxChoicebook.
Fixes: #8705
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Interdependent content width in terrain selection panel results in GTK
throwing warnings. Don't expand the grid cell content.
Also wrap the grid to keep spacing consistent and not variable for the
terrain buttons.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
iwyu 0.26 now want's full declaration of TYPE in case of
std::vector<TYPE>, which is good as it allows the header to be
self standing.
There are some other changes suggested in part of the headers not being
updated when they should have been and some due to changes in iwyu
itself.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Add the header to iwyu mappings as private as the wx documentation
doesn't suggest otherwise.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
A regex-based
search across the codebase confirms there are no other instances
of "Man" that should be renamed to "Manager".
Variables were not renamed.
This commit performs code cleanup to improve
code clarity and consistency:
Remove redundant 'virtual' keywords from methods that are already marked
with 'final' or 'override', as well as reducing redundant 'override
final's to 'final'.
Previously, TreeSection was drawn before TrainerSection.
Reversing the order ensures TrainerSection layout is resolved first,
which fixes scroll state being computed against an incomplete
structree page render.
Fixes#8893
Instead of storing a single flat list of positions and data per
building, RallyPoint now stores them keyed by player ID. This lets
mutual allies independently set and display rally points on each
other's structures.
The GUI now allows selecting allied buildings with a rally point
and only shows the viewing player's own rally point data.
GuiInterface gets an OnUpdate handler to keep displayed positions
in sync when rally point targets move.
GetRallyPointCommands now takes raw position and data arrays instead
of a component reference. The network command field is also renamed
from "entities" to "structures".
Fixes#3115
The function was used as a fallback for when a platform specific approach
isn't available. Given that it effectively is a roundabout way to derive
it from argv[0] which we use as a generic fallback anyway just remove
it.
This further allows to make cxxtest optional.
Refs: #8618
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This is more reliable than argv[0] which is effectively used via
unix_ExecutablePathname. Also drop the fallback as it effectively is the
same as the generic fallback and blocks making cxxtest optional.
On FreeBSD the procfs is not mounted by default, so use a syscall
instead.
Refs: #8618
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The fallback is of little value and blocks making cxxtest an optional
build dependency. While at it use realpath instead of readlink.
Refs: #8618
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Remove stale NAN and INFINITY, both have equivalents since C++11 and
cleanup headers in wposix source file.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
I forgot to finish CSubmitScheduler synchronization in
7c84c23114. Even ++m_FrameID was
forgotten. And it worked at the time. A proper synchronization is
described in renderer/backend/Vulkan/SwapChain.h.
The disabled test are all broken one way or another. The maps used in
the tests got renamed. The pathfinder component got some performance
improvements which now require to call UpdateGrid() once before use.
Finally for the InitAttributes to be deep frozen they need to be an
object, so initialize them.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
test_hash depends on modmod for xml schemas. InitAttributes need to be
set as deep freezing expects them to be a valid object. The map used got
renamed at some point. Finally prior to running the sim PreInitGame()
and InitGame() need to be called.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Don't declare empty constructor and destructor, avoid c-style cast and
remove TODO about a bug that can't be reproduced any longer.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Unused and since C++17 not really valuable with std::aligned_alloc
(_aligned_malloc and _aligned_free in case of MSVC) available. We also
have an other similar interface with "lib/sysdep/vm.h".
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
KEY_DOWN means we need to check for the "down" values instead of "char"
value which differer for numpad.
Ref: #501
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
9 isn't a valid playerID, setting this value causes a JS error
and corrupting the viewport.
Further limit selectable max playerID to what the mapSettings say.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
In many places there are missing gaps/borders and where there are there
are almost random values used (2/3/4/5/8/10/15).
Add missing and standardize on using gaps 5 and 10 pixel only.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
getTotalQueueTime(queue) calculates total remaining
queue time of a production building.
getBuildingsSortedByQueueTime(entities), sorts building selection
by their queued training time and filter invalid entities
Removes the resource availability guard from the Training selection
panel onPress handler to align mouse interaction with hotkey behavior
The `closePageCallback` isn't forwarted to the function calling it. Now
it's possible again to continue a saved campaign.
The error was introduced in 76b6725272.
Since C++11 a C typedef'ed union can be forward declared, so the wrapper
is no longer needed.
While at it switch signatures to refs and convert C style casts.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Add registerGlobalGuiPageHotkeys() to
common/functions_utility.js to selectively register
GUI page hotkeys
Allow active GUI pages to close using their corresponding hotkey
Move page_hotkeys.xml from gui/hotkeys/ to gui/
Update page_hotkeys.xml references in MainMenuItems and MenuButtons
Add default tipScrolling fallback in TipsPage when no initData is provided
Now we should use material passes instead of context and defines to
select a needed shader. It allows us to reduce the number of
shader combinations we use and reduce memory consumption.
All shaders were selected by context (set of defines) which increases
the number of needed permutations. For example: we don't need to know
about shadows when rendering silhouettes.
We were unnecessary passing all combinations of our scene shader context
even if we don't need it as for shadows and silhouettes for terrain
rendering. Since we only need to draw a solid color.
When the returned value of the compare function is `0` the order is
preserved. Before the sort, the order between joining clients and
non-joining clients differ.
Additionally sorting by name should make the order consintent.
The AI only noticed for changes to `isIdleConfirmed`. That is done to
avoid recursions and don't send to many messages. But when the AI is
deserialized it get's `isIdle` from the simulation. Leading to an OOS.
When the returned value of the compare function is `0` the order is
preserved. Before the sort, the order between joining clients and
non-joining clients differ.
Now everything important (which is used later on) is included in the
comparison. If still `0` is returned it's not importent which element is
taken.
Another solution would be to have one array per category.
The metadata where written every the turn of deserialization. When on
the non rejoining client it was only written when that AI makes a turn
and handles the events.
On a rejoined client the data isn't the same anymore. But it's equal.
Likely this is because the data isn't aquired at the same turn.
This could also be solved more generally by copying all data which is
pushed to the AI. Or by using the same serializer for AI as for the rest
of the simulation.
Clients which didn't late-join only get a change to `uptadeTerritories`
when the ai playes a turn. When joining clients do it at the turn when
they deserialize the ai they might be ahead of the others. That would
lead to an out of sync.
`entityObj` is not available on clients which just have rejoined. As not
all clients have access to it the data shouldn't be used for anything
elaborate.
The information where a unit is and which resource it provides wasn't
available on joining clients. Now the `resourceMap` is reset when a
resource is destroide.
It would be performance intensive when the `resourceMap` would be reset
when any unit would be destroied. To prevent this the `SharedScript`
remembers which entities are resourcesources.
When destroying a builder it might not be known anymore what it was able
to build. Now the entityIDs of the builder is stores. So that it can
easily be looked up and removed.
On newly deserialized clients there is no property for the destroied
entities. Because of that the metadata of the entity wasn't remembered
in the event and wasn't destroied.
`GetFullRepresentation` doesn't reset `this.changes` to `null`. So when
a message arrives the ai-interface will not be informed.
The ai-interface calls `GetFullRepresentation` and removed the dirty
flag from the ai interface.
This two behaviors lead to the error that the ai never receives messages
from entities which exist at game start.
The assignement has to be done for new dropsite but must not always be
done as it sends a command.
Serialized data shouldn't be too complicated. Because of that the `ent`
property is removed.
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
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>
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.
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.
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
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.
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.
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`.
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.
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
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.
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.
Since ec19e5d663 German Support Wagons cannot train Units anymore so
that Wagon Trains cannot unlock this ability as well.
Reported by @xordspar0
Fixes#8799
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.
Encountered in the test-suite run. This is just a workaround; the
implementation needs to be reworked/replaced to accommodate
alignment-sensitive architectures.
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.
In-Game the Germans Cimbrian Clubman unit is erroneously declared
Builder and Worker
This removes these two Classes from the visible Classes
Fixes: #8806
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
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
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.
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.
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).
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.
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.
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.
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.
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.
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
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.
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
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.
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
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.
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.
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.
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
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>
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
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
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
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
-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.
As for any invalid argument reject them and cleanly exit with failure
status.
Fixes: #7687
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
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>
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
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>
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.
Intended as replacment for mongoose, which due to license change can't
be updated anymore.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
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
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.
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
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
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>
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*.
Prefix output of DbgXMPP so it is clearly assosiated. Furhter avoid
newlines in debug statements.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
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.
`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.
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.
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).
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
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).
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 d549cbeeaaFixes: #8351
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.
-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.
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
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.
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.
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
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
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
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.
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
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
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
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.
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.
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>
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
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).
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
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.
'StatusName', 'ApplierTooltip' and 'ReceiverTooltip' are attributes of status
effects, which are defined in JSON files (and already extracted
correctly from there), not XMLs.
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
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.
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.
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>
Commit 3eee3a444d added final keyword to
simulation classes but left virtual keywords in place.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
```
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>
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: #8529Fixes#8455
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.
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>
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.
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.
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ô")
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.
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`.
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>
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>
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>
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] 7a495bb46d
[1] 2fa0a00583Fixes: #8471
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
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>
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.
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
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/8476Fixes: #7594
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
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.
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.
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>
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>
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>
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
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.
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: #8413Fixes: #8425
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/
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>
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
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>
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>
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
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
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>
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>
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.
-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
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.
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
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
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
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.
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
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.
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.
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.
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
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
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
`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.
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.
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>
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.
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>
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
`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.
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
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)
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.
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>
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>
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>
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.
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.
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>
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
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>
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).
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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
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.
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>
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>
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>
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>
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>
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>
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>
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
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>
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.
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
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>
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.
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>
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>
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
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>
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>
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>
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: aa3bd08513Fixes: #8215
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
<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>
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>
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>
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>
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>
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.
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.
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.
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.
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.
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.
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.
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.
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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.
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.
`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.
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>
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.
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.
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
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>
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>
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.
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>
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>
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>
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>
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>
`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.
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
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>
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.
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>
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>
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>
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*.
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>
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>
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>
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>
Increase vision range to avoid continuous firing for most structures.
Ref: #6708
Rename onager template to 'siege_onager_unpacked' to follow existing
naming conventions.
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
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
`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.
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>
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>
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>
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>
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.
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>
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>
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
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: #8043Fixes: #8138
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>
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.
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.
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.
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>
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.
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>
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`.
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>
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>
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>
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>
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>
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.
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.
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.
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.
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.
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: #8107Fixes: #8091
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>().
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.
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.
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
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>
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.
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.
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.
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>
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, #1810Fixes: #8060
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.
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.
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
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>
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>
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>
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>
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.
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.
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>
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>
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>
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.
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>
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>
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>
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
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.
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.
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
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
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
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>
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`.
- 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`).
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>
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.
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>
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.
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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
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>
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>
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
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
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.
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>
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>
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
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.
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>
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>
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.
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.
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.
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>
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.
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.
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.
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.
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.
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.
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
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
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.
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>
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.
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>
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>
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>
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
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>
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.
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.
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>
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.
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.
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.
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>
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.
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.
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.
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.
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>
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>
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>
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>
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
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.
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.
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>
Fix nvtt build to support cmake-4, while at it also fix other
related outstanding cmake issues in nvtt.
Fixes: #7538Fixes: #7764
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
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.
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.
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.
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>
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>
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.
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
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.
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
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.
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.
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
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.
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
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 82513c9104Fixes: #7620
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.
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.
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.
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>
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>
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>
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>
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.
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>
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>
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>
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)
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
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.
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>
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)
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.
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>
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>
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
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.
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.
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.
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>
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)
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.
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.
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.
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.
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
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
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=105329https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100366
Add quirk to avoid the warning
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
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>
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>
- 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.
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>
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.
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.
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.
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.
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.
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.
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.
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.
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>
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>
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.
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.
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.
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.
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.
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.
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.
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.
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>
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.
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>
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.)
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`.
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
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.
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.
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
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.
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.
- Apply Scale
- Rename mesh from Circle to viking_longship
- Remove useless material
- Add prop-projectile-prop point
Reported by: @Langbart
Fixes#7424
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
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.
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.
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.
`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.
`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.
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.
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>
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
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.
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.
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
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
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.
`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.
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>
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.
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.
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
5665 changed files with 3094018 additions and 170492 deletions
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)
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)
@ -470,6 +522,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 +535,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 +555,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 +572,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 +587,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 +608,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 +651,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 +667,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.