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.