Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
7b90c82
Add command to set/inspect custom fog.
Oct 22, 2024
2dbf94e
Don't add heatbeam particles if paused.
Oct 22, 2024
9e99f37
Interpolate BFG lightramp in extended mode.
Oct 22, 2024
c0d5845
Improve RandomDir() uniformity.
Oct 22, 2024
4712833
Improve tracker shell effect.
Oct 22, 2024
700de33
Avoid NaNs in heightfog shader.
Oct 24, 2024
4b4bb94
Reduce indentation.
Oct 24, 2024
e4c84f1
Add re-release bloom effect support.
Oct 25, 2024
a3e8809
Delete program if it fails to compile/link.
Oct 29, 2024
1aca530
Clean up uniforms binding code.
Oct 29, 2024
efc53a1
Fix uniforms block size mismatch.
Oct 29, 2024
05aa7ec
Add GL_BindBufferBase() wrapper.
Oct 30, 2024
e647529
Remove unused argument.
Oct 30, 2024
cb7e155
Make glStateBits_t 64-bit.
Oct 31, 2024
c96366a
Print shader source with ‘developer 3’.
Oct 31, 2024
0229402
Add color shell to weapon model too.
Nov 3, 2024
2fe584c
Improve visibility of typewritten strings.
Nov 3, 2024
78fe88d
Update mgu6m2 checksum.
Nov 4, 2024
981a308
Don't OR contents in CM_ClipEntity().
Nov 4, 2024
93d383b
Fix BFG laser sparks color.
Nov 5, 2024
eba1fe4
Fix PSX skies.
Nov 5, 2024
e1d4a99
Draw PSX flare as default flare.
Nov 5, 2024
9c29f6e
Better smoothing of short steps.
Nov 5, 2024
c1416b8
Re-add debug graph support.
Nov 6, 2024
3dbc629
Update libcurl to 8.11.0.
Nov 6, 2024
745cd74
Turn ‘PF_cprintf to a non-client’ error into warning.
Nov 7, 2024
289fb23
Don't put shadows on alpha surfaces.
Nov 8, 2024
5813712
Use separate cvar for skybox texture filter.
Nov 8, 2024
02c1c73
Remove unneeded image type bit.
Nov 10, 2024
4a6841b
Reset flare visibility if entity disappeared.
Nov 10, 2024
66f0777
Scale flares up with distance for occlusion.
Nov 12, 2024
28163e3
Fix BFG lightramp lerp with variable FPS.
Nov 13, 2024
b57e6e3
Add N64 electric sparks effect.
Nov 13, 2024
53f6611
Only print 24-bit PCX warning in developer mode.
Nov 17, 2024
e4bbc21
Fix broken maps that set skyrotate but not skyaxis.
Nov 18, 2024
58f44eb
Only call GL_InitFramebuffers() if using shaders.
Nov 18, 2024
cf26bcf
Allow arbitrary length image extensions.
Nov 18, 2024
34d5b4d
Only print game API warnings in developer mode.
Nov 18, 2024
da602cf
Mask vwep index with 255 in extended mode.
Nov 18, 2024
ade82fd
Fix misrendered window icon
carlossless Nov 18, 2024
0b790d7
Add missing parens for Com_DWPrintf
carlossless Nov 19, 2024
40ec20d
Add clipmask parameter to new pmove trace function.
Nov 20, 2024
cd3f69e
Update comments.
Nov 21, 2024
2872f78
Merge brush contents into solid leaf contents.
Nov 22, 2024
d7069a5
Remove ill-defined ‘map_allsolid_bug’ cvar.
Nov 22, 2024
6cff2a6
Reduce size of mnode_t/mleaf_t.
Nov 22, 2024
ca6b7ff
Print missing models with ‘developer 2’.
Nov 22, 2024
424ff2d
Build some CI targets in release mode.
Nov 22, 2024
18b7a54
Cast zlib malloc size to size_t before multiply.
Nov 23, 2024
0f4f368
Support scaling sprites too.
Nov 23, 2024
65c853d
Interpolate blend in extended mode.
Nov 24, 2024
4d2ca1d
Remove unused defines.
Nov 27, 2024
6e6c068
Add BSPX header presence flag.
Nov 29, 2024
4be1433
Ignore SURF_NODRAW bit in vanilla maps.
Nov 27, 2024
2695c6c
Allow lightmapped SURF_FLOWING faces.
Nov 27, 2024
b3ba488
Show surface flags for ‘cl_surface’ macro.
Nov 27, 2024
945ee65
Remove fake sky faces if using cubemaps.
Nov 28, 2024
b55563e
Calc vertex buffer size after removing sky faces.
Nov 29, 2024
a1b3d49
Consider more flags for N64 detection.
Nov 29, 2024
c219c25
Align code for readability.
Dec 10, 2024
70277e7
Ignore prediction misses of 1/8 units or less.
Dec 10, 2024
2c0b899
Fix race condition when retrieving thread return value.
Dec 18, 2024
d07f8c9
Rename CHAR_WIDTH to CONCHAR_WIDTH.
Dec 21, 2024
318bf10
Better protect against multiple nextserver commands.
Dec 23, 2024
29a72c5
Change debug level comparisons to >= for readability.
Dec 23, 2024
58f200f
Add shadow alpha fading with distance.
Dec 24, 2024
5834404
Count culled shadows separately.
Dec 25, 2024
73e40ad
Const-ify server state pointers in client_t.
Dec 26, 2024
d9613b7
Assert input field buffer is nul-terminated.
Dec 26, 2024
5bbb02a
Update libcurl to 8.11.1.
Dec 27, 2024
2b846d0
Update libjpeg-turbo to 3.1.0.
Dec 27, 2024
f7df6d5
More strictly check stat index bounds.
Dec 28, 2024
f059908
Tweak BSP feature detection logic a bit.
Dec 30, 2024
8b4750c
Skip cinematic demos if running coop server.
Dec 30, 2024
affbf1a
Skip cinematic existence check if running dedicated server.
Dec 30, 2024
a5b8927
Move CRC to common code, expose CRC_Block().
Jan 1, 2025
5b2d9f2
Support hashed format for entity string overrides.
Jan 1, 2025
b0a4496
Resolved merge conflicts
darkshade9 Jan 15, 2025
4839a2b
Fixed a few warnings and one error
darkshade9 Jan 15, 2025
0176ff6
Merge branch 'sync/aq2-tng' of github.com:actionquake/q2pro into skul…
darkshade9 Dec 18, 2025
e812b0a
Fixed CON_WIDTH error
darkshade9 Dec 18, 2025
1fcd607
Merge branch 'skullernet-011525' of github.com:actionquake/q2pro into…
darkshade9 Dec 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions doc/client.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,9 @@ gl_bilerp_pics::
- 1 — enabled for large pictures that don't fit into the scrap
- 2 — enabled for all pictures, including the scrap texture itself

gl_bilerp_skies::
Enables bilinear filtering of skybox textures. Default value is 1 (enabled).

gl_upscale_pcx::
Enables upscaling of PCX images using HQ2x and HQ4x filters. This improves
rendering quality when screen scaling is used. Default value is 0.
Expand Down Expand Up @@ -727,6 +730,18 @@ gl_fog::
Enable re-release fog effect. Only effective when using GLSL backend.
Default value is 1 (enabled).

gl_bloom::
Enable re-release bloom effect. Only effective when using GLSL backend.
Default value is 0 (disabled). Higher values specify number of blurring
filter iterations (typical value is 1).

gl_bloom_sigma::
Specifies strength parameter of gaussian blur filter used for the bloom
effect. Default value is 4.

NOTE: Bloom only works with glowmaps. Enabling it with non-remastered content
(or glowmaps disabled) is a waste of resources.

gl_flarespeed::
Specifies flare fading effect speed. Default value is 8. Set this to 0
to disable fading.
Expand Down Expand Up @@ -764,6 +779,12 @@ gl_dotshading::
truly 3D-ish by simulating diffuse lighting from a fake light source.
Default value is 1 (enabled).

gl_shadows::
Enables drawing stencil shadows underneath 3D models. Default value is 0.
- 0 — disabled
- 1 — enabled, constant alpha
- 2 — enabled, alpha fade with distance

gl_saturation::
Enables grayscaling of world textures. 1 keeps original colors, 0 converts
textures to grayscale format (this may save some video memory and speed up
Expand Down
6 changes: 4 additions & 2 deletions inc/client/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "shared/ghud.h"
#endif

#define CHAR_WIDTH 8
#define CHAR_HEIGHT 8
#define CONCHAR_WIDTH 8
#define CONCHAR_HEIGHT 8

// only begin attenuating sound volumes when outside the FULLVOLUME range
#define SOUND_FULLVOLUME 80
Expand All @@ -38,6 +38,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,

void CL_PreInit(void);

void SCR_DebugGraph(float value, int color);

#if USE_CLIENT

#define MAX_LOCAL_SERVERS 16
Expand Down
23 changes: 12 additions & 11 deletions inc/common/bsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ typedef struct {
#define SURF_COLOR_MASK (SURF_TRANS_MASK | SURF_WARP)

#define SURF_NOLM_MASK_REMASTER (SURF_SKY | SURF_NODRAW)
#define SURF_NOLM_MASK_DEFAULT (SURF_COLOR_MASK | SURF_FLOWING | SURF_NOLM_MASK_REMASTER)
#define SURF_NOLM_MASK_DEFAULT (SURF_COLOR_MASK | SURF_NOLM_MASK_REMASTER)

#define DSURF_PLANEBACK 1

Expand Down Expand Up @@ -115,21 +115,21 @@ typedef struct mface_s {
typedef struct mnode_s {
/* ======> */
cplane_t *plane; // never NULL to differentiate from leafs
struct mnode_s *parent;

#if USE_REF
vec3_t mins;
vec3_t maxs;

unsigned visframe;
#endif
struct mnode_s *parent;
/* <====== */

struct mnode_s *children[2];

#if USE_REF
int numfaces;
mface_t *firstface;
#endif

struct mnode_s *children[2];
} mnode_t;

typedef struct {
Expand All @@ -147,16 +147,16 @@ typedef struct {
typedef struct {
/* ======> */
cplane_t *plane; // always NULL to differentiate from nodes
struct mnode_s *parent;

#if USE_REF
vec3_t mins;
vec3_t maxs;

unsigned visframe;
#endif
struct mnode_s *parent;
/* <====== */

int contents;
int contents[2]; // 0 - original, 1 - merged
int cluster;
int area;
int numleafbrushes;
Expand Down Expand Up @@ -572,9 +572,9 @@ typedef struct {
//#if USE_REF
lightgrid_t lightgrid;

qboolean lm_decoupled;
//#endif
qboolean extended;
bool lm_decoupled;
bool extended; // QBSP extended format
bool has_bspx; // has BSPX header

char name[1];
} bsp_t;
Expand All @@ -593,6 +593,7 @@ typedef struct {
cplane_t plane;
float s, t;
float fraction;
vec3_t pos;
} lightpoint_t;

void BSP_LightPoint(lightpoint_t *point, const vec3_t start, const vec3_t end, const mnode_t *headnode, int nolm_mask);
Expand Down
15 changes: 9 additions & 6 deletions inc/common/cmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void CM_Init(void);

void CM_FreeMap(cm_t *cm);
int CM_LoadMap(cm_t *cm, const char *name);
void CM_LoadOverrides(cm_t *cm, char *server, size_t server_size);
void CM_LoadOverride(cm_t *cm, char *server, size_t server_size);

const mnode_t *CM_NodeNum(const cm_t *cm, int number);
const mleaf_t *CM_LeafNum(const cm_t *cm, int number);
Expand All @@ -60,25 +60,28 @@ const mleaf_t *CM_LeafNum(const cm_t *cm, int number);
const mnode_t *CM_HeadnodeForBox(const vec3_t mins, const vec3_t maxs);

// returns an ORed contents mask
static inline int CM_PointContents(const vec3_t p, const mnode_t *headnode)
static inline int CM_PointContents(const vec3_t p, const mnode_t *headnode, bool extended)
{
if (!headnode)
return 0; // map not loaded
return BSP_PointLeaf(headnode, p)->contents;
return BSP_PointLeaf(headnode, p)->contents[extended];
}

int CM_TransformedPointContents(const vec3_t p, const mnode_t *headnode,
const vec3_t origin, const vec3_t angles);
const vec3_t origin, const vec3_t angles,
bool extended);

void CM_BoxTrace(trace_t *trace,
const vec3_t start, const vec3_t end,
const vec3_t mins, const vec3_t maxs,
const mnode_t *headnode, int brushmask);
const mnode_t *headnode, int brushmask,
bool extended);
void CM_TransformedBoxTrace(trace_t *trace,
const vec3_t start, const vec3_t end,
const vec3_t mins, const vec3_t maxs,
const mnode_t *headnode, int brushmask,
const vec3_t origin, const vec3_t angles);
const vec3_t origin, const vec3_t angles,
bool extended);
void CM_ClipEntity(trace_t *dst, const trace_t *src, struct edict_s *ent);

// call with topnode set to the headnode, returns with topnode
Expand Down
14 changes: 10 additions & 4 deletions inc/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,23 +133,29 @@ void G_InitializeExtensions(void);
#endif

#if USE_DEBUG
#define COM_DEVELOPER (developer->integer)
#define Com_DPrintf(...) \
do { if (developer && developer->integer > 0) \
do { if (developer && developer->integer >= 1) \
Com_LPrintf(PRINT_DEVELOPER, __VA_ARGS__); } while (0)
#define Com_DDPrintf(...) \
do { if (developer && developer->integer > 1) \
do { if (developer && developer->integer >= 2) \
Com_LPrintf(PRINT_DEVELOPER, __VA_ARGS__); } while (0)
#define Com_DDDPrintf(...) \
do { if (developer && developer->integer > 2) \
do { if (developer && developer->integer >= 3) \
Com_LPrintf(PRINT_DEVELOPER, __VA_ARGS__); } while (0)
#define Com_DDDDPrintf(...) \
do { if (developer && developer->integer > 3) \
do { if (developer && developer->integer >= 4) \
Com_LPrintf(PRINT_DEVELOPER, __VA_ARGS__); } while (0)
#define Com_DWPrintf(...) \
do { if (developer && developer->integer >= 1) \
Com_LPrintf(PRINT_WARNING, __VA_ARGS__); } while (0)
#else
#define COM_DEVELOPER 0
#define Com_DPrintf(...) ((void)0)
#define Com_DDPrintf(...) ((void)0)
#define Com_DDDPrintf(...) ((void)0)
#define Com_DDDDPrintf(...) ((void)0)
#define Com_DWPrintf(...) ((void)0)
#endif

#if USE_TESTS
Expand Down
25 changes: 25 additions & 0 deletions inc/common/crc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
Copyright (C) 1997-2001 Id Software, Inc.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#pragma once

uint16_t CRC_Block(const byte *start, size_t count);

#if USE_CLIENT
byte COM_BlockSequenceCRCByte(const byte *base, size_t length, int sequence);
#endif
7 changes: 5 additions & 2 deletions inc/refresh/refresh.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define POWERSUIT_SCALE 4.0f
#define WEAPONSHELL_SCALE 0.5f

#define RF_TRACKER BIT_ULL(32)

#define RF_SHELL_MASK (RF_SHELL_RED | RF_SHELL_GREEN | RF_SHELL_BLUE | \
RF_SHELL_DOUBLE | RF_SHELL_HALF_DAM | RF_SHELL_LITE_GREEN)

Expand Down Expand Up @@ -60,9 +62,9 @@ typedef struct entity_s {
float alpha; // ignore if RF_TRANSLUCENT isn't set
color_t rgba;

qhandle_t skin; // NULL for inline skin
int flags;
uint64_t flags;

qhandle_t skin; // NULL for inline skin
float scale;
} entity_t;

Expand All @@ -76,6 +78,7 @@ typedef struct {
typedef struct {
vec3_t origin;
int color; // -1 => use rgba
float scale;
float alpha;
color_t rgba;
} particle_t;
Expand Down
2 changes: 1 addition & 1 deletion inc/shared/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,

#define GAME_API_VERSION_OLD 3 // game uses gclient_old_t
#define GAME_API_VERSION_AQTION 4 // game uses gclient_t with AQtion extension (aliased to gclient_old_t)
#define GAME_API_VERSION_NEW 3301 // game uses gclient_new_t
#define GAME_API_VERSION_NEW 3302 // game uses gclient_new_t

#if USE_NEW_GAME_API
#define GAME_API_VERSION GAME_API_VERSION_NEW
Expand Down
4 changes: 3 additions & 1 deletion inc/shared/shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -1203,11 +1203,12 @@ typedef struct {
vec3_t mins, maxs; // bounding box size

struct edict_s *groundentity;
cplane_t groundplane;
int watertype;
int waterlevel;

// callbacks to test the world
trace_t (* q_gameabi trace)(const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end);
trace_t (* q_gameabi trace)(const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int contentmask);
int (*pointcontents)(const vec3_t point);
} pmove_new_t;
#endif
Expand Down Expand Up @@ -1454,6 +1455,7 @@ enum {
SPLASH_SLIME,
SPLASH_LAVA,
SPLASH_BLOOD,
SPLASH_ELECTRIC_N64, // KEX
};

// sound channels
Expand Down
27 changes: 18 additions & 9 deletions inc/system/pthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,39 @@ typedef struct {
void *(*func)(void *);
void *arg, *ret;
HANDLE handle;
} pthread_t;
} *pthread_t;

static unsigned __stdcall thread_func(void *arg)
{
pthread_t *t = arg;
pthread_t t = arg;
t->ret = t->func(t->arg);
return 0;
}

static inline int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
void *(*start_routine)(void *), void *arg)
{
thread->func = start_routine;
thread->arg = arg;
thread->handle = (HANDLE)_beginthreadex(NULL, 0, thread_func, thread, 0, NULL);
return thread->handle ? 0 : EAGAIN;
pthread_t t = calloc(1, sizeof(*t));
if (!t)
return EAGAIN;
t->func = start_routine;
t->arg = arg;
t->handle = (HANDLE)_beginthreadex(NULL, 0, thread_func, t, 0, NULL);
if (!t->handle) {
free(t);
return EAGAIN;
}
*thread = t;
return 0;
}

static inline int pthread_join(pthread_t thread, void **retval)
{
int ret = WaitForSingleObject(thread.handle, INFINITE);
CloseHandle(thread.handle);
int ret = WaitForSingleObject(thread->handle, INFINITE);
CloseHandle(thread->handle);
if (retval)
*retval = thread.ret;
*retval = thread->ret;
free(thread);
return ret ? EINVAL : 0;
}

Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ common_src = [
'src/common/cmd.c',
'src/common/cmodel.c',
'src/common/common.c',
'src/common/crc.c',
'src/common/cvar.c',
'src/common/error.c',
'src/common/field.c',
Expand All @@ -37,7 +38,6 @@ common_src = [
client_src = [
'src/client/ascii.c',
'src/client/console.c',
'src/client/crc.c',
'src/client/demo.c',
'src/client/download.c',
'src/client/effects.c',
Expand Down
6 changes: 3 additions & 3 deletions src/client/ascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ static void TH_DrawLayoutString(char *dst, const char *s)
width = Q_atoi(token);
token = COM_Parse(&s);
value = Q_atoi(token);
if (value < 0 || value >= MAX_STATS) {
if (value < 0 || value >= cl.max_stats) {
Com_Error(ERR_DROP, "%s: invalid stat index for num: %i", __func__, value);
}
value = cl.frame.ps.stats[value];
Expand All @@ -244,7 +244,7 @@ static void TH_DrawLayoutString(char *dst, const char *s)
if (!strcmp(token, "stat_string")) {
token = COM_Parse(&s);
index = Q_atoi(token);
if (index < 0 || index >= MAX_STATS) {
if (index < 0 || index >= cl.max_stats) {
Com_Error(ERR_DROP, "%s: invalid string index for stat_string: %i", __func__, index);
}
index = cl.frame.ps.stats[index];
Expand Down Expand Up @@ -273,7 +273,7 @@ static void TH_DrawLayoutString(char *dst, const char *s)
if (!strcmp(token, "if")) {
token = COM_Parse(&s);
value = Q_atoi(token);
if (value < 0 || value >= MAX_STATS) {
if (value < 0 || value >= cl.max_stats) {
Com_Error(ERR_DROP, "%s: invalid stat index for if: %i", __func__, value);
}
value = cl.frame.ps.stats[value];
Expand Down
Loading
Loading