Commit graph

8663 commits

Author SHA1 Message Date
Vladislav Belov
dba968013f
Fixes Vulkan device selection.
According to #6936 some lower devices (especially virtual ones) might
report more memory than regular ones. So we can't use the memory
amount as a score for now.
2024-12-16 23:18:20 +01:00
Vladislav Belov
c7ae248b77 Removes duplicated manifest for Windows. 2024-12-16 23:07:37 +01:00
Vantha
960bd5eace Unique network transmission handling of flares
This patch addresses issues concerning a1796ed71f:

Allow for a more elegant implementation of observer flares.
And still display flares even if the sender is lagging behind:
Split off flares from simulation commands.
Remove the new, problematic 'observer commands' entirely.
Provide an engine function 'SendNetworkFlare' to the JS interface.
-> which sets off the (pretty ordinary) transmission process.
Add a new type of net messages exclusively for flares
-> contains the flare's position and its sender's GUID.
2024-12-16 18:03:25 +01:00
Stan
7b195d6a5d
Add compatibility mode detection for Windows 2024-12-14 13:47:10 +01:00
Vladislav Belov
e27909e603
Fixes SPIR-V compilation for compute_skinning shader.
Currently we don't mix storage images and storage buffers in the same
shader. Also we don't sample textures when we use storage buffers.
In the future we need to avoid shifting descriptor sets.
2024-12-11 01:18:05 +01:00
Ralph Sennhauser
ead62bba78
Update trac links with gitea links
This replaces all links pointing to trac with their corresponding links
to gitea. Also replace http with https while at it.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-12-10 11:29:48 +01:00
Vladislav Belov
de1257c8da
Adds GPU skinning support via compute shaders.
We use a shader with 64 bones by default to consume less uniform memory.
But if we meet bigger skeletons we batch and handle them afterwards.
In the future we need to sort the input models to have less changes for
bound buffers. Also we might want to skin up to 4 models per a single
dispatch.
2024-12-09 22:47:17 +01:00
Vladislav Belov
9e371824c2
Adds storage buffer support to Vulkan and GL.
The idea is similar to the storage images but we need a separate
descriptor set in Vulkan and a program interface to gather used buffer
in GL.

For Vulkan we also need to track buffers to free used descriptor sets.
2024-12-09 22:47:15 +01:00
Itms
762c686a0d
Remove check for SpiderMonkey minor version 2024-12-09 10:46:14 +01:00
Itms
0de5f2fb25
Upgrade SpiderMonkey to ESR 115 2024-12-09 10:46:12 +01:00
Itms
cc72142205
Adapt 0 A.D. to SpiderMonkey ESR 102
This follows the migration guide at:
https://github.com/mozilla-spidermonkey/spidermonkey-embedding-examples

Based on patch by: wraitii
Differential Revision: https://code.wildfiregames.com/D5002
2024-12-09 10:43:35 +01:00
Lancelot de Ferrière
7590723606 Fix non-PCH builds 2024-12-09 09:53:25 +01:00
phosit
d0ebcbe038 Allow to change a password from the lobby page
Fixes #2543
2024-12-08 17:13:47 +01:00
Lancelot de Ferrière
2535e5f5b4 Use JS for autostart parsing 2024-12-07 20:27:23 +01:00
Vladislav Belov
60b4072b29
Avoids assertions on Vulkan backend device creation in case of driver bugs. 2024-12-05 18:32:15 +01:00
Itms
adcb9755ff Refactor freezing of JS objects
- Shallow-freezing of objects is never used in our codebase, so remove
   that code path.
 - Deep-freeze is bugged in recent versions of SpiderMonkey (see bug
   https://bugzilla.mozilla.org/show_bug.cgi?id=1930258). Until a fix
   and/or a better API is provided, reimplement this feature by
   recusively freezing object properties.
 - Add tests for the deepfreeze function.
2024-12-05 17:49:16 +01:00
Vladislav Belov
e765a2c4ba
Moves tests for generate_rules and merge_rules to a separate folder. 2024-12-05 17:25:54 +01:00
Vladislav Belov
dbeb11a36b
Adds avoiding non-default render debug modes for generating rules of SPIR-V shaders. 2024-12-05 17:25:52 +01:00
Vladislav Belov
7801c40b40
Adds order test to merge_rules. 2024-12-05 17:25:50 +01:00
Vladislav Belov
53de281311
Adds +x to tools. 2024-12-05 17:25:48 +01:00
Vladislav Belov
d0d6113fc4
Fixes linter notes. 2024-12-05 17:25:47 +01:00
Vladislav Belov
b12cc27bef
Adds tools for SPIR-V rules. 2024-12-05 17:21:19 +01:00
Itms
635f1084a3
Replace uses of sprintf with sprintf_s/snprintf
This fixes deprecation warnings on newer macOS SDKs.
2024-12-05 09:51:28 +01:00
Itms
5f3b9d6d45
Ignore cast warning in mongoose
This fixes -Wcast-function-type warnings under GCC 8.
2024-12-05 09:51:27 +01:00
Itms
c11cf80ecb
Initialize some floats in CCmpPosition
This fixes -Wmaybe-uninitialized warnings under GCC 8 and clang 9.
2024-12-05 09:51:25 +01:00
wraitii
a3ce07c3bb const {} bool 2024-12-01 09:47:01 +01:00
Lancelot de Ferrière
def0f57365 Try to anticipate unit collisions to improve pathing 2024-12-01 09:47:01 +01:00
Ralph Sennhauser
7aa5890236
Fix getting host jid after 0a455fbe2d
During the removal of glooxwrapper the function GetJID was mapped to
getID. This results in NetClient querying for host jid not getting the
right value which prevents hosting a game in the lobby.

Reported-by: Dunedan
Refs: #7203
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-11-29 05:50:16 +01:00
phosit
32b26e6d0c Remove unused delta in Camera.cpp
The variable was introduced in 5470eff53c but never used.
2024-11-25 21:23:05 +01:00
Ralph Sennhauser
0a455fbe2d Remove glooxwrapper
This wrapper was meant to support multiple C++ ABIs with a single
pre-built gloox library wrap as a C library. A new ABI change was
rejected a few years back, so this will probably take a while for it to
be on the table again. With the bug tracker and mailing list currently
unavailable and known TLS issues we might have replaced gloox by then
anyway.

Supporting multiple ABIs with the current setup isn't an issue either
and is already done for 32bit vs 64bit ABI on Windows.

Therefore use gloox types directly in lobby code instead of wrapper
types and delete the wrapper and build-integration.

Migrate to override where applicable, as it helped avoid subtle
differences in signatures and finding missing inheritance of LogHandler.

Finally use version check instead of os check to work around Windows
using the 1.1 development branch instead of releases.

Fixes: #7198
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-11-25 20:01:00 +01:00
Ralph Sennhauser
49507c04e0
Make failed audio device query non fatal
Querring the audio device name may fail. The name is only used for the
sake of logging it for debugging. Avoid querry failure to be fatal and
insted just log the issue.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-11-21 15:08:04 +01:00
Ralph Sennhauser
bb1910ff4c
Fix segfault with openal-1.24.0
With version 1.24.0 alcIsExtensionPresent() has dropped case insensitive
string comparison [1], use upper case names.

The internal strings are uppercase since the first git commit importing
openal 17 years ago.

[1] upstream commit 785f794141d62a4c308db26aa4a4819e6a92525e

Report: https://wildfiregames.com/forum/topic/125203-crash-on-start-due-to-soundmanager
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-11-21 15:08:03 +01:00
phosit
f8afd49ae1 Return by value from CCamera::GetScreenCoordinates
Pack the two `float`s in to a `CVector2D`.
Rename some variables to not use underscore.
2024-11-17 20:27:58 +01:00
phosit
998dc30b6d Return by value from CCamera::BuildCameraRay
Some return values can be assigned to a `const auto`, somewhere `dir` is
mutated so the whole result has to be assigned to a non `const` variable
and once only dir is used, so structured binding isn't used there.
2024-11-17 20:27:58 +01:00
phosit
cf92c20020 Return by value from CCamera::GetViewQuad
Remove some temporaries by passing the return value directly to
range-based for loops.
2024-11-17 20:27:58 +01:00
Itms
5ed3a54603
Do not pin or atomize ParamNode strings
When building a JS::Value from CParamNode, strings have been "interned"
since the conversion was written in dd501b2a5a. This means that the JS
string object could be used outside a JS realm, and also that those
strings could be compared efficiently instead of char-by-char.

This was unnecessary, and the only place in the code where we used
"interned" strings. The upgrade to SpiderMonkey 45 (64b477625d) changed
the name of related methods, and some of them are removed from the
public API in SM 102, so stop pinning and atomizing those strings.

Additionally, the switch of CParamNode to utf8 in 35ed55cfd6 missed one
of the two utf16 handlings, so fix that as well.
2024-11-17 18:59:48 +01:00
phosit
48d1b7586d Clear modsToInstall earlier
Dataflow is now more clear.

The `std::vector` is cleared earlyer, so there is a bit less memory
used.
2024-11-17 18:03:49 +01:00
phosit
3c8f6762c8 Change flags to a single bool
In `RunGameOrAtlas` only one of thous flags is used. Using a `bool` is
simpler and less error-prone.

Also reset the variable earlier, so it's easyer to reason about it.
2024-11-17 18:03:49 +01:00
phosit
31d9b0ed05 Make the TaskManager a automatic livetime object
This way the destructor can be used for cleanup.
2024-11-17 18:03:49 +01:00
phosit
256152df6d Add CXeromycesEngine
This way the destructor can be used for clean up and `Singleton` can be
used.
2024-11-17 18:03:49 +01:00
phosit
400878b374 Include utility in Future.h
Fix building without precompiled headers.
Defect introduced in 778972602a
2024-11-14 19:25:28 +01:00
trompetin17
4e98704b71
fix Propagation mousewheel event in game
Propagation mousewheel event was introduce to have the opportunity to
parent handle this event if an only if the child doenst handle and the
parent set a handler for that event.
The error foundedd by elexis inside a game relay on the message waw
propagated outsie IGUIObjects to CGUI.cpp that shouldnt be at the
beggin. I forget to stop the propagation when all objects in the tree
was validated, because of that the message was propagate to CGUI.cpp
andd then hanle by camera.
the fix suggest to only propagate the event in the GUI tree, not outside
the GUI tree
2024-11-12 15:03:28 -05:00
trompetin17
73a3602475
Fix GUI Action on MouseWheel events
Now that we are propagating mousewheel events to parent we need to
explicitly mark that the event was handle in JS and shouldnt be handle
by parent.
this error was informed by Elexis
2024-11-12 15:01:44 -05:00
trompetin17
8c250568e7
Add scrollpanel widget
This PR introduces a new ScrollPanel component with the following
capabilities:
- Scroll Orientation Support: Allows scrolling in horizontal, vertical,
  or both directions, providing flexibility for different use cases.
- Partial Object Rendering: Supports partial rendering of objects that
  are only partially visible within the scroll boundaries, improving
  visual accuracy and performance.
- Boundary-Constrained Mouse Interaction: Handles mouse events strictly
  within the panel's visible boundaries, preventing interaction with
  objects outside the scrollable area.
- Minimum Internal Size (min_width, min_height): Introduces support for
  virtual space management, allowing the panel to maintain a minimum
  internal size independent of its actual on-screen dimensions. Even
  when the panel is resized, this ensures that the content respects a
  defined virtual space (with min_width and min_height), effectively
  simulating a larger internal canvas. This is particularly useful for
  large content or scenarios where a more extensive scrollable area is
  required than the current visible panel.
2024-11-12 15:01:42 -05:00
phosit
581f4af012 Allow the future request stop from the callback
In `Future` there is a notion of cancelation / stop-request. The task
callback doesn't have such a notion.
Some tasks (like the map-generation) are stopable. It did that in a
thread unsave way.

A task is canceled when the future is destroied or when `CancelOrWait`
is called on it.
2024-11-10 20:38:37 +01:00
Vladislav Belov
9094c3adb0
Batches update and upload passes for model renderers. 2024-11-08 13:57:57 +01:00
Vladislav Belov
0a6703762d
Removes hardcoded Vulkan uniform descriptor set ranges. 2024-11-06 23:24:22 +01:00
Vladislav Belov
3a01d852e2
Adds binding slot type to Vulkan shader program. 2024-11-06 19:09:22 +01:00
Ralph Sennhauser
50aae8763f Improve script generating glad headers
The script assumes glad got cloned into glad subdirectory. This is the
case if you follow the procedure outlined in the README, however if you
are using system glad or or glad installed via pip this assumption
doesn't hold.

Therefore relax the requirement on where to get glad from. While at it
add shell option errexit and make the script callable from repository root.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-11-06 16:35:57 +01:00
Vladislav Belov
eecc5a8fea
Updates the list of GL extensions for glad. 2024-11-03 20:35:28 +01:00