Commit graph

3866 commits

Author SHA1 Message Date
Daniel Gibson
19a119417c Fix last commit (had SDL2 and SDL3 code switched in one case)
fix #1159
2024-10-27 16:39:45 +01:00
Daniel Gibson
07ee830712 SDL3 return value fixes in gl1_sdl.c and gl3_sdl.c
and removed unused code from glimp_sdl3.c
2024-10-26 17:57:58 +02:00
Yamagi
b74d1a5247 Fix window flag handling with SDL3.
These are two problems breaking the window flags for renderers which
don't use OpenGL or enforce their own flags:

* In SDL 3 the window flags were increased from 32 bit to 64 bit. SDL
  3.1.3 introduced a new type SDL_WindowFlags for them. Use it to
  represent the window flags. This is currently a noop, becaue SDL 3
  doesn't have any flags above 32 bit yet. This might require another
  breakage of the renderer API in the future, because currently
  renderers pass a 32 bit flags thing to the client.
* `SDL_SetNumberProperty()` got a new type
  `SDL_PROP_WINDOW_CREATE_FLAGS_NUMBER` to represent the flags. It must
  be used, otherwise strange things happen.

Closes #1156.
2024-10-26 17:28:31 +02:00
Yamagi
c719a18d54
Merge pull request #1157 from BjossiAlfreds/menu-input-ext
Clipboard and in-line editing for menu input fields
2024-10-26 16:11:10 +02:00
Yamagi
b134bb1770
Merge pull request #1154 from 0lvin/sdl2_soft_fix
soft: fix texture lock
2024-10-26 16:03:16 +02:00
BjossiAlfreds
993365cc6d END key jumps between start and end of current input string 2024-10-18 11:34:22 +00:00
BjossiAlfreds
c49a703467 Reset field cursor position when it leaves focus 2024-10-18 10:56:48 +00:00
BjossiAlfreds
b26be3ff5d CTRL+l,c,x,v shortcuts for menu input fields 2024-10-16 14:02:48 +00:00
BjossiAlfreds
8d5d86cbaf Q_strisnum shared helper function 2024-10-16 13:54:38 +00:00
BjossiAlfreds
aae0524687 Left/right arrow nav in menu fields 2024-10-16 02:00:53 +00:00
Denis Pauk
14db96211b soft: fix texture lock
Regression is introduced in 39d2c7dbb4
as sdl3 has changed logic of SDL_LockTexture function call.
2024-10-07 23:07:12 +03:00
Yamagi
6408cc7099 Fix SDL3 build after merging sdl3-current into master.
One function call wasn't renamed, the missing function prevented the
build. Patch submitted by @protocultor in a comment to #1153.
2024-10-06 21:35:01 +02:00
erysdren
e8eb810c01 SDL3: Fix inconsistent name for deleting GL context 2024-10-06 10:20:00 +02:00
erysdren
39d2c7dbb4 Bump to SDL3 gitrev 8db3b47 2024-10-06 10:19:59 +02:00
erysdren
219b1b93fb Bump to SDL3 gitrev f6fc5e2 2024-10-06 10:19:59 +02:00
erysdren
2c212ae0b2 SDL3: Moved SDL_StartTextInput() to glimp_sdl3.c 2024-10-06 10:19:59 +02:00
erysdren
5ace09caac Partial fixes for SDL3 2024-10-06 10:19:55 +02:00
Yamagi
667ddafd83
Merge pull request #1152 from protocultor/gles1_addendum
Improvements for GL1/GLES1
2024-10-06 10:16:24 +02:00
Jaime Moreira
dbba5b5fd5 GL1: force vid_restart when changing stereo mode
Avoids spam to console
2024-09-29 00:07:59 -03:00
Jaime Moreira
45a84389db Removed unused parameter in 3 functions 2024-09-25 17:07:11 -03:00
Jaime Moreira
f2ea0b51b5 gl1_discardfb functionality expanded
Now also available in GL1. Includes a call to glClear at the beginning
of each frame, pointing to the same buffers that are discarded at the
end. When value is 1, operates over color, depth and stencil buffers.
When it's 2, only does depth and stencil, ignoring color. These
changes provide a performance improvement on mobile/embedded.
2024-09-24 16:33:39 -03:00
Yamagi
9278772868 Mark g_swap_speed as CVAR_ARCHIVE. 2024-09-21 09:54:35 +02:00
Jaime Moreira
e21479cbd2 Stereo 3D modes (gl1_stereo) allowed in GLES1
Availability of each mode depends on GPU support
2024-09-20 18:29:21 -03:00
Jaime Moreira
676e05ad1f Fixed GL1 stencil shadow when gl1_stereo = 3 to 5
Disabling stencil for shadowing in these stereo modes,
otherwise entities appear behind solid walls.
2024-09-20 16:56:58 -03:00
Yamagi
7b013d5009
Merge pull request #1151 from amalchuk/feature/fix-broken-links
Fix broken links in the documentation
2024-09-15 22:12:31 +02:00
Andrew Malchuk
b1f1e847ab
Fixed broken links in the documentation 2024-09-15 18:55:59 +04:00
Yamagi
5acb267630 Add a new playback mode ogg_shuffle == 4, truly random playback.
912b65ff74 changed mode `3` from random
playback to truly random playback, allowing the same track being played
several times in a row. Since some users might prefer the old behavior
move truly random playback to a new mode `4`. Add it to the menu and
finally document the `ogg_shuffle` cvar.

In addition to #1143
2024-09-08 17:00:34 +02:00
Yamagi
da15696d23 Save and restore the OGG state only of the backend is enabled.
Otherwise we might end up in situations were `OGG_SaveState()` writes
invalid values into the state struct and `OGG_ResumeState()` tries to
recover theses values into an uninitialized stb_vorbis state. This may
lead to NULL pointers in stb_vorbis and other problems.

Closes #1135.
2024-09-08 17:00:34 +02:00
Yamagi
7c88889716
Merge pull request #1150 from amalchuk/feature/keyboard-improvements
Fix Windows key bind name on non-Mac
2024-09-08 16:18:44 +02:00
Andrew Malchuk
dfc0cf059b
Removed .vscode from .gitignore 2024-09-08 13:45:55 +04:00
Yamagi
a969526d87 Switch the SDL2 sound backend to transparent audio format conversion.
Since the SDL 1.2 day the SDL sound backend relied on the sound driver
supporting the requested audio format. That workes fine for drivers
support transparent conversions into formats supported by the hardware.
But it failes with drivers which are unable to do such conversions. As
long as we hardcoded the sound driver this wasn't a problem, because all
our chouces supported transparent conversions. When we removed the
hardcoded choices and started to rely on SDLs choices especially the
wsaapi driver - which is SDLs default choice under windows - failed.
wsaapi only guarantees support for AUDIO_F32LSB (other formats may be
supported, depending on the hardware), Quake II needs AUDIO_S16SYS or
AUDIO_U8.

Solve this by switching to transparent conversions through SDL. This way
Quake II can send whatever it wants to SDL and SDL will make sure that
it is in the right format before sending it to the driver.

This isn't necessary for SDL3, SDL3 doesn't support explicit formats and
always relies on transparent conversions.

Remove hardcoded wsaapi on Windows, it's no longer necessary.

Part of #1135.
2024-09-08 10:29:36 +02:00
Yamagi
5ba7695d64
Merge pull request #1147 from protocultor/delta_time_fs
Flick Stick fixed duration to 0.1 seconds
2024-09-08 09:49:11 +02:00
Yamagi
14f819aac5
Merge pull request #1148 from 0lvin/backport
Fix memory leaks
2024-09-08 09:33:53 +02:00
Andrew Malchuk
d7845deb4c
Fix Windows key bind name on non-Mac 2024-09-07 14:25:26 +04:00
Jaime Moreira
d90dc649ec Revert "PCX_Decode warning demoted to 'dev only'"
This reverts commit 4756c44155.
2024-09-01 19:21:48 -04:00
Denis Pauk
a2536cc735 pcx: make palette marker optional 2024-08-31 13:18:00 +03:00
Jaime Moreira
b00e925d47 Refactored obtaining the renderer used
...in videomenu code. Now it allows to use switch statements, to
avoid the execution of paths not meant for certain renderers.
2024-08-30 00:48:24 -04:00
Jaime Moreira
13deb72b16 Flick Stick refactor
Removed redundant calculations
2024-08-29 15:44:34 -04:00
Denis Pauk
a7cb9431b3 client: Fix filesystem memory leaks 2024-08-28 00:45:02 +03:00
Denis Pauk
04aec20891 gl1, gl3: use GL_LIGHTMAP_FORMAT intead internal_format
value is never changed, so replace should be safe.
2024-08-27 23:47:27 +03:00
Denis Pauk
758961a848 maps: fix in load n64jam_doomshakalaka
Checks entid is bigger than maximum number of entities.

https://www.moddb.com/games/quake-2/addons/quake-2-re-release-n64-sp-map-jam
2024-08-27 23:22:51 +03:00
Jaime Moreira
f839596168 SDL3 nomenclature: "game controller" to "gamepad"
Changes are mostly visual; many elements are still referred as "controller"
in backend, to maintain parity with SDL2.
2024-08-27 13:13:24 -04:00
Jaime Moreira
15f9d35d39 Default button for 'Esc' in gamepad is now Start 2024-08-27 13:10:25 -04:00
Jaime Moreira
68973b6ae7 Flick Stick fixed duration to 0.1 seconds
Formerly, there were "6 frames" with a precalculated change factor on each frame.
This allowed to use Flick Stick exclusively on vsync 60 Hz screens only (6 *
16.6 ms = 100 ms). By using any other refresh rate, or just disabling vsync,
these 6 frames could take any time, normally much less than the intended 100 ms.
Now delta time is used to calculate the angle change on each frame displayed,
so the entire flick duration remains at 100 ms, independent of refresh rate.
2024-08-27 13:05:44 -04:00
Jaime Moreira
4756c44155 PCX_Decode warning demoted to "developer only"
"(Texture.pcx) file has possible size issues" will only appear when `developer 1`.
It might get annoying on properly working mods.
2024-08-27 13:04:00 -04:00
Yamagi
45fce1deb0
Merge pull request #1143 from apartfromtime/master
sound: True randomness
2024-08-21 21:17:46 +02:00
Yamagi
f3b0341b21
Merge pull request #1144 from apartfromtime/console-Fix-cursor-timestep
console: Fix cursor timestep
2024-08-21 21:15:45 +02:00
apartfromtime
7fa653cae1 console: Fix cursor timestep 2024-08-19 21:03:30 +10:00
apartfromtime
912b65ff74 sound: True randomness
True randomness allows producing a number twice.
2024-08-19 20:01:44 +10:00
Yamagi
6066b3c979 Another round of changes to the Github workflows.
* Build ref_gles1 only on Linux, it's of limited use under MacOS and Win.
* Fetch openal-soft from Github, the other mirror had several connection
  problems in the past.
* Always include the latest curl.dll in Windows builds. Since this isn't
  a stripped down build of curl, it's better to have it up to date.
* Make sure that we are on Ubuntu 22.04. Otherwise the binaries wouldn't
  work on newer distros when `ubuntu-latest` becomes Ubuntu 24.04.
* Fix some typos.
2024-08-18 16:55:02 +02:00