mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-02-21 11:10:51 +00:00
Hopefully improves lighting on players, they won't look so garishly ugly any more.
Also added powerup shells. Could do with some glsl, or a texture or something. Defaults to off. git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3781 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
3517a2f960
commit
528b27b719
18 changed files with 170 additions and 89 deletions
|
@ -1333,14 +1333,14 @@ void V_AddAxisEntity(entity_t *in)
|
|||
|
||||
*ent = *in;
|
||||
}
|
||||
void V_AddEntity(entity_t *in)
|
||||
entity_t *V_AddEntity(entity_t *in)
|
||||
{
|
||||
entity_t *ent;
|
||||
|
||||
if (cl_numvisedicts == MAX_VISEDICTS)
|
||||
{
|
||||
Con_Printf("Visedict list is full!\n");
|
||||
return; // object list is full
|
||||
return NULL; // object list is full
|
||||
}
|
||||
ent = &cl_visedicts[cl_numvisedicts];
|
||||
cl_numvisedicts++;
|
||||
|
@ -1351,6 +1351,8 @@ void V_AddEntity(entity_t *in)
|
|||
AngleVectors(ent->angles, ent->axis[0], ent->axis[1], ent->axis[2]);
|
||||
VectorInverse(ent->axis[1]);
|
||||
ent->angles[0]*=-1;
|
||||
|
||||
return ent;
|
||||
}
|
||||
|
||||
void VQ2_AddLerpEntity(entity_t *in) //a convienience function
|
||||
|
@ -1386,6 +1388,63 @@ int V_AddLight (int entsource, vec3_t org, float quant, float r, float g, float
|
|||
return CL_NewDlightRGB (entsource, org, quant, -0.1, r, g, b) - cl_dlights;
|
||||
}
|
||||
|
||||
void CLQ1_AddPowerupShell(entity_t *ent, qboolean viewweap, unsigned int effects)
|
||||
{
|
||||
entity_t *shell;
|
||||
if (!(effects & (EF_BLUE | EF_RED)) || !v_powerupshell.value || !ent)
|
||||
return;
|
||||
|
||||
if (cl_numvisedicts == MAX_VISEDICTS)
|
||||
return; // object list is full
|
||||
shell = &cl_visedicts[cl_numvisedicts++];
|
||||
|
||||
*shell = *ent;
|
||||
|
||||
/*view weapons are much closer to the screen, the scales don't work too well, so use a different shader with a smaller expansion*/
|
||||
if (viewweap)
|
||||
{
|
||||
shell->forcedshader = R_RegisterShader("powerups/shellweapon",
|
||||
"{\n"
|
||||
"program defaultpowerupshell\n"
|
||||
"sort additive\n"
|
||||
"deformVertexes wave 100 sin 0.5 0 0 0\n"
|
||||
"noshadows\n"
|
||||
"surfaceparm nodlight\n"
|
||||
"{\n"
|
||||
"map $whitetexture\n"
|
||||
"rgbgen entity\n"
|
||||
"alphagen entity\n"
|
||||
"blendfunc src_alpha one\n"
|
||||
"}\n"
|
||||
"}\n"
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
shell->forcedshader = R_RegisterShader("powerups/shell",
|
||||
"{\n"
|
||||
"program defaultpowerupshell\n"
|
||||
"sort additive\n"
|
||||
"deformVertexes wave 100 sin 3 0 0 0\n"
|
||||
"noshadows\n"
|
||||
"surfaceparm nodlight\n"
|
||||
"{\n"
|
||||
"map $whitetexture\n"
|
||||
"rgbgen entity\n"
|
||||
"alphagen entity\n"
|
||||
"blendfunc src_alpha one\n"
|
||||
"}\n"
|
||||
"}\n"
|
||||
);
|
||||
}
|
||||
shell->shaderRGBAf[0] *= (effects & EF_RED)?1:0;
|
||||
shell->shaderRGBAf[1] *= 0;//(effects & EF_GREEN)?1:0;
|
||||
shell->shaderRGBAf[2] *= (effects & EF_BLUE)?1:0;
|
||||
shell->shaderRGBAf[3] *= v_powerupshell.value;
|
||||
/*let the shader do all the work*/
|
||||
shell->flags &= ~Q2RF_TRANSLUCENT|Q2RF_ADDITIVE;
|
||||
}
|
||||
|
||||
static void CL_LerpNetFrameState(int fsanim, framestate_t *fs, lerpents_t *le)
|
||||
{
|
||||
fs->g[fsanim].frame[0] = le->newframe;
|
||||
|
@ -1462,6 +1521,9 @@ void CL_LinkStaticEntities(void *pvs)
|
|||
// there needs to be a cleaner method for this
|
||||
P_EmitEffect(ent->origin, clmodel->particleeffect, &cl_static_entities[i].emit);
|
||||
}
|
||||
|
||||
// FIXME: no effects on static ents
|
||||
// CLQ1_AddPowerupShell(ent, false, stat->effects);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1976,7 +2038,7 @@ void CL_LinkPacketEntities (void)
|
|||
AngleVectors(angles, ent->axis[0], ent->axis[1], ent->axis[2]);
|
||||
VectorInverse(ent->axis[1]);
|
||||
|
||||
if (ent->keynum <= MAX_CLIENTS)
|
||||
if (ent->keynum <= cl.allocated_client_slots)
|
||||
{
|
||||
if (!cl.nolocalplayer[0])
|
||||
ent->keynum += MAX_EDICTS;
|
||||
|
@ -1987,6 +2049,8 @@ void CL_LinkPacketEntities (void)
|
|||
CL_RotateAroundTag(ent, state->number, state->tagentity, state->tagindex);
|
||||
}
|
||||
|
||||
CLQ1_AddPowerupShell(ent, false, state->effects);
|
||||
|
||||
// add automatic particle trails
|
||||
if (!model || (!(model->flags&~EF_ROTATE) && model->particletrail<0 && model->particleeffect<0))
|
||||
continue;
|
||||
|
@ -2917,6 +2981,8 @@ void CL_LinkPlayers (void)
|
|||
else if (state->command.impulse)
|
||||
CL_AddVWeapModel (ent, cl.model_precache_vwep[state->command.impulse]);
|
||||
|
||||
CLQ1_AddPowerupShell(ent, false, state->effects);
|
||||
|
||||
if (r_torch.ival)
|
||||
{
|
||||
dlight_t *dl;
|
||||
|
@ -2935,6 +3001,8 @@ void CL_LinkViewModel(void)
|
|||
{
|
||||
entity_t ent;
|
||||
|
||||
unsigned int plnum;
|
||||
player_state_t *plstate;
|
||||
static struct model_s *oldmodel[MAX_SPLITS];
|
||||
static float lerptime[MAX_SPLITS];
|
||||
static float frameduration[MAX_SPLITS];
|
||||
|
@ -2968,12 +3036,6 @@ void CL_LinkViewModel(void)
|
|||
if (cl.stats[r_refdef.currentplayernum][STAT_HEALTH] <= 0)
|
||||
return;
|
||||
|
||||
memset(&ent, 0, sizeof(ent));
|
||||
|
||||
ent.model = cl.viewent[r_refdef.currentplayernum].model;
|
||||
if (!ent.model)
|
||||
return;
|
||||
|
||||
if (r_drawviewmodel.value > 0 && r_drawviewmodel.value < 1)
|
||||
alpha = r_drawviewmodel.value;
|
||||
else
|
||||
|
@ -2984,6 +3046,15 @@ void CL_LinkViewModel(void)
|
|||
&& r_drawviewmodelinvis.value < 1)
|
||||
alpha *= r_drawviewmodelinvis.value;
|
||||
|
||||
if (alpha <= 0)
|
||||
return;
|
||||
|
||||
memset(&ent, 0, sizeof(ent));
|
||||
|
||||
ent.model = cl.viewent[r_refdef.currentplayernum].model;
|
||||
if (!ent.model)
|
||||
return;
|
||||
|
||||
#ifdef PEXT_SCALE
|
||||
ent.scale = 1;
|
||||
#endif
|
||||
|
@ -3000,6 +3071,10 @@ void CL_LinkViewModel(void)
|
|||
ent.shaderRGBAf[1] = 1;
|
||||
ent.shaderRGBAf[2] = 1;
|
||||
ent.shaderRGBAf[3] = alpha;
|
||||
if (alpha != 1)
|
||||
{
|
||||
ent.flags |= Q2RF_TRANSLUCENT;
|
||||
}
|
||||
|
||||
#ifdef HLCLIENT
|
||||
if (!CLHL_AnimateViewEntity(&ent))
|
||||
|
@ -3032,47 +3107,16 @@ void CL_LinkViewModel(void)
|
|||
ent.framestate.g[FS_REG].lerpfrac = bound(0, ent.framestate.g[FS_REG].lerpfrac, 1);
|
||||
}
|
||||
|
||||
ent.flags = Q2RF_WEAPONMODEL|Q2RF_DEPTHHACK|RF_NOSHADOW;
|
||||
ent.flags |= Q2RF_WEAPONMODEL|Q2RF_DEPTHHACK|RF_NOSHADOW;
|
||||
|
||||
V_AddEntity(&ent);
|
||||
plnum = -1;
|
||||
if (cl.spectator)
|
||||
plnum = Cam_TrackNum(r_refdef.currentplayernum);
|
||||
if (plnum == -1)
|
||||
plnum = cl.playernum[r_refdef.currentplayernum];
|
||||
plstate = &cl.frames[parsecountmod].playerstate[plnum];
|
||||
|
||||
if (!v_powerupshell.ival)
|
||||
return;
|
||||
|
||||
if (cl.stats[r_refdef.currentplayernum][STAT_ITEMS] & IT_QUAD)
|
||||
{
|
||||
if (v_powerupshell.ival == 2)
|
||||
{
|
||||
ent.forcedshader = R_RegisterCustom("powerups/quadWeapon", Shader_DefaultSkinShell, NULL);
|
||||
V_AddEntity(&ent);
|
||||
}
|
||||
else
|
||||
ent.flags |= Q2RF_SHELL_BLUE;
|
||||
}
|
||||
if (cl.stats[r_refdef.currentplayernum][STAT_ITEMS] & IT_INVULNERABILITY)
|
||||
{
|
||||
if (v_powerupshell.ival == 2)
|
||||
{
|
||||
ent.forcedshader = R_RegisterCustom("powerups/regen", Shader_DefaultSkinShell, NULL);
|
||||
ent.fatness = -2.5;
|
||||
V_AddEntity(&ent);
|
||||
}
|
||||
else
|
||||
ent.flags |= Q2RF_SHELL_RED;
|
||||
}
|
||||
|
||||
if (!(ent.flags & (Q2RF_SHELL_RED|Q2RF_SHELL_GREEN|Q2RF_SHELL_BLUE)))
|
||||
return;
|
||||
|
||||
ent.fatness = 0.5;
|
||||
ent.shaderRGBAf[3] /= 10;
|
||||
|
||||
ent.shaderRGBAf[0] = (!!(ent.flags & Q2RF_SHELL_RED));
|
||||
ent.shaderRGBAf[1] = (!!(ent.flags & Q2RF_SHELL_GREEN));
|
||||
ent.shaderRGBAf[2] = (!!(ent.flags & Q2RF_SHELL_BLUE));
|
||||
ent.forcedshader = R_RegisterCustom("q2/shell", Shader_DefaultSkinShell, NULL);
|
||||
|
||||
V_AddEntity(&ent);
|
||||
CLQ1_AddPowerupShell(V_AddEntity(&ent), true, plstate?plstate->effects:0);
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
|
|
|
@ -2043,6 +2043,12 @@ void CL_ParseServerData (void)
|
|||
SCR_SetLoadingStage(LS_CLIENT);
|
||||
SCR_BeginLoadingPlaque();
|
||||
|
||||
cl.allocated_client_slots = MAX_CLIENTS;
|
||||
#ifndef CLIENTONLY
|
||||
if (sv.state)
|
||||
cl.allocated_client_slots = sv.allocated_client_slots;
|
||||
#endif
|
||||
|
||||
// parse protocol version number
|
||||
// allow 2.2 and 2.29 demos to play
|
||||
#ifdef PROTOCOL_VERSION_FTE
|
||||
|
@ -5744,10 +5750,10 @@ void CLNQ_ParseServerMessage (void)
|
|||
if (!cl.viewentity[0])
|
||||
{
|
||||
cl.playernum[0] = (cl.viewentity[0] = MSG_ReadShort())-1;
|
||||
if (cl.playernum[0] >= MAX_CLIENTS)
|
||||
if (cl.playernum[0] >= cl.allocated_client_slots)
|
||||
{
|
||||
Con_Printf(CON_WARNING "WARNING: Server put us in slot %i. We are not on the scoreboard.\n", cl.playernum[0]);
|
||||
cl.playernum[0] = MAX_CLIENTS; //pretend it's an mvd (we have that spare slot)
|
||||
cl.playernum[0] = cl.allocated_client_slots; //pretend it's an mvd (we have that spare slot)
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -2806,7 +2806,7 @@ void CL_UpdateBeams (void)
|
|||
lastrunningbeam = bnum;
|
||||
|
||||
// if coming from the player, update the start position
|
||||
if ((b->flags & 1) && b->entity > 0 && b->entity <= MAX_CLIENTS)
|
||||
if ((b->flags & 1) && b->entity > 0 && b->entity <= cl.allocated_client_slots)
|
||||
{
|
||||
for (j = 0; j < cl.splitclients; j++)
|
||||
{
|
||||
|
@ -2884,7 +2884,7 @@ void CL_UpdateBeams (void)
|
|||
{
|
||||
VectorCopy(st->origin, b->start);
|
||||
}
|
||||
else if (b->entity <= MAX_CLIENTS && b->entity > 0)
|
||||
else if (b->entity <= cl.allocated_client_slots && b->entity > 0)
|
||||
{
|
||||
pl = &cl.frames[cl.parsecount&UPDATE_MASK].playerstate[b->entity-1];
|
||||
VectorCopy(pl->origin, b->start);
|
||||
|
|
|
@ -608,6 +608,7 @@ typedef struct
|
|||
entity_t viewent[MAX_SPLITS]; // weapon model
|
||||
|
||||
// all player information
|
||||
unsigned int allocated_client_slots;
|
||||
player_info_t players[MAX_CLIENTS];
|
||||
|
||||
|
||||
|
|
|
@ -259,7 +259,7 @@ static void CSQC_FindGlobals(void)
|
|||
CSQC_ChangeLocalPlayer(0);
|
||||
|
||||
if (csqcg.maxclients)
|
||||
*csqcg.maxclients = MAX_CLIENTS;
|
||||
*csqcg.maxclients = cl.allocated_client_slots;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2232,7 +2232,7 @@ static void QCBUILTIN PF_cs_getplayerkey (progfuncs_t *prinst, struct globalvars
|
|||
}
|
||||
}
|
||||
|
||||
if (pnum < 0 || pnum >= MAX_CLIENTS)
|
||||
if (pnum < 0 || pnum >= cl.allocated_client_slots)
|
||||
ret = "";
|
||||
else if (!*cl.players[pnum].userinfo)
|
||||
ret = ""; //player isn't on the server.
|
||||
|
|
|
@ -1937,6 +1937,8 @@ void Surf_GenBrushBatches(batch_t **batches, entity_t *ent)
|
|||
bef |= BEF_FORCETRANSPARENT;
|
||||
if (ent->flags & RF_NODEPTHTEST)
|
||||
bef |= BEF_FORCENODEPTH;
|
||||
if (ent->flags & RF_NOSHADOW)
|
||||
bef |= BEF_NOSHADOWS;
|
||||
|
||||
if (!model->surfaces && model->batches)
|
||||
{
|
||||
|
|
|
@ -93,7 +93,7 @@ cvar_t r_floortexture = SCVARF ("r_floortexture", "",
|
|||
CVAR_RENDERERCALLBACK|CVAR_SHADERSYSTEM);
|
||||
cvar_t r_fullbright = SCVARF ("r_fullbright", "0",
|
||||
CVAR_CHEAT|CVAR_SHADERSYSTEM);
|
||||
cvar_t r_fullbrightSkins = SCVARF ("r_fullbrightSkins", "1",
|
||||
cvar_t r_fullbrightSkins = SCVARF ("r_fullbrightSkins", "0.8", /*don't default to 1, as it looks a little ugly (too bright), but don't default to 0 either because then you're handicapped in the dark*/
|
||||
CVAR_SEMICHEAT|CVAR_SHADERSYSTEM);
|
||||
cvar_t r_lightmap_saturation = SCVAR ("r_lightmap_saturation", "1");
|
||||
cvar_t r_lightstylesmooth = SCVAR ("r_lightstylesmooth", "0");
|
||||
|
|
|
@ -32,7 +32,7 @@ float V_CalcRoll (vec3_t angles, vec3_t velocity);
|
|||
void GLV_UpdatePalette (qboolean force, double ftime);
|
||||
void SWV_UpdatePalette (qboolean force, double ftime);
|
||||
void V_ClearCShifts (void);
|
||||
void V_AddEntity(entity_t *in);
|
||||
entity_t *V_AddEntity(entity_t *in);
|
||||
void VQ2_AddLerpEntity(entity_t *in);
|
||||
void V_AddAxisEntity(entity_t *in);
|
||||
int V_AddLight (int entsource, vec3_t org, float quant, float r, float g, float b);
|
||||
|
|
|
@ -1488,7 +1488,7 @@
|
|||
AssemblerListingLocation=".\MDebug/"
|
||||
ObjectFile=".\MDebug/"
|
||||
ProgramDataBaseFileName=".\MDebug/"
|
||||
BrowseInformation="2"
|
||||
BrowseInformation="1"
|
||||
BrowseInformationFile=".\MDebug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
|
@ -1513,6 +1513,7 @@
|
|||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="../libs/dxsdk7/lib"
|
||||
GenerateManifest="false"
|
||||
IgnoreDefaultLibraryNames="libc.lib;msvcrt.lib"
|
||||
GenerateDebugInformation="true"
|
||||
GenerateMapFile="true"
|
||||
|
|
|
@ -747,7 +747,7 @@ static qboolean R_CalcModelLighting(entity_t *e, model_t *clmodel)
|
|||
}
|
||||
else
|
||||
{
|
||||
ambientlight[0] = ambientlight[1] = ambientlight[2] = shadelight[0] = shadelight[1] = shadelight[2] = 255;
|
||||
ambientlight[0] = ambientlight[1] = ambientlight[2] = shadelight[0] = shadelight[1] = shadelight[2] = 128;
|
||||
lightdir[0] = 0;
|
||||
lightdir[1] = 1;
|
||||
lightdir[2] = 1;
|
||||
|
@ -819,7 +819,7 @@ static qboolean R_CalcModelLighting(entity_t *e, model_t *clmodel)
|
|||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
if (ambientlight[i] < 8)
|
||||
ambientlight[i] = shadelight[i] = 8;
|
||||
ambientlight[i] = 8;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -926,6 +926,7 @@ void R_GAlias_GenerateBatches(entity_t *e, batch_t **batches)
|
|||
shader_t *shader;
|
||||
batch_t *b;
|
||||
int surfnum;
|
||||
shadersort_t sort;
|
||||
|
||||
texnums_t *skin;
|
||||
|
||||
|
@ -991,15 +992,30 @@ void R_GAlias_GenerateBatches(entity_t *e, batch_t **batches)
|
|||
b->lightmap = -1;
|
||||
b->surf_first = surfnum;
|
||||
b->flags = 0;
|
||||
sort = shader->sort;
|
||||
if (e->flags & Q2RF_ADDITIVE)
|
||||
{
|
||||
b->flags |= BEF_FORCEADDITIVE;
|
||||
if (sort < SHADER_SORT_ADDITIVE)
|
||||
sort = SHADER_SORT_ADDITIVE;
|
||||
}
|
||||
if (e->flags & Q2RF_TRANSLUCENT)
|
||||
{
|
||||
b->flags |= BEF_FORCETRANSPARENT;
|
||||
if (sort < SHADER_SORT_BLEND)
|
||||
sort = SHADER_SORT_BLEND;
|
||||
}
|
||||
if (e->flags & RF_NODEPTHTEST)
|
||||
{
|
||||
b->flags |= BEF_FORCENODEPTH;
|
||||
if (sort < SHADER_SORT_NEAREST)
|
||||
sort = SHADER_SORT_NEAREST;
|
||||
}
|
||||
if (e->flags & RF_NOSHADOW)
|
||||
b->flags |= BEF_NOSHADOWS;
|
||||
b->vbo = 0;
|
||||
b->next = batches[shader->sort];
|
||||
batches[shader->sort] = b;
|
||||
b->next = batches[sort];
|
||||
batches[sort] = b;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@ m*_t structures are in-memory
|
|||
#define EF_BLUE 64
|
||||
#define EF_RED 128
|
||||
|
||||
#define H2EF_NODRAW 128 //this is going to get complicated...
|
||||
#define H2EF_NODRAW 128 //this is going to get complicated... emulated server side.
|
||||
|
||||
#define EF_NODEPTHTEST 8192 //shows through walls. :(
|
||||
|
||||
|
|
|
@ -1150,17 +1150,23 @@ struct sbuiltin_s
|
|||
|
||||
"void main (void)\n"
|
||||
"{\n"
|
||||
" gl_FragColor = texture2D(s_t0, tc);\n"
|
||||
" vec4 col, sp;\n"
|
||||
" col = texture2D(s_t0, tc);\n"
|
||||
"#ifdef UPPER\n"
|
||||
" gl_FragColor.rgb += texture2D(s_t2, tc).rgb*e_uppercolour;\n"
|
||||
" vec4 uc = texture2D(s_t2, tc);\n"
|
||||
" col.rgb = mix(col.rgb, uc.rgb*e_uppercolour, uc.a);\n"
|
||||
"#endif\n"
|
||||
"#ifdef LOWER\n"
|
||||
" gl_FragColor.rgb += texture2D(s_t1, tc).rgb*e_lowercolour;\n"
|
||||
" vec4 lc = texture2D(s_t1, tc);\n"
|
||||
" col.rgb = mix(col.rgb, lc.rgb*e_lowercolour, lc.a);\n"
|
||||
"#endif\n"
|
||||
" gl_FragColor.rgb *= light;\n"
|
||||
" col.rgb *= light;\n"
|
||||
"#ifdef FULLBRIGHT\n"
|
||||
" gl_FragColor += texture2D(s_t3, tc);\n"
|
||||
" vec4 fb = texture2D(s_t3, tc);\n"
|
||||
" col.rgb = mix(col.rgb, fb.rgb, fb.a);\n"
|
||||
"#endif\n"
|
||||
" gl_FragColor.rgb = col.rgb;\n" /*'default' skin has an rgbgen of identity*/
|
||||
" gl_FragColor.a = col.a * e_colour.a;\n" /*it also has an alphagen of identity too, but generate an alpha anyway, as its normally not blended and thus ignores colour*/
|
||||
"}\n"
|
||||
"#endif\n"
|
||||
},
|
||||
|
@ -1209,18 +1215,23 @@ struct sbuiltin_s
|
|||
|
||||
"void main (void)\n"
|
||||
"{\n"
|
||||
" gl_FragColor = texture2D(s_t0, tc);\n"
|
||||
" vec4 col, sp;\n"
|
||||
" col = texture2D(s_t0, tc);\n"
|
||||
"#ifdef UPPER\n"
|
||||
" gl_FragColor.rgb += texture2D(s_t2, tc).rgb*e_uppercolour;\n"
|
||||
" vec4 uc = texture2D(s_t2, tc);\n"
|
||||
" col.rgb = mix(col.rgb, uc.rgb*e_uppercolour, uc.a);\n"
|
||||
"#endif\n"
|
||||
"#ifdef LOWER\n"
|
||||
" gl_FragColor.rgb += texture2D(s_t1, tc).rgb*e_lowercolour;\n"
|
||||
" vec4 lc = texture2D(s_t1, tc);\n"
|
||||
" col.rgb = mix(col.rgb, lc.rgb*e_lowercolour, lc.a);\n"
|
||||
"#endif\n"
|
||||
" gl_FragColor.rgb *= light;\n"
|
||||
" col.rgb *= light;\n"
|
||||
"#ifdef FULLBRIGHT\n"
|
||||
" gl_FragColor += texture2D(s_t3, tc);\n"
|
||||
" vec4 fb = texture2D(s_t3, tc);\n"
|
||||
" col.rgb = mix(col.rgb, fb.rgb, fb.a);\n"
|
||||
"#endif\n"
|
||||
" gl_FragColor *= e_colour;\n"
|
||||
" gl_FragColor.rgb = col.rgb;\n" /*'default' skin has an rgbgen of identity*/
|
||||
" gl_FragColor.a = col.a * e_colour.a;\n" /*it also has an alphagen of identity too, but generate an alpha anyway, as its normally not blended and thus ignores colour*/
|
||||
"}\n"
|
||||
"#endif\n"
|
||||
},
|
||||
|
|
|
@ -106,7 +106,7 @@ static void pp_flush(multicast_t to, vec3_t origin, void (*flushfunc)(client_t *
|
|||
}
|
||||
|
||||
// send the data to all relevent clients
|
||||
for (j = 0, client = svs.clients; j < MAX_CLIENTS; j++, client++)
|
||||
for (j = 0, client = svs.clients; j < sv.allocated_client_slots; j++, client++)
|
||||
{
|
||||
if (client->state != cs_spawned)
|
||||
continue;
|
||||
|
@ -1433,7 +1433,7 @@ void NPP_QWFlush(void)
|
|||
if (buffer[6])
|
||||
{
|
||||
unsigned int j = buffer[1];
|
||||
if (j < MAX_CLIENTS)
|
||||
if (j < sv.allocated_client_slots)
|
||||
{
|
||||
Q_strncpyz(svs.clients[j].userinfo, (buffer+6), sizeof(svs.clients[j].userinfo));
|
||||
if (*Info_ValueForKey(svs.clients[j].userinfo, "name"))
|
||||
|
@ -1445,7 +1445,7 @@ void NPP_QWFlush(void)
|
|||
else
|
||||
{
|
||||
unsigned int j = buffer[1];
|
||||
if (j < MAX_CLIENTS)
|
||||
if (j < sv.allocated_client_slots)
|
||||
{
|
||||
*svs.clients[j].name = '\0';
|
||||
*svs.clients[j].userinfo = '\0';
|
||||
|
@ -2353,7 +2353,7 @@ void NPP_MVDFlush(void)
|
|||
{
|
||||
unsigned int j;
|
||||
j = buffer[1];
|
||||
if (j < MAX_CLIENTS)
|
||||
if (j < sv.allocated_client_slots)
|
||||
{
|
||||
sv.recordedplayer[j].userid = buffer[2] | (buffer[3]<<8) | (buffer[4]<<16) | (buffer[5]<<24);
|
||||
Q_strncpyz(sv.recordedplayer[j].userinfo, buffer+6, sizeof(sv.recordedplayer[j].userinfo));
|
||||
|
|
|
@ -1533,7 +1533,7 @@ qboolean PR_GameCodePacket(char *s)
|
|||
|
||||
// check for packets from connected clients
|
||||
pr_global_struct->self = 0;
|
||||
for (i=0, cl=svs.clients ; i<MAX_CLIENTS ; i++,cl++)
|
||||
for (i=0, cl=svs.clients ; i<sv.allocated_client_slots ; i++,cl++)
|
||||
{
|
||||
if (cl->state == cs_free)
|
||||
continue;
|
||||
|
@ -4088,7 +4088,7 @@ sizebuf_t *QWWriteDest (int dest)
|
|||
#if 0
|
||||
ent = PROG_TO_EDICT(pr_global_struct->msg_entity);
|
||||
entnum = NUM_FOR_EDICT(ent);
|
||||
if (entnum < 1 || entnum > MAX_CLIENTS)
|
||||
if (entnum < 1 || entnum > sv.allocated_client_slots)
|
||||
{
|
||||
PR_BIError ("WriteDest: not a client");
|
||||
return &sv.reliable_datagram;
|
||||
|
@ -4137,7 +4137,7 @@ sizebuf_t *NQWriteDest (int dest)
|
|||
#if 0
|
||||
ent = PROG_TO_EDICT(pr_global_struct->msg_entity);
|
||||
entnum = NUM_FOR_EDICT(ent);
|
||||
if (entnum < 1 || entnum > MAX_CLIENTS)
|
||||
if (entnum < 1 || entnum > sv.allocated_client_slots)
|
||||
{
|
||||
PR_BIError (prinst, "WriteDest: not a client");
|
||||
return &sv.nqreliable_datagram;
|
||||
|
@ -4916,7 +4916,7 @@ char *PF_infokey_Internal (int entnum, char *key)
|
|||
value = Info_ValueForKey(localinfo, key);
|
||||
}
|
||||
}
|
||||
else if (entnum <= MAX_CLIENTS)
|
||||
else if (entnum <= sv.allocated_client_slots)
|
||||
{
|
||||
value = ov;
|
||||
if (!strcmp(key, "ip") || !strcmp(key, "realip")) //note: FTE doesn't support mvdsv's realip stuff, so pretend that we do if the mod asks
|
||||
|
@ -5449,7 +5449,7 @@ static void QCBUILTIN PF_checkextension (progfuncs_t *prinst, struct globalvars_
|
|||
if (*svprogfuncs->callargc == 2)
|
||||
{
|
||||
int clnum = NUM_FOR_EDICT(prinst, G_EDICT(prinst, OFS_PARM1));
|
||||
if (clnum >= 1 && clnum <= MAX_CLIENTS) //valid client as second parameter
|
||||
if (clnum >= 1 && clnum <= sv.allocated_client_slots) //valid client as second parameter
|
||||
{
|
||||
ext = checkfteextensioncl(svs.clients[clnum-1].fteprotocolextensions, s);
|
||||
}
|
||||
|
@ -5653,7 +5653,7 @@ static void QCBUILTIN PF_redirectcmd (progfuncs_t *prinst, struct globalvars_s *
|
|||
return;
|
||||
|
||||
entnum = G_EDICTNUM(OFS_PARM0);
|
||||
if (entnum < 1 || entnum > MAX_CLIENTS)
|
||||
if (entnum < 1 || entnum > sv.allocated_client_slots)
|
||||
PR_RunError ("Parm 0 not a client");
|
||||
|
||||
s = G_STRING(OFS_PARM1);
|
||||
|
@ -7844,7 +7844,7 @@ static void QCBUILTIN PF_setcolors (progfuncs_t *prinst, struct globalvars_s *pr
|
|||
entnum = G_EDICTNUM(prinst, OFS_PARM0);
|
||||
i = G_FLOAT(OFS_PARM1);
|
||||
|
||||
if (entnum < 1 || entnum > MAX_CLIENTS)
|
||||
if (entnum < 1 || entnum > sv.allocated_client_slots)
|
||||
{
|
||||
Con_Printf ("tried to setcolor a non-client\n");
|
||||
return;
|
||||
|
|
|
@ -1268,7 +1268,7 @@ void Q1QVM_Shutdown(void)
|
|||
int i;
|
||||
if (q1qvm)
|
||||
{
|
||||
for (i = 0; i < MAX_CLIENTS; i++)
|
||||
for (i = 0; i < sv.allocated_client_slots; i++)
|
||||
{
|
||||
if (svs.clients[i].name)
|
||||
Q_strncpyz(svs.clients[i].namebuf, svs.clients[i].name, sizeof(svs.clients[i].namebuf));
|
||||
|
|
|
@ -254,7 +254,7 @@ qboolean SV_SetPlayer (void)
|
|||
|
||||
idnum = atoi(Cmd_Argv(1));
|
||||
|
||||
for (i=0,cl=svs.clients ; i<MAX_CLIENTS ; i++,cl++)
|
||||
for (i=0,cl=svs.clients ; i<sv.allocated_client_slots ; i++,cl++)
|
||||
{
|
||||
if (!cl->state)
|
||||
continue;
|
||||
|
|
|
@ -345,7 +345,7 @@ void SV_SaveSpawnparms (qboolean dontsave)
|
|||
// serverflags is the only game related thing maintained
|
||||
svs.serverflags = pr_global_struct->serverflags;
|
||||
|
||||
for (i=0, host_client = svs.clients ; i<MAX_CLIENTS ; i++, host_client++)
|
||||
for (i=0, host_client = svs.clients ; i<sv.allocated_client_slots ; i++, host_client++)
|
||||
{
|
||||
if (host_client->state != cs_spawned)
|
||||
continue;
|
||||
|
|
|
@ -1797,7 +1797,7 @@ trace_t World_Move (world_t *w, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t e
|
|||
#ifndef CLIENTONLY
|
||||
if (w == &sv.world)
|
||||
{
|
||||
if (passedict->entnum && passedict->entnum <= MAX_CLIENTS)
|
||||
if (passedict->entnum && passedict->entnum <= sv.allocated_client_slots)
|
||||
{
|
||||
clip.type |= MOVE_LAGGED;
|
||||
w->lagents = svs.clients[passedict->entnum-1].laggedents;
|
||||
|
@ -1806,7 +1806,7 @@ trace_t World_Move (world_t *w, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t e
|
|||
}
|
||||
else if (passedict->v->owner)
|
||||
{
|
||||
if (passedict->v->owner && passedict->v->owner <= MAX_CLIENTS)
|
||||
if (passedict->v->owner && passedict->v->owner <= sv.allocated_client_slots)
|
||||
{
|
||||
clip.type |= MOVE_LAGGED;
|
||||
w->lagents = svs.clients[passedict->v->owner-1].laggedents;
|
||||
|
|
Loading…
Reference in a new issue