Commit graph

4422 commits

Author SHA1 Message Date
BjossiAlfreds
eb7a9d6c17 savegame: Refactoring of save compatibility checks 2026-03-20 08:26:06 +00:00
BjossiAlfreds
f9efc28346 savegame: Ensure strings in save header are null terminated 2026-03-20 08:26:05 +00:00
BjossiAlfreds
82e3f9c383 savegame: Ensure funcStr is null terminated and reduced excessive buffer size 2026-03-20 08:26:05 +00:00
BjossiAlfreds
f4add2ce56 savegame: Call fclose before gi.error calls during save reading/writing 2026-03-20 08:26:05 +00:00
BjossiAlfreds
0f912b6f7d savegame: sg_fread and sg_fwrite wrapper functions for error-checking fread and fwrite
fwrite calls were not being checked and a couple fread calls did not call fclose on read errors
2026-03-20 08:25:58 +00:00
David Carlier
3a5f8856a2
sound: use dedicated occlusion filter separate from underwater
The occlusion path was reusing the underwater lowpass filter which
has an aggressive AL_LOWPASS_GAINHF (0.25) that strips the high
frequency cues HRTF relies on for spatial positioning.

Introduce a separate occlusion filter with distance-scaled high
frequency attenuation, preserving enough HF content for accurate
3D audio.

Ref yquake2/yquake2#973
2026-03-19 06:39:51 +00:00
BjossiAlfreds
f06d0904b0 mapfixes: More fixes for cool1
Added missing spawnflags, removed unused entities/fields and added missing info_player_coop entities for return exit
2026-03-15 13:14:29 +00:00
Yamagi
cf287da5e6
Merge pull request #1297 from devnexen/fix_wav_div0
sound: add defensive check for invalid bits per sample in WAV parsing
2026-03-14 23:53:14 +01:00
David Carlier
cd9ff7bf8f
sound: add defensive check for invalid bits per sample in WAV parsing 2026-03-14 22:30:48 +00:00
BjossiAlfreds
46af6f675d savegame: Prevent indexing edicts / clients / items out of bounds
The code used the index value written in the save file without bounds checking, so an item index of -2 or 334 for example would lead to illegal memory access or undefined behavior
2026-03-12 18:55:59 +00:00
Yamagi
9e5d3eaa34
Merge pull request #1296 from devnexen/little_optims
common: cache strlen result in completion loop
2026-03-12 19:50:48 +01:00
Yamagi
b78d2a76cc
Merge pull request #1295 from BjossiAlfreds/cvar-opt
cvar: Minor fixes, optimizations and refactoring
2026-03-12 19:48:23 +01:00
BjossiAlfreds
dc9c6ff6ba cvar: Move Cvar_CheckReplacement calls out of Cvar_FindVar
This avoids a few cases of duplicate console warnings and var_name variables not being changed after Cvar_FindVar returns
2026-03-08 20:00:07 +00:00
BjossiAlfreds
a662b6af4b cvar: Replace spaces with tabs and fix code style 2026-03-08 20:00:06 +00:00
BjossiAlfreds
fdc7ecdb3b cvar: Cvar_SetVar function to avoid multiple searches of the cvar list 2026-03-08 20:00:06 +00:00
BjossiAlfreds
d124ef1748 cvar: Cvar_AddToList and Cvar_GetNew functions to avoid double-search and fixed Get validation bugs 2026-03-08 20:00:06 +00:00
BjossiAlfreds
b30226b074 cvar: Cvar_CopyString function for optimized copying 2026-03-08 20:00:06 +00:00
BjossiAlfreds
fd6925c8ce cvar: Cvar_FreeList function and more robust init/cleanup 2026-03-08 20:00:05 +00:00
BjossiAlfreds
08e7151e6f cvar: Cvar_CheckReplacement function 2026-03-08 20:00:05 +00:00
BjossiAlfreds
b4e938a739 zone: Z_BlockSize function added 2026-03-08 20:00:05 +00:00
David Carlier
0768e90cc5
common: cache strlen result in completion loop 2026-03-08 18:30:20 +00:00
Yamagi
b2ce7bf6bd
Merge pull request #1294 from protocultor/gamepad_refactor
New Gamepad code refactor
2026-03-08 18:28:06 +01:00
Yamagi
ad01fad4a9
Merge pull request #1288 from runlevel5/crosshair-color
Add crosshair color picker (issue #1255)
2026-03-08 08:58:48 +01:00
Jaime Moreira
b9fa3bc55f IN_Controller_Init() function refactor
No more #ifdef / #ifndef NO_SDL_GYRO in the middle of the function,
replaced by calls to new helper functions.
2026-03-07 17:25:53 -03:00
Jaime Moreira
124402602a Removed joy_escbutton cvar
Some char arrays of button names have been reduced
2026-03-07 17:08:43 -03:00
Jaime Moreira
3d2df1a40a ARRLEN macro used where appropriate
Some consts are actually static
2026-03-07 17:02:53 -03:00
Yamagi
07b21602fd
Merge pull request #1293 from yquake2/dependabot/github_actions/actions/upload-artifact-7
build(deps): bump actions/upload-artifact from 6 to 7
2026-03-05 20:21:12 +01:00
dependabot[bot]
9188ef2848
build(deps): bump actions/upload-artifact from 6 to 7
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 18:20:58 +00:00
Yamagi
96894bf888 Fix missmatch in number of addressbook entries.
The menu defined 9, the backend which pings server 16. Reduce the
backend to 9, because adding more entries to the menu would need
some refactoring to still fit into 320x280.

Closes #1287.
2026-03-01 18:17:09 +01:00
Yamagi
174608373f Fix lerping not workings with lasers.
Lasers don't have an `oldorigin` which breaks lerping and leads to
stuttering. Fix this by interpolating the origin.

Submitted by @BjossiAlfreds in #1286.
2026-03-01 18:17:09 +01:00
Yamagi
9a00d69546
Merge pull request #1292 from devnexen/network-getaddrinfo-error-log
network: log getaddrinfo error on Windows
2026-03-01 17:52:59 +01:00
Yamagi
5d9adb3ab1
Merge pull request #1291 from devnexen/zone-harden-tag-allocator
zone: harden the tag allocator
2026-03-01 17:52:33 +01:00
Yamagi
4cf6e04932 Work around compiler warnings complaining that const is lost.
Seen with gcc 15.2.1 on Arch Linux. This is caused by C23 which changes
`strchr()` to return a const object if a const object was passed to it.
2026-03-01 17:42:43 +01:00
David Carlier
02fd748251
zone: harden the tag allocator
Add a NULL pointer guard in Z_Free to avoid undefined behavior from
pointer arithmetic on NULL. Invalidate the magic value before free()
to help detect double-free bugs. Use calloc instead of malloc+memset
in Z_TagMalloc for potentially more efficient zeroing.
2026-03-01 10:47:54 +00:00
David Carlier
48515d49df
network: log getaddrinfo error on Windows
The Unix network code logs getaddrinfo failures via
Com_Printf and gai_strerror, but the Windows side
silently returned 0. Add the same error logging to
match the Unix behaviour.
2026-03-01 10:46:54 +00:00
Yamagi
b962f7b15e Include stdint.h to fix build under Linux. 2026-02-28 23:09:03 +01:00
BjossiAlfreds
e6dbf343cd zone: Restructuring header layout 2026-02-28 18:15:35 +00:00
BjossiAlfreds
b4f1a63d00 zone: Tag type consistency and safety checks in import API 2026-02-28 18:15:34 +00:00
BjossiAlfreds
7190dfce9c zone: Changed int to size_t 2026-02-28 18:15:34 +00:00
Yamagi
82a6c6d6c9
Merge pull request #1289 from 0lvin/static
Add cppcheck to static analysis checks
2026-02-28 16:49:12 +01:00
Denis Pauk
fea9ae11e7 cppcheck: warning fix 2026-02-26 00:29:18 +02:00
Denis Pauk
9b881cbc6b game: move spawn function list to separate file 2026-02-24 23:07:44 +02:00
Denis Pauk
fdbbf2df9e pcx: fix of quit fix
Fixes: https://github.com/yquake2/yquake2/issues/1290
2026-02-24 23:07:19 +02:00
Denis Pauk
53d5e96b2f actions: check by cppcheck 2026-02-14 22:57:12 +02:00
Denis Pauk
fdadb6e933 server: Copy level string before use.
Detected with ReRelease maps, cmd buf could be reused sometime.
2026-02-14 22:54:34 +02:00
Trung Lê
f5dfbe9078 Fix crosshair color tinting for all cursor types
Crosshair color tinting works by multiplying the texture pixel colors
by the chosen tint. This only produces the correct hue when the source
pixels are white. The standard crosshair PCX images use non-white
palette entries, causing incorrect or dim colors for dot and angle
types.

GL1/GL3: normalize crosshair pixels to the brightest palette index at
load time so the existing multiply-based tinting works correctly.

Soft: compute per-pixel luminance and apply tint at that brightness
instead of multiplying per-channel, stripping the original hue.
2026-02-13 15:52:56 +11:00
Trung Lê
dcb86dbc77 Bump API_VERSION to 8 for refexport_t struct change
DrawPicScaledCol was added to refexport_t. Old renderer .so files
compiled against API_VERSION 7 would have an ABI mismatch, potentially
leaving the new field as garbage rather than NULL. Bumping the version
ensures old renderers are cleanly rejected at load time.
2026-02-13 09:26:54 +11:00
Trung Lê
a88efe8df1 Soft renderer: use d_16to8table for color lookup in RE_Draw_PicScaledCol
Replace the O(255) FindNearestColor brute-force palette search with the
existing d_16to8table (RGB565-to-palette) lookup table, reducing
per-pixel cost to O(1). Expose d_16to8table in local.h so sw_draw.c
can access it.
2026-02-13 09:15:52 +11:00
Trung Lê
2e2a213d86 Use ARRLEN(color_values) instead of hardcoded bound in CrosshairColorFunc 2026-02-12 21:49:41 +11:00
Trung Lê
f3d1018924 GL1: simplify RDraw_PicScaledCol by removing redundant SCRAPS check
The if/else for TEXNUM_SCRAPS was only needed for GL buffer batching,
which RDraw_PicScaledCol does not use. Just call R_Bind(gl->texnum)
directly.

Suggested-by: protocultor
2026-02-12 14:42:50 +11:00