add cl_gunx/cl_guny/cl_gunz, remove r_viewmodelsize until I implement it correctly, misc cleanup

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2279 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2006-05-17 23:01:06 +00:00
parent ccf48364b1
commit 50c00fb7bc
11 changed files with 25 additions and 168 deletions

View file

@ -49,8 +49,6 @@ static struct predicted_player {
player_state_t *oldstate;
} predicted_players[MAX_CLIENTS];
float newlerprate;
extern int cl_playerindex, cl_h_playerindex, cl_rocketindex, cl_grenadeindex, cl_gib1index, cl_gib2index, cl_gib3index;
qboolean CL_FilterModelindex(int modelindex, int frame)
@ -2934,6 +2932,8 @@ void CL_LinkViewModel(void)
static int oldframe[MAX_SPLITS];
float alpha;
extern cvar_t cl_gunx, cl_guny, cl_gunz;
#ifdef SIDEVIEWS
extern qboolean r_secondaryview;
if (r_secondaryview==1)
@ -2963,9 +2963,6 @@ void CL_LinkViewModel(void)
if (!ent.model)
return;
#ifdef PEXT_SCALE
ent.scale = r_viewmodelsize.value;
#endif
if (r_drawviewmodel.value > 0 && r_drawviewmodel.value < 1)
alpha = r_drawviewmodel.value;
else
@ -2976,6 +2973,10 @@ void CL_LinkViewModel(void)
&& r_drawviewmodelinvis.value < 1)
alpha *= r_drawviewmodelinvis.value;
ent.origin[0] = cl_gunz.value;
ent.origin[1] = -cl_gunx.value;
ent.origin[2] = -cl_guny.value;
ent.shaderRGBAf[0] = 1;
ent.shaderRGBAf[1] = 1;
ent.shaderRGBAf[2] = 1;

View file

@ -120,6 +120,10 @@ cvar_t v_powerupshell = SCVAR("v_powerupshell", "0");
cvar_t cl_gibfilter = SCVAR("cl_gibfilter", "0");
cvar_t cl_deadbodyfilter = SCVAR("cl_deadbodyfilter", "0");
cvar_t cl_gunx = SCVAR("cl_gunx", "0");
cvar_t cl_guny = SCVAR("cl_guny", "0");
cvar_t cl_gunz = SCVAR("cl_gunz", "0");
cvar_t allow_download_csprogs = SCVAR("allow_download_csprogs", "0");
cvar_t cl_muzzleflash = SCVAR("cl_muzzleflash", "1");
@ -2698,6 +2702,10 @@ void CL_Init (void)
Cvar_Register (&cl_antibunch, "evil hacks");
Cvar_Register (&hud_tracking_show, "statusbar");
Cvar_Register (&cl_gunx, cl_controlgroup);
Cvar_Register (&cl_guny, cl_controlgroup);
Cvar_Register (&cl_gunz, cl_controlgroup);
#ifdef WEBCLIENT
Cmd_AddCommand ("ftp", CL_FTP_f);
#endif

View file

@ -1877,7 +1877,7 @@ void CLQ2_AddViewWeapon (q2player_state_t *ps, q2player_state_t *ops)
entity_t gun; // view model
int i;
entity_t *view;
extern cvar_t r_viewmodelsize;
extern cvar_t cl_gunx, cl_guny, cl_gunz;
// allow the gun to be completely removed
if (!r_drawviewmodel.value)
@ -1905,7 +1905,6 @@ void CLQ2_AddViewWeapon (q2player_state_t *ps, q2player_state_t *ops)
if (!gun.model)
return;
gun.scale = r_viewmodelsize.value;
gun.shaderRGBAf[0] = 1;
gun.shaderRGBAf[1] = 1;
gun.shaderRGBAf[2] = 1;
@ -1914,29 +1913,22 @@ void CLQ2_AddViewWeapon (q2player_state_t *ps, q2player_state_t *ops)
else
gun.shaderRGBAf[3] = 1;
gun.origin[0] = cl_gunz.value;
gun.origin[1] = -cl_gunx.value;
gun.origin[2] = -cl_guny.value;
// set up gun position
for (i=0 ; i<3 ; i++)
{
gun.origin[i] = 0;//ops->gunoffset[i]
// + cl.lerpfrac * (ps->gunoffset[i] - ops->gunoffset[i]);
gun.angles[i] = 0;//LerpAngle (ops->gunangles[i],
// ps->gunangles[i], cl.lerpfrac);
}
gun.angles[0]*=-1;
// if (gun_frame)
// {
// gun.frame = gun_frame; // development tool
// gun.oldframe = gun_frame; // development tool
// }
// else
{
gun.frame = ps->gunframe;
if (gun.frame == 0)
gun.oldframe = 0; // just changed weapons, don't lerp from old
else
gun.oldframe = ops->gunframe;
}
gun.frame = ps->gunframe;
if (gun.frame == 0)
gun.oldframe = 0; // just changed weapons, don't lerp from old
else
gun.oldframe = ops->gunframe;
gun.flags = Q2RF_MINLIGHT | Q2RF_DEPTHHACK | Q2RF_WEAPONMODEL;
gun.lerpfrac = 1-cl.lerpfrac;

View file

@ -354,7 +354,6 @@ extern cvar_t r_norefresh;
extern cvar_t r_drawentities;
extern cvar_t r_drawworld;
extern cvar_t r_drawviewmodel;
extern cvar_t r_viewmodelsize;
extern cvar_t r_drawviewmodelinvis;
extern cvar_t r_speeds;
extern cvar_t r_waterwarp;

View file

@ -35,7 +35,6 @@ void GL_Texturemode_Callback (struct cvar_s *var, char *oldvalue);
//
cvar_t r_drawviewmodel = SCVAR("r_drawviewmodel","1");
cvar_t r_viewmodelsize = SCVAR("r_viewmodelsize","1");
cvar_t r_drawviewmodelinvis = SCVAR("r_drawviewmodelinvis", "0");
cvar_t r_netgraph = SCVAR("r_netgraph","0");
cvar_t r_speeds = SCVARF("r_speeds","0", CVAR_CHEAT);
@ -548,7 +547,6 @@ void Renderer_Init(void)
//renderer
Cvar_Register (&r_fullbright, SCREENOPTIONS);
Cvar_Register (&r_drawentities, GRAPHICALNICETIES);
Cvar_Register (&r_viewmodelsize, GRAPHICALNICETIES);
Cvar_Register (&r_drawviewmodel, GRAPHICALNICETIES);
Cvar_Register (&r_drawviewmodelinvis, GRAPHICALNICETIES);
Cvar_Register (&r_waterwarp, GRAPHICALNICETIES);

View file

@ -45,6 +45,7 @@ typedef qboolean qbool;
#define Com_Printf Con_Printf
#define strlcpy Q_strncpyz
#define strlcat Q_strncatz
#define Q_stricmp stricmp
#define Q_strnicmp strnicmp
@ -65,33 +66,6 @@ qboolean suppress;
*/
#define Q_rint(f) ((int)((f)+0.5))
#ifndef HAVE_STRLCAT
static size_t strlcat (char *dst, const char *src, size_t size)
{
int dstlen = strlen(dst);
int srclen = strlen(src);
int len = dstlen + srclen;
if (len < size)
{
// it'll fit
memcpy (dst + dstlen, src, srclen + 1);
return len;
}
if (dstlen >= size - 1)
return srclen + size;
if (size == 0)
return srclen;
memcpy (dst + dstlen, src, size - 1 - dstlen);
dst[size - 1] = 0;
return len;
}
#endif
// callbacks used for TP cvars
void TP_SkinCvar_Callback(struct cvar_s *var, char *oldvalue);

View file

@ -71,8 +71,6 @@ mplane_t *mirror_plane;
msurface_t *r_mirror_chain;
qboolean r_inmirror; //or out-of-body
void R_DrawAliasModel (entity_t *e);
//
// view origin
//

View file

@ -301,7 +301,6 @@ void GL_Set2D (void);
qboolean R_CullBox (vec3_t mins, vec3_t maxs);
qboolean R_CullSphere (vec3_t origin, float radius);
void R_RotateForEntity (entity_t *e);
void R_DrawAliasModel (entity_t *e);
void GL_InitSceneProcessingShaders (void);
void GL_SetupSceneProcessingTextures (void);

View file

@ -36,8 +36,6 @@ float d_scalemip[NUM_MIPS-1];
static float basemip[NUM_MIPS-1] = {1.0, 0.5*0.8, 0.25*0.8};
extern int d_aflatcolor;
void (*d_drawspans) (espan_t *pspan);
void D_DrawSpans32 (espan_t *pspan);
@ -182,8 +180,6 @@ void D_SetupFrame (void)
else
d_drawspans = d_smooth.value?D_DrawSpans8_Smooth:D_DrawSpans8;
#endif
d_aflatcolor = 0;
}

View file

@ -72,7 +72,6 @@ int r_p0[6], r_p1[6], r_p2[6];
qbyte *d_pcolormap;
int d_aflatcolor;
int d_xdenom;
edgetable *pedgetable;
@ -771,47 +770,6 @@ void D_PolysetDrawSpans16 (spanpackage_t *pspanpackage)
} while (pspanpackage->count != -999999);
}
/*
================
D_PolysetFillSpans8
================
*/
void D_PolysetFillSpans8Trans (spanpackage_t *pspanpackage)
{
int color;
// FIXME: do z buffering
color = d_aflatcolor++;
while (1)
{
int lcount;
qbyte *lpdest;
lcount = pspanpackage->count;
if (lcount == -1)
return;
if (lcount)
{
lpdest = pspanpackage->pdest;
do
{
*lpdest = Trans(*lpdest, (unsigned char)color);
lpdest++;
} while (--lcount);
}
pspanpackage++;
}
}
void D_RasterizeAliasPolySmoothC (void)
{
int initialleftheight, initialrightheight;
@ -1894,44 +1852,6 @@ void D_PolysetDrawSpans8C (spanpackage_t *pspanpackage)
} while (pspanpackage->count != -999999);
}
/*
================
D_PolysetFillSpans8
================
*/
void D_PolysetFillSpans8 (spanpackage_t *pspanpackage)
{
int color;
// FIXME: do z buffering
color = d_aflatcolor++;
while (1)
{
int lcount;
qbyte *lpdest;
lcount = pspanpackage->count;
if (lcount == -1)
return;
if (lcount)
{
lpdest = pspanpackage->pdest;
do
{
*lpdest++ = color;
} while (--lcount);
}
pspanpackage++;
}
}
/*
================
D_RasterizeAliasPolySmooth

View file

@ -242,34 +242,6 @@ void D_SCDump (void)
//=============================================================================
// if the num is not a power of 2, assume it will not repeat
int MaskForNum (int num)
{
if (num==128)
return 127;
if (num==64)
return 63;
if (num==32)
return 31;
if (num==16)
return 15;
return 255;
}
int D_log2 (int num)
{
int c;
c = 0;
while (num>>=1)
c++;
return c;
}
//=============================================================================
/*
================
D_CacheSurface