Commit graph

25677 commits

Author SHA1 Message Date
Vladislav Belov
cf4a4d8fd5
Adds SwapChain as an explicit DeviceObject
It allows us more flexibility on how we control swapchain. That includes
toggling V-Sync in real time.
2026-06-08 18:26:58 +02:00
Ralph Sennhauser
dab6e1a37a
Fix disabled pathfinder tests
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>
2026-06-07 10:43:32 +02:00
Ralph Sennhauser
296ccc78c9
Fix disabled serializer tests
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>
2026-06-07 10:00:40 +02:00
Ralph Sennhauser
0599848330
Cleanup Atlas SectionLayout
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>
2026-06-07 09:36:57 +02:00
Ralph Sennhauser
e3afa15966
Cleanup Atlas section headers
Make not otherwise used functions private and use override as
appropriate.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-07 09:36:57 +02:00
Ralph Sennhauser
94f13073ce
Remove unused allocator page_aligned
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>
2026-06-05 16:57:20 +02:00
Ralph Sennhauser
cf5501a35b
Support numpad with player hotkey in ActorViewer
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>
2026-06-05 16:22:28 +02:00
Ralph Sennhauser
fcbc3d3f71
Limit max PlayerID in Atlas hotkeys
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>
2026-06-05 16:22:28 +02:00
Ralph Sennhauser
0c0552a428
Replace M_PI with C++ numbers
C++20 added π (pi) to the standard, replace the C macro globally.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-04 20:29:48 +02:00
Ralph Sennhauser
4379194255
Fix sidepanel layout in Atlas
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>
2026-06-03 19:17:28 +02:00
guerringuerrin
3922a7ee0a Prioritize least busy buildings for hotkey training commands
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
2026-05-27 10:29:08 -03:00
Vladislav Belov
1250ca1dac
Replaces FALLTHROUGH macro by attribute
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
It was forgotten during removing the FALLTHROUGH macro in
b41ca5ad78.
2026-05-22 23:25:31 +02:00
Vladislav Belov
a0ecfbaa33
Skips UNIFORM buffers for GLES
Currently we don't support UNIFORM buffers for GLES.

Refs 54701868da
2026-05-22 23:14:30 +02:00
phosit
01bd743b30
Correct LoadModal to continue a saved campaign
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
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.
2026-05-21 21:29:56 +02:00
Ralph Sennhauser
a0bb103390
Unwrap SDL_Event
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
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>
2026-05-20 19:44:52 +02:00
phosit
34ab0f3938
Disconnect before deleting the session
The session was deleted from `m_Sessions` before disconnecting. Since
e7a583adc0 that also deleted the session.
2026-05-17 17:20:37 +02:00
phosit
a95579a046
Fix UI when connecting to a server fails
When the connection fails, it wasn't possible to close the progress
window.
Now `PollNetworkClient` also resolves the previous promise.
2026-05-17 17:20:37 +02:00
guerringuerrin
32e5520507 Add hotkeys for opening GUI pages across the game
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
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
2026-05-16 20:53:54 +02:00
wowgetoffyourcellphone
9df2dc2585 Temple of Athena Nike by @nifa
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
Temple of Athena Nike by @nifa

SpecificName from @Outis and @Thalatta
2026-05-14 13:38:32 +02:00
Vladislav Belov
017aa3b736
Adds splitted shader effects to materials
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
2026-05-10 23:57:27 +02:00
Vladislav Belov
59e36be140
Splits shader effects to reuse in material passes 2026-05-10 23:57:23 +02:00
Vladislav Belov
18a16aa135
Moves all rendering to material passes
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.
2026-05-10 23:57:20 +02:00
Vladislav Belov
aced56c336
Adds material passes to choose different shaders
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.
2026-05-10 23:57:16 +02:00
Vladislav Belov
9aee507e28
Adds wireframe techniques for particle and terrain 2026-05-10 23:57:12 +02:00
Vladislav Belov
75bd640bd8
Removes context of terrain shadows and 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.
2026-05-10 23:56:57 +02:00
Vladislav Belov
58d3527130 Adds profile table for renderer backend statistics
Some checks are pending
checkrefs / lfscheck (push) Waiting to run
checkrefs / checkrefs (push) Waiting to run
lint / cppcheck (push) Waiting to run
lint / copyright (push) Waiting to run
lint / jenkinsfiles (push) Waiting to run
pre-commit / build (push) Waiting to run
2026-05-10 19:26:16 +02:00
Vladislav Belov
2e87f6b5aa Adds renderer backend-specific statistics
Different backend have different metrics to watch and debug. So we need
a simple way to collect that.
2026-05-10 19:26:16 +02:00
phosit
3549cc1e6c
Remove the hint that ai-rejoin isn't supported 2026-05-10 14:18:52 +02:00
phosit
b3552ebccb
Clone the position in attackPlan 2026-05-10 14:18:52 +02:00
phosit
e2466e9bd5
Consistently sort the ai-queues
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.
2026-05-10 14:18:51 +02:00
phosit
6d31e6de89
Serialize the isIdleConfirmed for the AI
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.
2026-05-10 14:18:51 +02:00
phosit
be03605eac
Update unitCollection in attackPlan 2026-05-10 14:18:51 +02:00
phosit
86289a89fd
Clone the bonuses
Sometimes the same object was serialized.
2026-05-10 14:18:51 +02:00
phosit
53a67e560f
Sort templateModifications after inserting
The insertion order might not be consistent when clients join.
2026-05-10 14:18:51 +02:00
phosit
b572fed672
Consistently sort the build order
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.
2026-05-10 14:18:51 +02:00
phosit
c4dd0040ee
Never serialize an event when it's not owned 2026-05-10 14:18:51 +02:00
phosit
2f86d4a2f8
Don't write entity-metadata when deserializing
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.
2026-05-10 14:18:51 +02:00
phosit
55f2d356ff
Clone targetPos in attackPlan
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.
2026-05-10 14:18:51 +02:00
phosit
3ddf101a06
Inform the AI about builders when initializing
This wasn't a problem since there are no builders on a fresh match but
now when deserializing there might be builders.
2026-05-10 14:18:50 +02:00
phosit
9aea56e4a2
Also serialize unitCollUpdateArray in AttackPlan
It needs to be serialized so it's known which units to update next.
2026-05-10 14:18:50 +02:00
phosit
f35595610a
Sort entitycollections when adding entities
On joining clients entitycollections are always sorted. To stay in sync
non-joining clients also have to sort entitycollections.
2026-05-10 14:18:50 +02:00
phosit
130ea06ce8
Don't add queues when deserializing AttackPlans
When deserializing the queues are already there. It was an error to try
to add a queue since sometimes there must not be a queue.
2026-05-10 14:18:50 +02:00
phosit
cca2cfe05c
Don't updateTerritories when deserializing
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.
2026-05-10 14:18:50 +02:00
phosit
e9339591c2
Reset turnCach at the begin of the turn 2026-05-10 14:18:50 +02:00
phosit
911285e625
Always update territories 2026-05-10 14:18:50 +02:00
phosit
4b516b336e
Get the UnitAI order data directly
The cached data wasn't always up to date. I coudn't figure out when to
update it.
2026-05-10 14:18:50 +02:00
phosit
3afdf64eee
Update territories when a construction is finished
Constructions can change the territories. So they should be updated.
2026-05-10 14:18:50 +02:00
phosit
f5e926f6fe
Remove remanents of entityObj
All uses have been removed.
2026-05-10 14:18:49 +02:00
phosit
b6243966f3
Remove usage of entityObj from Destroy event
`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.
2026-05-10 14:18:49 +02:00
phosit
0a2294171e
Remove usage of entityObj in VictoryManager
This is done by remembering the ID of the assigned healers and guards.
2026-05-10 14:18:49 +02:00