Commit Graph

213 Commits

Author SHA1 Message Date
Denis Pauk f040b01e00 Merge remote-tracking branch 'yquake2/master' 2024-09-09 00:33:38 +03: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
Denis Pauk e188358e2b Merge remote-tracking branch 'yquake2/master' 2024-09-08 12:58:00 +03: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
Jaime Moreira 15f9d35d39 Default button for 'Esc' in gamepad is now Start 2024-08-27 13:10:25 -04:00
Denis Pauk 247acb32fd Merge remote-tracking branch 'yquake2/master' 2024-08-12 18:46:04 +03:00
Yamagi 53b738f77b
Merge pull request #1128 from protocultor/ref_gles1
OpenGL ES 1.0 renderer
2024-08-12 09:02:40 +02:00
Denis Pauk 7d3545abd7 Merge remote-tracking branch 'yquake2/master' 2024-08-09 01:35:40 +03: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
Yamagi b3c47df0c8 Don't overwrite SDLs audio driver selection.
Hardcoding default driver for some of the supported platform is a
remnant of SDL 1.2 and hasn't been necessary since SDL 2.0 a long
time ago. In fact it has a high properbility to break things, SDL
could easily end up with a non working driver.

When `s_sdldriver` is set to the newly introduced value `auto` the
driver is selected by SDL. In all other cases the string is the
driver name which SDL will be forced to.

This doesn't fix existing configs. Since the OpenAL sound backend has
been the default for nearly 15 years and we haven't received bug reports
for some other problem with the SDL sound backend in the past, I'm half
sure that there are next to users out there. These can reset the cvar
by hand if necessary.

Closes #1132.
2024-08-07 12:04:54 +02:00
Jaime Moreira 26f578212a Deleted unused variable in R_RegenAllLightmaps()
Static arrays there have their dimensions swapped, they make more sense now.
Added important detail in gl1_lightmapcopies doc.
Also added doc for gl_polyblend, just because of its "popularity".
2024-07-28 12:14:17 -04:00
Jaime Moreira b72c465214 GLES1 renderer: lightmap copies
Available in both GL1 and GLES1. Keep multiple copies of "the same"
lightmap on video memory; they are actually different, because they're
used in different frames. This is a workaround for the usage of
glTexSubImage2D() for dynamic lighting, since modifying textures used
recently causes slowdown in embedded/mobile devices.
Controlled by gl1_lightmapcopies cvar; default in GL1 is `0`, while
in GLES1 is `1`.
2024-07-27 23:22:41 -04:00
Jaime Moreira 0596d23e4c GLES1 renderer: discard framebuffer
Available only on GLES1, allows to use a "performance hint" to the
GPU to discard the contents of depth and stencil buffers after each
frame. Some hardware might want to reuse them, but Quake 2 doesn't
work that way.
Controlled by gl1_discardfb cvar, default `1`.
2024-07-27 23:18:06 -04:00
Jaime Moreira 03227f1ed6 OpenGL ES 1.0 refresher (GLES1 for friends)
Variant of GL1, meant for embedded/mobile devices only.
Build it with "make with_gles1".
For Windows, you'll need MSYS2 and a decent ANGLE implementation
(probably not worth the trouble).
Building with CMake only works in Linux, so it has been commented out.
2024-07-27 23:15:12 -04:00
Denis Pauk 6c16fe1e8e Merge remote-tracking branch 'yquake2/master' 2024-07-21 18:07:00 +03:00
Yamagi eef7db91d8
Merge pull request #1124 from protocultor/gl1_buffer
Grouped draw calls for improved performance with GL1
2024-07-20 09:24:23 +02:00
Denis Pauk 1e0aa094cb Merge remote-tracking branch 'yquake2/master' 2024-07-15 23:37:05 +03:00
Yamagi 4b9b8e14a4 Switch g_quick_weap to 1 by default.
It's a nice to have convenience feature that most players will never
notice. Die hard traditionalists can switch it off.
2024-07-15 21:42:15 +02:00
Jaime Moreira 15a1ebdd74 Deleted gl1_biglightmaps
glTexSubImage2D() calls are very slow, and are even slower when
the texture is big. Dynamic lighting changes are small compared
to the huge 512x512 size of the lightmap this option provided,
so it was detrimental to performance.
Original logic remains underneath if there's a need of a comeback.
2024-07-15 12:45:15 -04:00
Denis Pauk 96b8707825 Merge remote-tracking branch 'yquake2/master' 2024-06-30 23:06:16 +03:00
Yamagi 1a1b32961b Refactor the download filter.
The first try didn't take into account that an evil server could
override the filter list by sending a stuff command. Fix this by
hardcoding the filters for .dll, .dylib and .so. Make sure that the
filters are always applied, either when the download is requested
through the `download` command or because game data is missing.

This is just a poor mans fix, trying to rule out an obvious way to
inject code into the client.
2024-06-24 11:56:11 +02:00
Denis Pauk d15bb81e58 Merge remote-tracking branch 'yquake2/master' 2024-06-22 23:57:29 +03:00
Yamagi 5e6a73dc3f Include downloads into the security considerations. 2024-06-22 16:57:30 +02:00
Yamagi 468f90ad48 Implement a simple download filter.
`cl_nodownload_list` is a whitespace seperated list of strings, files
containing one of these strings in their name are never downloaded. Set
to `.dll .dylib .so` by default to prevent downloading libraries which
can be injected into client.

Closes #1114.
2024-06-22 16:56:42 +02:00
Yamagi d5c7845271 Fix formating of the cvarlist. 2024-06-22 16:50:54 +02:00
Denis Pauk 330b1352fb Add macos test build on release tag 2024-06-22 17:35:25 +03:00
Denis Pauk 1775874418 Merge remote-tracking branch 'yquake2/master' 2024-06-08 22:47:14 +03:00
Jaime Moreira c4271848df gl1_multitexture doc update 2024-06-04 16:21:10 -04:00
Jaime Moreira 24b03b61f8 Gyro tightening
A practical way to avoid a noisy gyro signal, or shaky hands.
Unlike a deadzone, inputs below the threshold are "squeezed towards
zero", so they are not completely ignored. Source:
http://gyrowiki.jibbsmart.com/blog:good-gyro-controls-part-1:the-gyro-is-a-mouse#toc9
2024-06-04 15:48:42 -04:00
Denis Pauk faf86b72c5 GL1 big lightmaps and scrap
https://github.com/yquake2/yquake2/pull/1108

Merge remote-tracking branch 'yquake2/master'
2024-05-27 08:41:53 +03:00
Denis Pauk e00ab4ffde game: fix save of quake monsters 2024-05-15 00:43:42 +03:00
Denis Pauk 33a3aed03e GL1 multitexture
Merge changes from https://github.com/yquake2/yquake2/pull/1103
Merge remote-tracking branch 'yquake2/master'
2024-05-12 12:55:53 +03:00
Jaime Moreira 0f307cc9c1 GL1 scrap/atlas configurable size
Controlled by gl1_biglightmaps cvar, works like new lightmaps.
Max size is 384x384; a bigger size is not justified.
Added a transparent border so colors from one picture don't bleed
into the next.
2024-05-11 18:20:13 -04:00
Jaime Moreira 81fd2c1027 Increased lightmap size in GL1
Controlled by new cvar, gl1_biglightmaps.
Size is now up to 512x512, for a max quantity of 8 lightmaps.
Should reduce rebinding of them, and reduce the number of calls
to glTexSubImage2D(), although it may increase data transfer on
each call.
2024-05-11 18:18:28 -04:00
Jaime Moreira 86528d7812 GL1 multitexture, first version
Unlike the old, buggy one, this implementation follows the
texture chain, just like the standard execution path. It also
avoids doing the lightmap chains, since it has already done it
in the second TMU; there's no duplicated work for lightmaps.
No errors appear in the lava on the "boss1" map either.
It's still slow when having an overdraw of dynamic lights.
Further work is needed.
2024-04-23 12:25:38 -04:00
Denis Pauk 02b8e85c01 opengl renders: support of gl_version_override cvar
Provides way to check render with lower officialy
reported OpenGL version.

Same as:
* MESA_GL_VERSION_OVERRIDE=4.6
* MESA_GLSL_VERSION_OVERRIDE=460
2024-04-13 13:25:34 +03:00
Denis Pauk 4bd19bf982 Merge remote-tracking branch 'yquake2/master' 2024-04-07 18:12:09 +03:00
Yamagi 8a9e31ab86 Clearify `vid_gamma` in the GL1 renderer. 2024-04-07 11:01:45 +02:00
Yamagi e61d9444c9 Bump default renderer to GL3...
...and alter the render finding and fallback sequences to include GLES3
as the first fallback. This should have been done years ago, when GL3
became the clear better option above GL1.
2024-04-07 11:01:45 +02:00
Yamagi af82cfe978 Switch the default for `vid_highdpiaware` to 1 when build against SDL3.
With SDL3 the high dpi support is in much better shape than with SDL2.
And for Wayland the experience on high dpi displays is generally better
when the application is high dpi aware.
2024-04-07 11:01:45 +02:00
Denis Pauk 80a4282ec7 Merge remote-tracking branch 'yquake2/master' 2024-04-01 23:22:25 +03:00
BjossiAlfreds c134d0127d Added cvar cl_laseralpha and documentation in cvarlist 2024-03-31 10:45:31 +00:00
Denis Pauk d1e23ae740 maps: initial flags surface flags convert
Convert map flags before load for load maps files from games with
different flags meaning.
2024-03-30 19:12:06 +02:00
Denis Pauk c385789a87 Merge remote-tracking branch 'yquake2/master' 2024-03-19 22:12:01 +02:00
Feels Duck Man 086084b507 Added documentation for 'cl_showspeed' in 040_cvarlist.md 2024-03-18 21:21:59 -05:00
Denis Pauk 6973181a21 client: bump protocol and game version / unstable compatibility
Config string numbers is different to original Quake 2 code,
code is not compatible with any version of official protocols or
game code. And game code should be recompiled for use with engine.
2024-02-29 00:05:21 +02:00
Denis Pauk a3d450ff64 client: Add gametype variable
`gametype` variable could be used for show menu for different
embeded mod type. Remaster has all ctf/rogue/xatrix maps in baseq2
directory and menu could not detected by game variable anymore.
2024-02-23 00:33:24 +02:00
Denis Pauk b21391954d game: fix shambler effect 2024-02-11 23:51:33 +02:00
Denis Pauk 47bacf9a52 game: Add support some of quake 1 monsters
Shambler is left without chenges and fixes for now.
2024-02-11 19:10:57 +02:00
Denis Pauk 9b3b4b44df Merge remote-tracking branch 'yquake2/master' 2024-01-07 14:51:26 +02:00