Commit graph

28496 commits

Author SHA1 Message Date
SteelT
c9c4796260 Set SDL_HINT_APP_NAME SDL hint
As with SDL3 and SDL2-compat, the app name logic is different and the default name is instead a generic "SDL Application"
2025-02-03 21:13:36 -05:00
JugadorXEI
f0bf674dc0 Fix wrong size in K_BHeapPush Z_Realloc 2025-02-01 18:16:06 +01:00
Eidolon
3c19027aa8 Merge branch 'display-exp-fix-2' into 'master'
Fixed math oopsie

See merge request kart-krew-dev/ring-racers-internal!2499
2025-01-31 01:55:20 +00:00
Ashnal
33ff42af1f Fixed math oopsie 2025-01-30 20:35:16 -05:00
Eidolon
e7f0c1e79e Clear audio graph on I_ShutdownSound
Fixes a crash when destroying SDL AudioStreams under SDL3 and
SDL2-compat.
2025-01-30 17:01:10 -06:00
Eidolon
da43100681 Merge branch 'check-input-device-count' into 'master'
Check for input devices before opening them

See merge request kart-krew-dev/ring-racers-internal!2497
2025-01-30 17:39:31 +00:00
Craftyawesome
093bfd9be0 use a signed type for NodeToSplitPlayer 2025-01-23 15:59:48 -05:00
Eidolon
1cc261e902 Check for input devices before opening them 2025-01-20 22:00:14 -06:00
Oni VelocitOni
3a23f49024 Merge branch 'exp-edgecases' into 'master'
EXP edge cases

Closes #1458

See merge request kart-krew-dev/ring-racers-internal!2455
2025-01-19 01:39:56 +00:00
Ashnal
d4bb225ab2 Fix hud overlap for 1 lap maps 2025-01-18 20:23:59 -05:00
Ashnal
1b0674d041 Grading adjustment 2025-01-18 19:29:49 -05:00
toaster
2104b0b0f5 Disable EXP in K_Cooperative
- HUD, tally, and roulette(!!)
- In basegame, affects Sealed Stars
2025-01-18 19:29:49 -05:00
toaster
396244780a Don't attempt to use adjusted EXP counter in invalid contexts
- Introduces new function K_GetDisplayEXP
    - Replaces duplicated code between HUD and tally
    - Returns UINT16_MAX in div/0 case for invalid result (resolves #1458)
- Hides EXP HUD/tally if no EXP can be earned
2025-01-18 19:29:49 -05:00
Eidolon
f7131d8e86 Fix src/k_hud.cpp line endings 2025-01-18 18:11:06 -06:00
Craftyawesome
6b925d6f72 adjust/correct comment for __internal_prng_bound__ 2025-01-02 02:41:06 -05:00
Craftyawesome
a481878a61 Fix end sign rng off-by-one 2025-01-02 02:30:43 -05:00
Eidolon
4be98c6c13 Fix src/d_clisrv.c line endings 2024-12-26 19:10:45 -06:00
Eidolon
43de82f35a Update thirdparty/fmt to 11.1.0 2024-12-26 12:45:08 -06:00
Eidolon
ed2c0c85cc Merge branch 'non-bss-convert-imgbuf' into 'master'
Allocate imgbuf on-demand in Picture_PatchConvert

See merge request kart-krew-dev/ring-racers-internal!2491
2024-12-26 16:29:37 +00:00
Oni VelocitOni
b8160c2664 Merge branch 'voice-chat' into 'master'
Add netgame voice chat

See merge request kart-krew-dev/ring-racers-internal!2490
2024-12-20 07:58:20 +00:00
Eidolon
22b20b5877 Add netgame voice chat
Implemented using libopus for the Opus codec, same as is used in Discord.
This adds the following cvars:

- `voice_chat` On/Off, triggers self-deafen state on server via weaponprefs
- `voice_mode` Activity/PTT
- `voice_selfmute` On/Off, triggers self-mute state on server via weaponprefs
- `voice_inputamp` -30 to 30, scales input by value in decibels
- `voice_activationthreshold` -30 to 0, if any peak in a frame is higher, activates voice
- `voice_loopback` On/Off, plays back local transcoded voice
- `voice_proximity` On/Off, enables proximity effects for server
- `voice_distanceattenuation_distance` distance in fracunits to scale voice volume over
- `voice_distanceattenuation_factor` distance in logarithmic factor to scale voice volume by distance to. e.g. 0.5 for "half as loud" at or above max distance
- `voice_stereopanning_factor` at 1.0, player voices are panned to left or right speaker, scaling to no effect at 0.0
- `voice_concurrentattenuation_factor` the logarithmic factor to attenuate player voices with concurrent speakers
- `voice_concurrentattenuation_min` the minimum concurrent speakers before global concurrent speaker attenuation
- `voice_concurrentattenuation_max` the maximum concurrent speakers for full global concurrent speaker attenuation
- `voice_servermute` whether voice chat is enabled on this server. visible from MS via bitflag
- `voicevolume` local volume of all voice playback

A Voice Options menu is added with a subset of these options, and Server Options has server mute.
2024-12-13 17:12:14 -06:00
Eidolon
1ee5547bb2 Allocate imgbuf on-demand in Picture_PatchConvert
This static var requires a 64 megabyte .bss section value which
is allocated on application startup. Depending on the particulars of the
operating system's virtual memory implementation, this may result in
dynamic page allocation for the span, or a full upfront allocation.
Either way, it doesn't need to be like this, we can just dynamically
allocate the buffer instead.

This may save up to 64MiB of runtime memory usage.
2024-12-13 10:55:22 -06:00
Alug
a362e3e23d reflect sorting order when filling polygon array
functionally the same, but keeps consistency
2024-11-27 18:40:57 +01:00
Alug
7e2fbe6217 fix "fade_end" comparison in comparePolygon for ogl batching
effectively the comparison for the "fade_end" polygon property was directly discarded and unused
2024-11-27 18:33:17 +01:00
NepDisk
a67bdb2ad0 Make i and j UINT16 to account for the fact MAXFOLLOWERS is 1024 2024-11-20 00:42:01 +00:00
FreakyMutantMan
af8f7398a0 Fixes skincolors past the 256th displaying incorrectly on character select. 2024-11-19 15:32:10 -08:00
Eidolon
6ffdeb6c44 d_net.c -> d_net.cpp 2024-11-16 22:47:33 -06:00
Eidolon
6cffe744e6 Revert "Put taglists in LevelPool memory"
This reverts commit aab0465fab.
2024-11-10 10:56:16 -06:00
Eidolon
804dab2a3f Revert "Fix savegame taglist resizing"
This reverts commit 411cb468ae.
2024-11-10 10:56:14 -06:00
Eidolon
7e74e70c20 Fix memory leak in BlitPostimgScreens due to typos
The indexed program was being compiled every frame and the wrong program
was being used for the screen configuration.
2024-11-09 20:44:40 -06:00
Eidolon
bb1eaea322 Merge branch 'fix-saveg-tagslists' into 'master'
Fix savegame taglist resizing

See merge request KartKrew/Kart!2489
2024-11-10 02:29:53 +00:00
Eidolon
411cb468ae Fix savegame taglist resizing
Fixes a crash when loading savegames because the save game code wasn't
expecting to need to use the LevelPool functions.
2024-11-09 18:16:08 -06:00
NepDisk
7842dc2d59 Expose more constants to Lua 2024-11-07 03:45:38 +00:00
NepDisk
2b5a8259f7 Fix "aizdriftstraft" typo in lua_playerlib.c 2024-11-06 18:24:33 +00:00
Alug
20d4c8510b Make FOF fades use 0-255 alpha, not 1-256 2024-11-05 21:03:33 +01:00
Alug
fed0d3626b remove subtract by one 2024-11-05 20:47:24 +01:00
NepDisk
69568cb6e1 Add names to hud_disable_options
Due to this not being here everything after position was offset by one
2024-11-04 20:58:49 +00:00
Eidolon
b711c82237 Merge branch 'sec-taglists-levelpool' into 'master'
Put seclist and taglist nodes in LevelPool memory

See merge request KartKrew/Kart!2488
2024-11-02 18:55:25 +00:00
Eidolon
aab0465fab Put taglists in LevelPool memory 2024-11-02 13:01:36 -05:00
Eidolon
b8f334a83c Put seclist nodes in LevelPool memory
Replaces the old freelist solution with the LevelPool, which
dramatically reduces the number of allocations needed for mobj and
precip sector assignment. In measurement, this cuts down the time taken
for spawning precipitation by 50%.
2024-11-02 13:01:36 -05:00
Eidolon
a816b93541 Merge branch 'netsave-mem-stuff' into 'master'
Minor & misc netsave fixes

See merge request KartKrew/Kart!2485
2024-11-02 18:01:25 +00:00
Eidolon
379dfa28fc Merge branch 'slab-allocate-mobj' into 'master'
Add level pool allocator and use it for mobj, precip, thinkers

See merge request KartKrew/Kart!2482
2024-11-02 17:30:19 +00:00
Eidolon
37f70cb0a2 Merge branch 'rhi-refactoring' into 'master'
RHI Refactors

See merge request KartKrew/Kart!2486
2024-11-02 17:29:54 +00:00
Eidolon
cdd3bad813 Add level pool allocator and use it for mobj, precip, thinkers
This should substantially reduce the number of malloc/free calls made to
create and destroy mobjs, especially during level load and net
save/load.

memory_resource standard header is not available on the OSX deployment
target we are using, so I had to write my own fixed size pool allocator.
2024-10-30 09:08:04 -05:00
Eidolon
d2b3b15213 Restore imgui rendering
Was lost when pass architecture was removed; now it should work again.
2024-10-30 09:08:04 -05:00
Eidolon
fc05db7441 rhi: Use renderpasses as a stack
This way when you pop a render pass, it will restore the previous
renderpass state if there was one. Allows for rendering code to enter
and leave the default render pass without interfering with other drawing
code.
2024-10-30 09:08:04 -05:00
Eidolon
136761cf3b rhi: Remove Pipeline, Uniform/BindingSet, add dynamic state
The pipeline abstraction mimicked Vulkan and d3d12 explicit pipeline state objects
but, like GraphicsContext, was ill-considered for the kinds of drawing
behavior SRB2 uses. Rather than push this complexity into the drawing
code, it will instead be the responsibility of the backend to manage
explicit pipeline objects if necessary.

Now, drawing code must create a Program instance, bind it, and set the
rasterizer state to do the equivalent. Uniform, sampler, and vertex
attribute bindings are significantly simpler to set up now.
2024-10-30 09:08:04 -05:00
Eidolon
4499979458 rhi: Remove RenderPass object
While this has an analog in Vulkan, it is trivial to manage vkRenderPass
on the backend side. We are already having to dynamically manage GL FBOs
for binding framebuffers for drawing in begin_render_pass, so I see
little reason to keep this object around.
2024-10-30 09:08:04 -05:00
Eidolon
bba1d56529 rhi: Remove the old Pass concept
This was already slated to be removed; the old PassManager was a failed
attempt to centralize and pipeline all graphics logic for a frame. Let's
remove it as a step towards simplifying some of this code.
2024-10-30 09:08:04 -05:00
Eidolon
dae2e8ba17 rhi: Remove GraphicsContext
I've come to the conclusion that some aspects of RHI are overengineered
to suit a future where we would theoretically support Vulkan with
minimal implementation effort. In an effort of architectural astronaut
engineering this has had the consequence of making much of the code
interacting with RHI significantly more complex.

The GraphicsContext was originally an opaque object to wrap and
contextualize operations that would eventually be inserted into a Vulkan
CommandBuffer for dispatch. In practice, for the GL backend, this does
nothing but introduce another pointer to pass around across all RHI
code, when it had already been previously accepted that the idea of
recording multiple GraphicsContexts at the same time was infeasible.

Thus, I'm choosing to excise GraphicsContext entirely. This doesn't do
much except remove passing around the context object. This is one of
many changes I would like to make that would simplify RHI-related code
and defer the complexity to the hypothetical future. Vulkan can come at
a later date, and we can solve the problems of Vulkan then. Right now, I
am actually more concerned for supporting a d3d9 renderer to shore up
that Intel 945GM laptop GPU support gap we currently have.
2024-10-30 09:08:04 -05:00