Commit graph

3835 commits

Author SHA1 Message Date
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
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
Yamagi
e2d8572839
Merge pull request #1140 from BjossiAlfreds/spawntemp-leak-fix
Fixed spawntemp data leaking into mid-level spawned entities
2024-08-18 16:01:19 +02:00
Yamagi
288b5c2c79
Merge pull request #1141 from atsb/gl4_sliders_video_menu
GL4: Enable sliders for overbrights, colours and intensity
2024-08-18 15:53:45 +02:00
Yamagi
730d5281fd
Merge pull request #1142 from devnexen/fix_warning_hunt_target
AI, HuntTarget fix runtime warning.
2024-08-18 15:37:14 +02:00
David Carlier
d7dd4e40a4
AI, HuntTarget fix runtime warning.
`Conditional jump or move depends on unitialised value(s)...HuntTarget
(g_ai.c:423)...`
2024-08-17 15:55:58 +01:00
atsb
21d5d010b5 GL4: Enable sliders for overbrights, colours and intensity
This will match the vk and gl3 menu sliders for their respective video modes.
2024-08-17 09:31:51 +02:00
BjossiAlfreds
e33d675757 Fixed spawntemp data leaking into mid-level spawned entities 2024-08-12 16:32:45 +00:00
Yamagi
a26c496038 Enable ref_gles1 in CI builds. 2024-08-12 18:21:22 +02:00
Yamagi
679c2d5509 Also trigger the CI workflows for PRs when new commits are added. 2024-08-12 15:43:40 +02:00
Yamagi
8cb26f6f8e Update the LICENSE file.
* Add GLAD, used by the GL1 and GL3 renderers.
* Add zlib, because our unzip module is taken from zlib.
2024-08-12 09:20:21 +02:00
Yamagi
53b738f77b
Merge pull request #1128 from protocultor/ref_gles1
OpenGL ES 1.0 renderer
2024-08-12 09:02:40 +02:00
Yamagi
82b6ce322b Update the README to reality.
* Mention some more new features added in the last years.
* Make clear that only FreeBSD, Linux and Windows have official support.
  Everything else is community supported.
* Link to the official addons and yquake2remaster.
* Give some hints to bug reporters and contributors.
* Link to CI builds.
* Avoid relative links so that personal forks link back to the main
  projects. If forks want to link to their own ressources, they can
  edit the file.
2024-08-12 08:54:03 +02:00
Yamagi
18f7541138
Merge pull request #1134 from BjossiAlfreds/con-ext
Console clipboard support and input nav
2024-08-11 18:51:11 +02:00
Yamagi
f23fb932df
Merge pull request #1130 from 0lvin/backport
Backport changes from remaster repository
2024-08-11 18:47:41 +02:00
BjossiAlfreds
98d33fad06 Moved input line indicator ] out of line buffer 2024-08-11 12:55:35 +00:00
Denis Pauk
dab57b12ed menu: add const and use NULL as 0 for pointers 2024-08-11 15:40:33 +03:00
Denis Pauk
f6e8aeab38 pcx: show developer warning for uncommon pcx files
https://github.com/yquake2/yquake2/pull/1130#issuecomment-2259254531
2024-08-11 15:40:33 +03:00
Denis Pauk
9e303a8044 cin: remove SCR_LoadPCX 2024-08-11 15:40:33 +03:00
Denis Pauk
7f894f1d6f filesystem: make name parameter const 2024-08-11 15:40:33 +03:00
Denis Pauk
b40976220c menu: support players models inside pak
Code ignores files in pak only in case when such file exists in
filesystem.
2024-08-11 15:40:33 +03:00
Denis Pauk
0293e946ca filesytem: sort files in paks and use binary search 2024-08-11 15:40:33 +03:00
Denis Pauk
8520285a10 renders: support 24bit pcx images
Based on ffmpeg code and checked with
https://samples.ffmpeg.org/image-samples/pcx/
2024-08-11 15:40:33 +03:00
Denis Pauk
f688ea599f cin: support 24bit pcx images 2024-08-11 15:40:33 +03:00
Denis Pauk
87c0029b2b client: play arbitrary CDTRACK ogg file
https://github.com/yquake2/yquake2remaster/issues/18
2024-08-11 15:40:33 +03:00
Denis Pauk
005dfa0ed5 collision: load ent file without has as backward compatibility
https://github.com/yquake2/yquake2/pull/1130#issuecomment-2256461447
2024-08-11 15:40:33 +03:00
Denis Pauk
c92664c01d collision: check string entity hash before load
https://github.com/yquake2/yquake2remaster/issues/4#issuecomment-1741814349
2024-08-11 15:40:33 +03:00
Yamagi
180050b9a3 Add Github Workflows to create test build for Linux, MacOS and Win32.
This is should make testing for normal endusers easier by providing
prebuild binaries for them. It also serves as a simple CI by compiling
every commit and Pull Request for Linux, MacOS and Win32. And it saves
time, because (Windows) test build must no longer created by hand.

* Windows is build for Win32 only. We won't add a Win64, because there's
  no point in having a 64 bit Windows release and it would break most
  existing mods. Savegames are also not compatible between 32 and 64 but
  builds.

* MacOS is build to get some test exposure and to publish up to date
  binaries to users. This doesn't mean that MacOS is now officially
  supported. It stays community supported. The binaries are untested,
  because I have no Mac. PRs are welcome. ;)

* Linux is build with ubuntu-latest, which is the last LTS release. The
  binaries should work on most other distros.

Windows includes all required dependencies. As a difference to release
builds the curl.dll is taken from upstream and not a cut down custom
build. MacOS and Linux do not ship the dependencies, users should
install them through Brew or their distro.

Github strips file permission when zipping the assets. A work around
would be to create a tar archive and zip that, but that is ugly. I
opted against it, users must mark the binaries executable by hand.

These workflows trigger at each push to the master master branch and at
each new or edited pull request.

Special features like SDL3 are not supported at this time.
2024-08-11 13:03:12 +02:00
Yamagi
4b24e16a64
Merge pull request #1126 from devnexen/late_fade_data
client sound fade_data is only really used later.
2024-08-11 09:08:35 +02:00
Jaime Moreira
011ea4a1b4 Removed inclusion of OpenGL ES 1.0 header
We're using a glad-generated loader, we don't need it.
Speaking about glad: deleted unused GL extensions in the loader.
2024-08-11 00:09:40 -04:00
Yamagi
c2d5b849e5 Bump version number to 8.42pre. 2024-08-08 18:56:25 +02:00
Yamagi
141bf6e7dd Bump version number to 8.41. 2024-08-08 18:55:54 +02:00
Yamagi
8cc3361730 Hardcode the SDL audio driver (again) to directsound under Windows.
Windows defaults to `wassapi`, which is a sensible choice. But WASAPI
only guarantees 32 bit float samples, anything else only works if the
driver or something supports it and YQ2 requires 16 bit samples. That
can be worked around by having SDL recode the audio, but I don't want
such a invasive change right before a release.

Another part of #1132.
2024-08-08 18:43:03 +02:00