Fix some build option compile errors. Strip a small bit of redundant code.

This commit is contained in:
Shpoike 2025-01-22 05:31:22 +00:00
parent 46636fd08e
commit f35c156800
10 changed files with 22 additions and 120 deletions

View file

@ -854,8 +854,8 @@ qboolean IN_DrawWeaponWheel(int pnum)
} }
void IN_WWheelDown (void) void IN_WWheelDown (void)
{ {
#ifdef CSQC_DAT
int pnum = CL_TargettedSplit(false); int pnum = CL_TargettedSplit(false);
#ifdef CSQC_DAT
if (CSQC_ConsoleCommand(pnum, Cmd_Argv(0))) if (CSQC_ConsoleCommand(pnum, Cmd_Argv(0)))
return; return;
#endif #endif

View file

@ -3506,7 +3506,9 @@ static void M_ModelViewerDraw(int x, int y, struct menucustom_s *c, struct emenu
modelview_t *mods = c->dptr; modelview_t *mods = c->dptr;
skinfile_t *skin; skinfile_t *skin;
texnums_t *texnums; texnums_t *texnums;
#ifdef SKELETALMODELS
qboolean boneanimsonly; qboolean boneanimsonly;
#endif
model_t *animmodel = NULL; model_t *animmodel = NULL;
if (R2D_Flush) if (R2D_Flush)
@ -3730,6 +3732,7 @@ static void M_ModelViewerDraw(int x, int y, struct menucustom_s *c, struct emenu
} }
#endif #endif
#ifdef SKELETALMODELS
if (animmodel)// && Mod_GetNumBones(ent.model, false)==Mod_GetNumBones(animmodel, false)) if (animmodel)// && Mod_GetNumBones(ent.model, false)==Mod_GetNumBones(animmodel, false))
{ {
int numbones = Mod_GetNumBones(ent.model, false); int numbones = Mod_GetNumBones(ent.model, false);
@ -3740,6 +3743,7 @@ static void M_ModelViewerDraw(int x, int y, struct menucustom_s *c, struct emenu
ent.framestate.skeltype = SKEL_RELATIVE; ent.framestate.skeltype = SKEL_RELATIVE;
} }
else else
#endif
animmodel = ent.model; //not using it. sorry. warn? animmodel = ent.model; //not using it. sorry. warn?
@ -3850,6 +3854,7 @@ static void M_ModelViewerDraw(int x, int y, struct menucustom_s *c, struct emenu
} }
#endif #endif
} }
#ifdef SKELETALMODELS
boneanimsonly = false; boneanimsonly = false;
if (ent.model && ent.model->loadstate == MLS_LOADED && ent.model->type == mod_alias) if (ent.model && ent.model->loadstate == MLS_LOADED && ent.model->type == mod_alias)
{ //some models don't actually contain any mesh data, but exist as containers for skeletal animations that can be skel_built into a different model's anims. { //some models don't actually contain any mesh data, but exist as containers for skeletal animations that can be skel_built into a different model's anims.
@ -3908,6 +3913,7 @@ static void M_ModelViewerDraw(int x, int y, struct menucustom_s *c, struct emenu
} }
} }
} }
#endif
V_AddAxisEntity(&ent); V_AddAxisEntity(&ent);

View file

@ -3487,8 +3487,10 @@ static int CL_ReadServerInfo(char *msg, enum masterprotocol_e prototype, qboolea
if (!MasterInfo_ReadProtocol(info, msg)) if (!MasterInfo_ReadProtocol(info, msg))
{ //try and guess. { //try and guess.
if (0)
;
#ifdef Q2CLIENT #ifdef Q2CLIENT
if (prototype == MP_QUAKE2) else if (prototype == MP_QUAKE2)
info->special |= SS_QUAKE2; info->special |= SS_QUAKE2;
#endif #endif
#ifdef Q3CLIENT #ifdef Q3CLIENT
@ -3499,9 +3501,7 @@ static int CL_ReadServerInfo(char *msg, enum masterprotocol_e prototype, qboolea
else if (prototype == MP_NETQUAKE) else if (prototype == MP_NETQUAKE)
info->special |= SS_NETQUAKE; info->special |= SS_NETQUAKE;
#endif #endif
#if defined(Q2CLIENT) || defined(Q3CLIENT) || defined(NQPROT)
else else
#endif
info->special |= SS_QUAKEWORLD; info->special |= SS_QUAKEWORLD;
} }
if (favorite) //was specifically named, not retrieved from a master. if (favorite) //was specifically named, not retrieved from a master.

View file

@ -42,20 +42,10 @@ extern cvar_t sv_demo_write_csqc;
static pubprogfuncs_t *csqcprogs; static pubprogfuncs_t *csqcprogs;
typedef struct csqctreadstate_s {
float resumetime;
struct qcthread_s *thread;
int self;
int other;
struct csqctreadstate_s *next;
} csqctreadstate_t;
static qboolean csprogs_promiscuous; static qboolean csprogs_promiscuous;
static unsigned int csprogs_checksum; static unsigned int csprogs_checksum;
static size_t csprogs_checksize; static size_t csprogs_checksize;
static char csprogs_checkname[MAX_QPATH]; static char csprogs_checkname[MAX_QPATH];
static csqctreadstate_t *csqcthreads;
qboolean csqc_resortfrags; qboolean csqc_resortfrags;
world_t csqc_world; world_t csqc_world;
@ -5239,50 +5229,6 @@ static void QCBUILTIN PF_cl_te_particlesnow (pubprogfuncs_t *prinst, struct glob
P_RunParticleWeather(min, max, vel, howmany, colour, "snow"); P_RunParticleWeather(min, max, vel, howmany, colour, "snow");
} }
void CSQC_RunThreads(void)
{
csqctreadstate_t *state = csqcthreads, *next;
csqcthreads = NULL;
while(state)
{
next = state->next;
if (state->resumetime > cl.servertime)
{ //not time yet, reform original list.
state->next = csqcthreads;
csqcthreads = state;
}
else
{ //call it and forget it ever happened. The Sleep biltin will recreate if needed.
*csqcg.self = EDICT_TO_PROG(csqcprogs, EDICT_NUM_UB(csqcprogs, state->self));
*csqcg.other = EDICT_TO_PROG(csqcprogs, EDICT_NUM_UB(csqcprogs, state->other));
csqcprogs->RunThread(csqcprogs, state->thread);
csqcprogs->parms->memfree(state->thread);
csqcprogs->parms->memfree(state);
}
state = next;
}
}
static void QCBUILTIN PF_cs_addprogs (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{
const char *s = PR_GetStringOfs(prinst, OFS_PARM0);
int newp;
if (!s || !*s)
newp = -1;
else
{
newp = PR_LoadProgs(prinst, s);
if (newp >= 0)
PR_ProgsAdded(csqcprogs, newp, s);
}
G_FLOAT(OFS_RETURN) = newp;
}
static void QCBUILTIN PF_cs_OpenPortal (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) static void QCBUILTIN PF_cs_OpenPortal (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
int state = G_FLOAT(OFS_PARM1)!=0; int state = G_FLOAT(OFS_PARM1)!=0;
@ -7546,21 +7492,6 @@ static void VARGS CSQC_Abort (const char *format, ...) //an error occured.
Host_EndGame("csqc error"); Host_EndGame("csqc error");
} }
static void CSQC_ForgetThreads(void)
{
csqctreadstate_t *state = csqcthreads, *next;
csqcthreads = NULL;
while(state)
{
next = state->next;
csqcprogs->parms->memfree(state->thread);
csqcprogs->parms->memfree(state);
state = next;
}
}
static void PDECL CSQC_EntSpawn (struct edict_s *e, int loading) static void PDECL CSQC_EntSpawn (struct edict_s *e, int loading)
{ {
struct csqcedict_s *ent = (csqcedict_t*)e; struct csqcedict_s *ent = (csqcedict_t*)e;
@ -7720,7 +7651,6 @@ void CSQC_Shutdown(void)
Material_RegisterLoader(&csqc_world, NULL); Material_RegisterLoader(&csqc_world, NULL);
key_dest_absolutemouse &= ~kdm_game; key_dest_absolutemouse &= ~kdm_game;
CSQC_ForgetThreads();
PR_ReleaseFonts(kdm_game); PR_ReleaseFonts(kdm_game);
PR_Common_Shutdown(csqcprogs, false); PR_Common_Shutdown(csqcprogs, false);
World_Destroy(&csqc_world); World_Destroy(&csqc_world);
@ -8885,8 +8815,6 @@ qboolean CSQC_DrawView(void)
if (cl.worldmodel) if (cl.worldmodel)
Surf_LessenStains(); Surf_LessenStains();
CSQC_RunThreads(); //wake up any qc threads
#ifdef HAVE_LEGACY #ifdef HAVE_LEGACY
if (csqcg.autocvar_vid_conwidth) if (csqcg.autocvar_vid_conwidth)
*csqcg.autocvar_vid_conwidth = vid.width; *csqcg.autocvar_vid_conwidth = vid.width;

View file

@ -1936,7 +1936,7 @@ TRACE(("dbg: R_ApplyRenderer: efrags\n"));
void R_ReloadRenderer_f (void) void R_ReloadRenderer_f (void)
{ {
#if !defined(CLIENTONLY) && (defined(Q2BSPS) || defined(Q3BSPS)) #if !defined(CLIENTONLY)
void *portalblob = NULL; void *portalblob = NULL;
size_t portalsize = 0; size_t portalsize = 0;
#endif #endif
@ -2200,7 +2200,7 @@ static int QDECL R_SortRenderers(const void *av, const void *bv)
void R_RestartRenderer (rendererstate_t *newr) void R_RestartRenderer (rendererstate_t *newr)
{ {
#if !defined(CLIENTONLY) && (defined(Q2BSPS) || defined(Q3BSPS)) #if !defined(CLIENTONLY)
void *portalblob = NULL; void *portalblob = NULL;
size_t portalsize = 0; size_t portalsize = 0;
#endif #endif
@ -2766,7 +2766,6 @@ int SignbitsForPlane (mplane_t *out)
} }
return bits; return bits;
} }
#if 1
void R_SetFrustum (float projmat[16], float viewmat[16]) void R_SetFrustum (float projmat[16], float viewmat[16])
{ {
float scale; float scale;
@ -2873,47 +2872,6 @@ void R_SetFrustum (float projmat[16], float viewmat[16])
p->signbits = SignbitsForPlane (p); p->signbits = SignbitsForPlane (p);
} }
} }
#else
void R_SetFrustum (void)
{
int i;
if (r_novis.ival & 4)
return;
/* removed - assumes fov_x == fov_y
if (r_refdef.fov_x == 90)
{
// front side is visible
VectorAdd (vpn, vright, frustum[0].normal);
VectorSubtract (vpn, vright, frustum[1].normal);
VectorAdd (vpn, vup, frustum[2].normal);
VectorSubtract (vpn, vup, frustum[3].normal);
}
else
*/
{
// rotate VPN right by FOV_X/2 degrees
RotatePointAroundVector( frustum[0].normal, vup, vpn, -(90-r_refdef.fov_x / 2 ) );
// rotate VPN left by FOV_X/2 degrees
RotatePointAroundVector( frustum[1].normal, vup, vpn, 90-r_refdef.fov_x / 2 );
// rotate VPN up by FOV_X/2 degrees
RotatePointAroundVector( frustum[2].normal, vright, vpn, 90-r_refdef.fov_y / 2 );
// rotate VPN down by FOV_X/2 degrees
RotatePointAroundVector( frustum[3].normal, vright, vpn, -( 90 - r_refdef.fov_y / 2 ) );
}
for (i=0 ; i<4 ; i++)
{
frustum[i].type = PLANE_ANYZ;
frustum[i].dist = DotProduct (r_origin, frustum[i].normal);
frustum[i].signbits = SignbitsForPlane (&frustum[i]);
}
}
#endif

View file

@ -3725,12 +3725,15 @@ void Sbar_DeathmatchOverlay (playerview_t *pv, int start)
cl.last_ping_request = realtime; cl.last_ping_request = realtime;
CL_SendClientCommand(true, "pings"); CL_SendClientCommand(true, "pings");
} }
#ifdef NQPROT
else if (cls.protocol == CP_NETQUAKE && !cls.qex) else if (cls.protocol == CP_NETQUAKE && !cls.qex)
{ {
cl.last_ping_request = realtime; cl.last_ping_request = realtime;
CL_SendClientCommand(true, "ping"); CL_SendClientCommand(true, "ping");
} }
#endif
} }
#ifdef NQPROT
if (cls.protocol == CP_NETQUAKE && !cls.qex) if (cls.protocol == CP_NETQUAKE && !cls.qex)
{ {
if (cl.nqplayernamechanged && cl.nqplayernamechanged < realtime) if (cl.nqplayernamechanged && cl.nqplayernamechanged < realtime)
@ -3740,6 +3743,7 @@ void Sbar_DeathmatchOverlay (playerview_t *pv, int start)
CL_SendClientCommand(true, "status"); CL_SendClientCommand(true, "status");
} }
} }
#endif
if (start) if (start)
y = start; y = start;

View file

@ -1850,6 +1850,7 @@ void BIH_Build (model_t *mod, struct bihleaf_s *leafs, size_t numleafs)
mod->funcs.PointContents = BIH_PointContents; mod->funcs.PointContents = BIH_PointContents;
mod->funcs.NativeContents = BIH_NativeContents; mod->funcs.NativeContents = BIH_NativeContents;
} }
#ifdef SKELETALMODELS
void BIH_BuildAlias (model_t *mod, galiasinfo_t *meshes) void BIH_BuildAlias (model_t *mod, galiasinfo_t *meshes)
{ {
size_t numleafs, i; size_t numleafs, i;
@ -1883,3 +1884,4 @@ void BIH_BuildAlias (model_t *mod, galiasinfo_t *meshes)
} }
BIH_Build(mod, leafs, leaf-leafs); BIH_Build(mod, leafs, leaf-leafs);
} }
#endif

View file

@ -44,6 +44,7 @@
#define MULTITHREAD //misc basic multithreading - dsound, downloads, basic stuff that's unlikely to have race conditions. #define MULTITHREAD //misc basic multithreading - dsound, downloads, basic stuff that's unlikely to have race conditions.
#define LOADERTHREAD //worker threads for loading misc stuff. falls back on main thread if not supported. #define LOADERTHREAD //worker threads for loading misc stuff. falls back on main thread if not supported.
#define AVAIL_DINPUT #define AVAIL_DINPUT
#define MAX_CLIENTS 32 //32 for vanilla qw. max 255.
//#define SIDEVIEWS 4 //enable secondary/reverse views. //#define SIDEVIEWS 4 //enable secondary/reverse views.
//#define MAX_SPLITS 4u //#define MAX_SPLITS 4u
#define VERTEXINDEXBYTES 2 //16bit indexes work everywhere but may break some file types, 32bit indexes are optional in gles<=2 and d3d<=9 and take more memory/copying but allow for bigger batches/models. Plugins need to be compiled the same way so this is no longer set per-renderer. #define VERTEXINDEXBYTES 2 //16bit indexes work everywhere but may break some file types, 32bit indexes are optional in gles<=2 and d3d<=9 and take more memory/copying but allow for bigger batches/models. Plugins need to be compiled the same way so this is no longer set per-renderer.

View file

@ -276,6 +276,7 @@ void QCBUILTIN PF_setattachment(pubprogfuncs_t *prinst, struct globalvars_s *pr_
#define PF_frameduration PF_Fixme #define PF_frameduration PF_Fixme
#define PF_modelframecount PF_Fixme #define PF_modelframecount PF_Fixme
#define PF_frameforname PF_Fixme #define PF_frameforname PF_Fixme
#define PF_frameforaction PF_Fixme
#define PF_skel_delete PF_Fixme #define PF_skel_delete PF_Fixme
#define PF_skel_copybones PF_Fixme #define PF_skel_copybones PF_Fixme
#define PF_skel_premul_bones PF_Fixme #define PF_skel_premul_bones PF_Fixme

View file

@ -1181,7 +1181,9 @@ enum {
========================================================== ==========================================================
*/ */
#ifndef MAX_CLIENTS
#define MAX_CLIENTS 255 /*max 255, min 32*/ #define MAX_CLIENTS 255 /*max 255, min 32*/
#endif
#define QWMAX_CLIENTS 32 /*QW's standard max. clients might have issues above this value*/ #define QWMAX_CLIENTS 32 /*QW's standard max. clients might have issues above this value*/
#define NQMAX_CLIENTS 16 /*NQ's standard max. clients might have issues above this value*/ #define NQMAX_CLIENTS 16 /*NQ's standard max. clients might have issues above this value*/