Commit graph

2247 commits

Author SHA1 Message Date
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
Denis Pauk
8d5da27bc3 Merge remote-tracking branch 'yquake2/master' 2024-08-18 22:35:38 +03:00
Denis Pauk
6d1a911a86 vk: use 32 command buffers in queue
Workaround for:
 Validation Error: [ VUID-vkAcquireNextImageKHR-semaphore-01779 ] Object 0: handle = 0x90000000009, name = Semaphore: image available #0, type = VK_OBJECT_TYPE_SEMAPHORE; | MessageID = 0x5717e75b | vkAcquireNextImageKHR():  Semaphore must not have any pending operations. The Vulkan spec states: If semaphore is not VK_NULL_HANDLE it must not have any uncompleted signal or wait operations pending (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-01779) (validation)
2024-08-18 15:44:55 +03:00
atsb
9ad9cb8682 GL4: Gamma correction using sRGB
cb2c346521
2024-08-17 23:51:47 +03:00
atsb
8b9a4ab8e4 SDL3: Changes for latest master
82e397ae92
2024-08-17 23:41:24 +03:00
atsb
d56dc492c9 A little optimisation
Using a more modern opengl code to make this part a little more efficient on modern cards to bind the buffers.  We are simply binding and unbinding the buffer when it is full, on modern cards this is fine and perfectly efficient enough, same goes for CPU's.

29595b02f8
2024-08-17 23:35:32 +03: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
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
c0fe05fc03 Merge remote-tracking branch 'yquake2/master' 2024-08-12 00:05:34 +03:00
Denis Pauk
1b86a84270 sync SCR_LoadImageWithPalette usage 2024-08-11 23:39:52 +03: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
Denis Pauk
a38c2b5cee Merge remote-tracking branch 'yquake2/master' 2024-08-11 18:21:40 +03:00
Denis Pauk
52a6de3b1e vk: combine DrawVkFlowingPoly and DrawVkPoly 2024-08-11 18:15:35 +03: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
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
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
Denis Pauk
7d3545abd7 Merge remote-tracking branch 'yquake2/master' 2024-08-09 01:35:40 +03:00
Denis Pauk
1a02a6423b vk: use single draw in Vk_RenderLightmappedPoly 2024-08-09 01:17:21 +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
Denis Pauk
a60ec01de9 vk: get rid of QVk_GetTriangleFanIbo 2024-08-08 00:51:23 +03:00
Denis Pauk
1382b02a3c vk: use GenFanIndexes directly in DrawVkPoly 2024-08-08 00:29:02 +03: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
BjossiAlfreds
a18ea4b11d CTRL actions work in pre-game console window 2024-08-06 23:48:37 +00:00
Denis Pauk
32d2a465d4 vk: use vkCmdDrawIndexed in EmitWaterPolys 2024-08-07 00:03:06 +03:00
Denis Pauk
dca42e0a04 vk: use vkCmdDrawIndexed in R_DrawSkyBox 2024-08-06 23:06:02 +03:00
Denis Pauk
ea069e4174 vk: use GenFanIndexes in R_RenderDlight 2024-08-06 00:18:17 +03:00
Denis Pauk
4ebe9a74c0 vk: single call render NullModel 2024-08-04 19:14:47 +03:00
Denis Pauk
409b5bcd20 vk: reuse index buffer for model shadow 2024-08-04 16:37:46 +03:00
Denis Pauk
7ab6341e5b vk: remove drawInfo usage in vk_mesh 2024-08-04 16:02:25 +03:00
Denis Pauk
138a51c476 vk: single call for all shadow mesh in alias model 2024-08-04 15:19:24 +03:00
Denis Pauk
a7dc338e5c vk: single call for all meshes in alias model 2024-08-04 13:35:13 +03:00
Denis Pauk
c43f8f1ce3 vk: use single index buffer for alias mesh 2024-08-04 00:48:54 +03:00
Jaime Moreira
bbdaadb104 Removed link to desktop OpenGL library for gles1
Done for all platforms, CMakeLists included. Unneeded with glad.
Renderer fallback logic now includes gles1, just before soft:
custom -> gl3 -> gles3 -> gl1 -> gles1 -> soft.
2024-08-03 12:39:23 -04:00
protocultor
f41cc545c6
Merge branch 'yquake2:master' into ref_gles1 2024-08-03 10:15:04 -04:00
Denis Pauk
cd16e9884d vk: rework fan index buffer cache 2024-08-03 13:48:56 +03:00
Denis Pauk
d9a240a935 vk: pregenerate index buffer in Vk_DrawAlias 2024-08-03 00:19:46 +03:00
Denis Pauk
06167fc711 vk: share buffers and pipeline select for whole mesh
Move gen Strip/Fan index to separate functions.
2024-08-02 13:52:39 +03:00
BjossiAlfreds
d11ba119bc CTRL+x and c for cut/copy to clipboard 2024-08-02 00:42:40 +00:00
BjossiAlfreds
ced8be673e CTRL+letter actions in console + cursor can be inside edit line 2024-08-01 22:04:25 +00:00
Denis Pauk
a0745ba023 Use SURF_TRANSPARENT instead SURF_TRANS33 | SURF_TRANS66 2024-07-31 22:48:53 +03:00
Denis Pauk
ea7f219832 Merge remote-tracking branch 'yquake2/master' 2024-07-31 22:42:18 +03:00
Jaime Moreira
1df86ae16d lightmapchain cleared of surfaces added twice 2024-07-31 12:13:32 -04:00
Denis Pauk
8b6ae7cc89 vk: share ubo in Vk_DrawAlias 2024-07-31 18:12:10 +03:00
Denis Pauk
1b62173355 pcx: show developer warning for uncommon pcx files 2024-07-31 11:16:36 +03:00
Denis Pauk
7ee871dc76 cin: add lmp image format support 2024-07-31 00:12:53 +03:00
Denis Pauk
f1d8387d81 rename s|bitesPerPixel|bitsPerPixel|g 2024-07-30 08:49:58 +03:00
Denis Pauk
0a774a4f75 models: add support of MDR
* https://github.com/ioquake/ioq3/blob/main/md4-readme.txt
* https://github.com/UberGames/MD3View
2024-07-29 13:31:12 +03: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
Jaime Moreira
94c4bf2df7 GL1 unified draw calls, 7
Changed "buffer" functions (vertex, single/mtex, color) to macros.
Macros eliminate the function call overhead, resulting in faster
execution times. Depending of the hardware, there might be a
performance increase of almost 10%.
This forced the buffer to be exposed as global.
Not worth doing this for 2D elements though.
2024-07-27 23:08:46 -04:00
Jaime Moreira
826f4816f6 There's no such thing as "gl1_colorlight"
"Invented" in 575ea06b9, only existed in video menu.
Resurrect this when it actually works.
2024-07-27 23:05:59 -04:00
David Carlier
ae827dbd86
client sound fade_data is only really used later. 2024-07-22 21:44:06 +01:00
Denis Pauk
6c16fe1e8e Merge remote-tracking branch 'yquake2/master' 2024-07-21 18:07:00 +03:00
Yamagi
528ffe6a6d Add missing R_ApplyGLBuffer() to actually render the player menu.
This fixes part of the player setup menu missing after the GL1 grouped
drawcalls branch was merged.

Submitted by @protocultor in
https://github.com/yquake2/yquake2/pull/1124#issuecomment-2241272507
2024-07-21 09:24:49 +02:00
Denis Pauk
7258f240ce Merge commit 'df81a8b7' 2024-07-21 00:23:27 +03:00
Yamagi
85ca97192d
Merge pull request #1125 from apartfromtime/menu-stack
Menu: minor code refactor
2024-07-20 09:31:54 +02:00
apartfromtime
df81a8b7b8 menu: active menu layer
Replace function pointers with active menu layer.
2024-07-20 11:57:21 +10:00
apartfromtime
2bafa22cfc menu: menu framework function pointers
Add function pointers draw and key event to menu framework.
Setup function pointers for menu frames.
Pass menu framework as parameter to M_PushMenu().
2024-07-20 10:21:22 +10:00
Denis Pauk
ed286f39e5 images: pcx pcx_width could be smaller that bytes_by_line
Some tools could round up bytes_by_line from pcx_width.
Just ignore such cases.
2024-07-16 23:50:41 +03: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
Jaime Moreira
24b546ba54 GL1 unified draw calls, episode vi
Buffered shadows.
2024-07-15 12:33:19 -04:00
Jaime Moreira
55dfaa2e3b GL1 unified draw calls, 05
Buffered 'alias' models. Logic from R_DrawAliasModel() and
R_DrawAliasFrameLerp() was moved to R_ApplyGLBuffer().
2024-07-15 11:20:26 -04:00
Jaime Moreira
e8b2e36bd8 GL1 unified draw calls, chapter iv
Buffered flashblend effects.
2024-07-15 10:18:46 -04:00
Jaime Moreira
749e70b988 GL1 unified draw calls, part 3
Batching / buffered procedure, applied to multitexture surfaces.
This solves the issue with gl1_overbrightbits, when jumping
between 0 and 2-4.
2024-07-15 09:05:21 -04:00
Jaime Moreira
4461128255 GL1 unified draw calls, cont.
Batching procedure from previous commit, applied this time to GLPoly
/ single texture surfaces; alpha and liquid included.
2024-07-15 08:23:43 -04:00
Jaime Moreira
50aebd2de4 GL1 unified draw calls, init
Implemented a batching procedure, to try to group meshes in a buffer
and use a final GL call to draw them all in one step, instead of the
many GL draw calls existing today.
For now, only 2D textures are included, especifically console text
("conchars"), scrap and tiles. It's not worth doing this for
individual 2D elements (e.g. crosshair).
2024-07-15 06:56:02 -04:00
Denis Pauk
1a9733bd75 images: replace generated palette with first image one 2024-07-15 11:53:42 +03:00
Denis Pauk
4e61cbccc2 images: more strict check of pcx
checked with https://samples.ffmpeg.org/image-samples/pcx/
2024-07-15 04:47:39 +03:00
Jaime Moreira
4503333b3a GL1: lighting for brushes on the entity list...
...is being "preprocessed" before regenerating lightmaps, so there
are no additional changes to the lightmaps when drawing those brushes.
2024-07-14 20:20:27 -04:00
Jaime Moreira
1bae1e359f GL1: removed many fruitless glTexParameteri calls
They were in this form:
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG/MIN_FILTER,GL_LINEAR)
Only appeared at startup, but we didn't need so many of them.
2024-07-14 19:31:00 -04:00
Denis Pauk
3ba0f35636 images: pcx make buffer const 2024-07-15 00:44:15 +03:00
Denis Pauk
2e32da65bd images: pcx add support 2/4 bits in single plane 2024-07-15 00:23:20 +03:00
Denis Pauk
d8f754f003 images: pcx single bit per plane
based on https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/pcx.c
2024-07-14 16:37:38 +03:00
Denis Pauk
5d5e01e1e1 images: allocate pcx palette only for 8bit 2024-07-14 15:36:36 +03:00
Denis Pauk
84e461e07b images: support 24 bit pcx images 2024-07-11 23:37:15 +03:00
Denis Pauk
66da110472 image: move pcx RLE to separate function 2024-07-11 23:34:45 +03:00
Denis Pauk
1efc45612c soft: scale down wall if texture is prescalled 2024-07-11 23:34:45 +03:00
Denis Pauk
e08490d3de renders: simplify LoadImage_Ext 2024-07-11 23:34:45 +03:00
Denis Pauk
0390db7aec images: move wal decode to vid/images 2024-07-11 23:34:45 +03:00
Denis Pauk
6de0e06c4a images: move m8 decode to vid/images 2024-07-11 23:34:45 +03:00
Denis Pauk
8e4c329351 images: show file name in error message 2024-07-11 23:34:45 +03:00
Denis Pauk
829b1a014e renders: simplify swl/pcx load code 2024-07-11 23:34:45 +03:00
Denis Pauk
dec5897052 images: Use only pcx manufacturer and version as ident 2024-07-11 23:34:45 +03:00
Denis Pauk
cfebe51ec9 Merge remote-tracking branch 'yquake2/master' 2024-07-11 23:33:04 +03:00
David Carlier
2b4598d536
consistenly cast dynamic loading from generic pointer to fn pointer signature. 2024-07-06 18:40:13 +01:00
Denis Pauk
3db882c6c8 renders: little bit revert pvx load code
Use additional checks from previous renders/files/pcx load code.
2024-07-06 18:52:01 +03:00
Denis Pauk
ac2a50cb4a soft: scale model texture s,t values
ref_gl renders use 0.0..1.0 float texture coordinates in gl commands
and skin ratio/resolution could be any.
ref_soft render uses absolute coordinates as result textures with
different to expected size are applied incorrectly.

Fix will not add support of scalled retextured skins, just fix case
when ratio is incorrect after scale down such or place a incorrect
pcx skin to the model directory.
2024-07-06 16:48:20 +03:00
Denis Pauk
79c71c7a68 soft: get rid unused R_PolysetUpdateTables 2024-07-06 16:41:52 +03:00