Commit Graph

25731 Commits

Author SHA1 Message Date
Vladislav Belov 8c5416e2c5 Adds fragment shader PBR resolve
It allows to have PBR for devices without properly detected compute
shaders.
2026-06-20 13:29:01 +02:00
Ralph Sennhauser 181a29597d Remove helper function FileExists
Use std::filesystem at caller site instead.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-20 12:01:38 +02:00
Vladislav Belov 5ca4c93f55 Reduces canvas2d layout for SPIR-V
It's preferrable to keep push constant under 64 bytes for some vendors.
The layout optimization rule is similar to C++ one.
2026-06-20 11:22:29 +02:00
Ralph Sennhauser 355c068068 Remove helper function FileSize
Use std::filesystem at caller site instead.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-20 09:00:57 +02:00
phosit 364d50e184 Move the gameView input handler to CGameView
`game_view_handler` isn't global anymore. That makes the interface
simpler and might make the compilation and the runtime faster.
2026-06-19 20:53:52 +02:00
phosit 3bf8e92ed4 Move the profileViewer handler to CProfileViewer
`CProfileViewer::InputThunk` isn't global anymore. That makes the
interface simpler and might make the compilation and the runtime faster.
2026-06-19 20:53:52 +02:00
phosit 80d5fd7a52 Move the gui input handler to CGUIManager
`gui_handler` isn't global anymore. That makes the interface simpler and
might make the compilation and the runtime faster.
2026-06-19 20:53:52 +02:00
phosit b2a8f94a20 Move the console input handler to CConsole
`conInputHandler` isn't global anymore. That makes the interface simpler
and might make the compilation and the runtime faster.
2026-06-19 20:53:52 +02:00
phosit 596c0c2ddd Split screenshot from main input handler
This enables the screenshot hotkeys in atlas.
2026-06-19 20:53:52 +02:00
phosit 464d40ab61 Split window from main event handler
Two globals can be removed.
2026-06-19 20:53:52 +02:00
phosit 3af4287f6d Change the return type of event-handler
The return value is more strongly typed.
2026-06-19 20:53:52 +02:00
phosit 47e8a17a41 New input handling system
The new system allows to register all function objects as Input::Handler
not only function pointers.
To not get dangling references a handler is unsubscribed on it's
destruction.
The order in with the handlers are executed has to be specified by the
slot-argument, instead of the reverse order of registration.
2026-06-19 20:53:51 +02:00
Ralph Sennhauser 02d9a083aa Restore visiblity on sim reset in Atlas
The LOS override for all players isn't serialized as such we have to
restore it when resetting a game.

Fixes: #8926
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-19 19:55:42 +02:00
Ralph Sennhauser 628713859f Don't send default setting to engine
Sending default setting on first view of a section/tool to the engine
triggers the "you have changes" mechanism. Sending them just in case
isn't needed unless there is a bug in a different place.

Drop this preemptive measure.

Fixes: #3029
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-19 19:25:09 +02:00
Ralph Sennhauser 52dee75c47 Remove unused helpers from wfilesystem
Were used for mtime conversion. Cpp-20 has std::chrono::file_clock.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-18 20:47:34 +02:00
Ralph Sennhauser 3c0274c7cc Remove unused android filesystem helpers
We don't use neither opendir nor readdir nor closedir. Further there are
no callers for init_libc().

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-18 19:48:05 +02:00
Ralph Sennhauser 62e116340e Remove POSIX rename wrapper
Unused by now, use `<filesystem>` instead.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-18 17:46:00 +02:00
Ralph Sennhauser 792949e812 Remove POSIX mkdir wrapper
Unused by now, use `<filesystem>` instead.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-18 10:53:30 +02:00
Ralph Sennhauser ca3bacf6c1 Update Atlas sidebar layout
Replace the wxBoxSizer with a wxFlexGridSizer so the gaps between main
elements, typically wxStaticBoxSizer, remain uniform across the tools.

Add a style variable to control the wxFlexGridSizer on platform basis.

Also replace the obsolete wxScrolledWindow by inheriting from
wxScrolled<wxPanel> instead.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-17 18:58:02 +02:00
Ralph Sennhauser e3c65841de Replace all uses of POSIX stat
Use `<filesystem>` instead of `stat` and remove wrapper.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-17 13:14:28 +02:00
Ralph Sennhauser fab4a132e1 Fix camera reset under bird view in Atlas
Resetting camera while in bird view should reset birdview flag.

Fixes: 9388692a47
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-16 19:20:53 +02:00
Ralph Sennhauser 8336e679af Replace all uses of POSIX realpath
Use `<filesystem>` instead of `realpath` and remove wrapper.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-16 14:08:02 +02:00
Ralph Sennhauser 6b4ecbdc40 Create dedicated stylesheet for Atlas
This is meant as a central place to tweak layout per platform.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-15 21:27:42 +02:00
Ralph Sennhauser 149baf116b Replace all use of POSIX truncate
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>
2026-06-15 15:33:59 +02:00
Ralph Sennhauser 57f5b73458 Remove unused wrapper for POSIX rmdir
std::filesystem::remove can be used instead.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-15 15:33:59 +02:00
Ralph Sennhauser 518ed74496 Replace all use of POSIX unlink
Use `<filesystem>` instead of `unlink` and remove `unlink` portability
wrapper.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-15 15:33:59 +02:00
Vladislav Belov 4259c78150 Removes unused Get/SetDepthTextureBits methods
Methods were added in f903b83674.
Methods became unused in 12e2428495.
2026-06-15 00:35:04 +02:00
Ralph Sennhauser 71400e8045 Drop unused lowlevel functions
and associated types. Aka posix dirent.h abstraction.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-14 21:58:59 +02:00
Ralph Sennhauser 43e7dbc6da Use std::filesystem for filesystem abstraction
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>
2026-06-14 21:58:59 +02:00
phosit 2f2cbb96bf Remove this.isDeserialized from BaseAI
`this.isDeserialized` is only required for AIs which `Deserialize`
function depends on the game state.
2026-06-14 17:52:54 +02:00
phosit a4b580991b Move this.turn to PetraBot
The `BaseAI` shouldn't make assumptions whether the AI runs every turn.
2026-06-14 17:52:54 +02:00
phosit babe9e5c18 Remove this.events from AIs
`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.
2026-06-14 17:52:54 +02:00
phosit cbce748b8c Remove moduleName from Petras data.json
It was accidentally re-introduced in 88dc947b6a.
2026-06-14 13:21:26 +02:00
Ralph Sennhauser 1ab55e7f2e Remove leftover code from wxCollapsiblePane use
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>
2026-06-13 18:34:09 +02:00
Ralph Sennhauser b4fe426963 Replace notebook with choicebook
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>
2026-06-13 16:57:32 +02:00
Ralph Sennhauser 8cb4f5e4a3 Fix negative content width GTK warnings in Atlas
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>
2026-06-13 13:38:44 +02:00
Ralph Sennhauser 9388692a47 Add bird view to Atlas
Fixes: #2657
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-12 21:54:01 +02:00
Ralph Sennhauser fa9584fdc0 Fix some Atlas header includes
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>
2026-06-12 21:22:36 +02:00
Ralph Sennhauser 7f4377c086 Treat <wx/defs.h> as private header
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>
2026-06-12 21:22:36 +02:00
animus 1034b55037 Rename class names postifxed with "Man" to "Manager".
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.
2026-06-12 18:35:32 +02:00
animus b1627f5158 Remove redundant virtual keywords
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'.
2026-06-12 18:35:32 +02:00
Jonny McCullagh 917275d6cb Add more tips incl the Arsenal and Great Hall
Fixes #8914
2026-06-12 10:44:41 +02:00
mehmed-faheim-arslan 50e1f51755 Draw trainer section before tree section
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
2026-06-10 20:55:52 +02:00
mehmed-faheim-arslan 39b1311fac Allow players to set rally points on allied buildings
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
2026-06-10 00:09:48 +02:00
wowgetoffyourcellphone 8a999d63b7 Add missing garrisoned prop point to the Athena Nike mesh. 2026-06-09 01:04:10 +02:00
Ralph Sennhauser 25f920bdb2 Make cxxtest optional
Remove mocks as they are no longer used making cxxtest effectively
optional.

Fixes: #8618
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-08 20:59:45 +02:00
Ralph Sennhauser 2d317d509d Remove unix_ExecutablePathname
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>
2026-06-08 20:59:45 +02:00
Ralph Sennhauser ae6d3bfc4e Implement BSD specific sys_ExecutablePathname
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>
2026-06-08 20:59:45 +02:00
Ralph Sennhauser 349478aa6b Remove Linux sys_ExecutablePathname fallback
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>
2026-06-08 20:59:45 +02:00
Ralph Sennhauser 6fc47e2997 Cleanup wposix header and source
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>
2026-06-08 19:52:53 +02:00