05 Mar 2011
This commit is contained in:
parent
08894901a3
commit
af514214fe
|
@ -255,6 +255,7 @@ usercmd_t CL_CreateCmd( void )
|
|||
usercmd_t cmd;
|
||||
color24 color;
|
||||
vec3_t angles;
|
||||
qboolean active;
|
||||
int ms;
|
||||
|
||||
ms = host.frametime * 1000;
|
||||
|
@ -281,7 +282,8 @@ usercmd_t CL_CreateCmd( void )
|
|||
if( ++cl.movemessages <= 10 )
|
||||
return cmd;
|
||||
|
||||
clgame.dllFuncs.CL_CreateMove( cl.time - cl.oldtime, &cmd, ( cls.state == ca_active && !cl.refdef.paused ));
|
||||
active = ( cls.state == ca_active && !cl.refdef.paused && !cl.refdef.intermission );
|
||||
clgame.dllFuncs.CL_CreateMove( cl.time - cl.oldtime, &cmd, active );
|
||||
|
||||
R_LightForPoint( cl.frame.local.client.origin, &color, false, 128.0f );
|
||||
cmd.lightlevel = (color.r + color.g + color.b) / 3;
|
||||
|
@ -290,7 +292,7 @@ usercmd_t CL_CreateCmd( void )
|
|||
// because is potential backdoor for cheating
|
||||
cmd.msec = ms;
|
||||
|
||||
if( cl.background )
|
||||
if( cl.background || cl.refdef.intermission )
|
||||
{
|
||||
VectorCopy( angles, cl.refdef.cl_viewangles );
|
||||
VectorCopy( angles, cmd.viewangles );
|
||||
|
|
|
@ -279,27 +279,24 @@ draw hudsprite routine
|
|||
static void PIC_DrawGeneric( float x, float y, float width, float height, const wrect_t *prc )
|
||||
{
|
||||
float s1, s2, t1, t2;
|
||||
int w, h;
|
||||
|
||||
if( width == -1 && height == -1 )
|
||||
{
|
||||
int w, h;
|
||||
|
||||
// assume we get sizes from image
|
||||
R_GetTextureParms( &w, &h, menu.ds.gl_texturenum );
|
||||
|
||||
width = w;
|
||||
height = h;
|
||||
}
|
||||
// assume we get sizes from image
|
||||
R_GetTextureParms( &w, &h, menu.ds.gl_texturenum );
|
||||
|
||||
if( prc )
|
||||
{
|
||||
// calc user-defined rectangle
|
||||
s1 = (float)prc->left / width;
|
||||
t1 = (float)prc->top / height;
|
||||
s2 = (float)prc->right / width;
|
||||
t2 = (float)prc->bottom / height;
|
||||
width = prc->right - prc->left;
|
||||
height = prc->bottom - prc->top;
|
||||
s1 = (float)prc->left / (float)w;
|
||||
t1 = (float)prc->top / (float)h;
|
||||
s2 = (float)prc->right / (float)w;
|
||||
t2 = (float)prc->bottom / (float)h;
|
||||
|
||||
if( width == -1 && height == -1 )
|
||||
{
|
||||
width = prc->right - prc->left;
|
||||
height = prc->bottom - prc->top;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -307,6 +304,12 @@ static void PIC_DrawGeneric( float x, float y, float width, float height, const
|
|||
s2 = t2 = 1.0f;
|
||||
}
|
||||
|
||||
if( width == -1 && height == -1 )
|
||||
{
|
||||
width = w;
|
||||
height = h;
|
||||
}
|
||||
|
||||
// pass scissor test if supposed
|
||||
if( menu.ds.scissor_test && !PIC_Scissor( &x, &y, &width, &height, &s1, &t1, &s2, &t2 ))
|
||||
return;
|
||||
|
|
|
@ -2312,7 +2312,7 @@ void CL_DecayLights( void )
|
|||
}
|
||||
}
|
||||
|
||||
#define FLASHLIGHT_DISTANCE 500
|
||||
#define FLASHLIGHT_DISTANCE 1024 // ~4.5 meter
|
||||
|
||||
/*
|
||||
================
|
||||
|
|
|
@ -867,6 +867,7 @@ void DrawSurfaceDecals( msurface_t *fa )
|
|||
|
||||
pglEnable( GL_POLYGON_OFFSET_FILL );
|
||||
pglBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
|
||||
pglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE ); // FIXME: testing
|
||||
|
||||
for( p = fa->pdecals; p; p = p->pnext )
|
||||
DrawSingleDecal( p, fa );
|
||||
|
@ -878,6 +879,10 @@ void DrawSurfaceDecals( msurface_t *fa )
|
|||
}
|
||||
|
||||
pglDisable( GL_POLYGON_OFFSET_FILL );
|
||||
|
||||
// restore blendfunc here
|
||||
if( e->curstate.rendermode == kRenderTransAdd || e->curstate.rendermode == kRenderGlow )
|
||||
pglBlendFunc( GL_SRC_ALPHA, GL_ONE );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -281,18 +281,33 @@ static void CL_SparkTracerDraw( particle_t *p, float frametime )
|
|||
VectorMA( p->org, frametime, p->vel, p->org );
|
||||
}
|
||||
|
||||
static void CL_BulletTracerDraw( particle_t *p, float frametime )
|
||||
static void CL_TracerImplosion( particle_t *p, float frametime )
|
||||
{
|
||||
int alpha = (int)(traceralpha->value * 255);
|
||||
float length, width;
|
||||
float lifePerc = p->die - cl.time;
|
||||
float grav = frametime * clgame.movevars.gravity * 0.05f;
|
||||
float length;
|
||||
int alpha = 255;
|
||||
vec3_t delta;
|
||||
|
||||
VectorScale( p->vel, p->ramp, delta );
|
||||
length = VectorLength( delta );
|
||||
width = ( length < TRACER_WIDTH ) ? length : TRACER_WIDTH;
|
||||
if( lifePerc < 0.5f ) alpha = (lifePerc * 2) * 255;
|
||||
|
||||
p->vel[2] -= grav; // use slow gravity
|
||||
CL_DrawTracer( p->org, delta, 1.5f, clgame.palette[p->color], alpha, 0.0f, 0.8f );
|
||||
|
||||
VectorMA( p->org, frametime, p->vel, p->org );
|
||||
}
|
||||
|
||||
static void CL_BulletTracerDraw( particle_t *p, float frametime )
|
||||
{
|
||||
int alpha = (int)(traceralpha->value * 255);
|
||||
vec3_t delta;
|
||||
|
||||
VectorScale( p->vel, p->ramp, delta );
|
||||
|
||||
// bullet tracers used particle palette
|
||||
CL_DrawTracer( p->org, delta, width, clgame.palette[p->color], alpha, 0.0f, 0.8f );
|
||||
CL_DrawTracer( p->org, delta, 3.5f, clgame.palette[p->color], alpha, 0.0f, 0.8f );
|
||||
|
||||
VectorMA( p->org, frametime, p->vel, p->org );
|
||||
}
|
||||
|
@ -328,6 +343,8 @@ void CL_UpdateParticle( particle_t *p, float ft )
|
|||
return; // already drawed
|
||||
else if( p->callback == CL_SparkTracerDraw )
|
||||
return; // already drawed
|
||||
else if( p->callback == CL_TracerImplosion )
|
||||
return; // already drawed
|
||||
}
|
||||
break;
|
||||
case pt_fire:
|
||||
|
@ -1354,8 +1371,8 @@ void CL_TracerEffect( const vec3_t start, const vec3_t end )
|
|||
VectorScale( dir, tracerspeed->value, p->vel );
|
||||
VectorMA( start, traceroffset->value, dir, p->org ); // make some offset
|
||||
p->color = CL_LookupColor( color[0], color[1], color[2] );
|
||||
p->die += ( length / tracerspeed->value );
|
||||
p->ramp = tracerlength->value; // ramp used as length
|
||||
p->die += ( length / min( 100.0f, tracerspeed->value ));
|
||||
p->ramp = tracerlength->value * 0.1f; // ramp used as length
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1444,46 +1461,34 @@ CL_Implosion
|
|||
void CL_Implosion( const vec3_t end, float radius, int count, float life )
|
||||
{
|
||||
particle_t *p;
|
||||
vec3_t dir, dest;
|
||||
vec3_t m_vecPos;
|
||||
float flDist, vel;
|
||||
int i, j, colorIndex;
|
||||
int step;
|
||||
float vel;
|
||||
vec3_t dir, m_vecPos;
|
||||
int i, colorIndex;
|
||||
|
||||
colorIndex = CL_LookupColor( gTracerColors[5][0], gTracerColors[5][1], gTracerColors[5][2] );
|
||||
step = count / 4;
|
||||
|
||||
for( i = -radius; i <= radius; i += step )
|
||||
for( i = 0; i < count; i++ )
|
||||
{
|
||||
for( j = -radius; j <= radius; j += step )
|
||||
{
|
||||
p = CL_AllocParticle( CL_SparkTracerDraw );
|
||||
if( !p ) return;
|
||||
p = CL_AllocParticle( CL_TracerImplosion );
|
||||
if( !p ) return;
|
||||
|
||||
VectorCopy( end, m_vecPos );
|
||||
dir[0] = Com_RandomFloat( -1.0f, 1.0f );
|
||||
dir[1] = Com_RandomFloat( -1.0f, 1.0f );
|
||||
dir[2] = Com_RandomFloat( -1.0f, 1.0f );
|
||||
|
||||
dest[0] = end[0] + i;
|
||||
dest[1] = end[1] + j;
|
||||
dest[2] = end[2] + Com_RandomFloat( 100, 800 );
|
||||
VectorNormalize( dir );
|
||||
VectorMA( end, -radius, dir, m_vecPos );
|
||||
|
||||
// send particle heading to dest at a random speed
|
||||
VectorSubtract( dest, m_vecPos, dir );
|
||||
// velocity based on how far particle has to travel away from org
|
||||
vel = Com_RandomFloat( radius * 0.5f, radius * 1.5f );
|
||||
|
||||
vel = dest[2] / 8;// velocity based on how far particle has to travel away from org
|
||||
VectorCopy( m_vecPos, p->org );
|
||||
p->color = colorIndex;
|
||||
p->ramp = 0.15f; // length based on velocity
|
||||
|
||||
flDist = VectorNormalizeLength( dir ); // save the distance
|
||||
if( vel < 64 ) vel = 64;
|
||||
|
||||
vel += Com_RandomFloat( 64, 128 );
|
||||
life += ( flDist / vel );
|
||||
VectorScale( dir, vel, p->vel );
|
||||
|
||||
VectorCopy( m_vecPos, p->org );
|
||||
p->color = colorIndex;
|
||||
p->ramp = 1.0f; // length based on velocity
|
||||
|
||||
VectorScale( dir, vel, p->vel );
|
||||
// die right when you get there
|
||||
p->die += life;
|
||||
}
|
||||
// die right when you get there
|
||||
p->die += ( life != 0.0f ) ? life : ( radius / vel );
|
||||
}
|
||||
}
|
|
@ -895,7 +895,7 @@ void R_DrawSpriteModel( cl_entity_t *e )
|
|||
color[1] = (float)e->curstate.rendercolor.g * ( 1.0f / 255.0f );
|
||||
color[2] = (float)e->curstate.rendercolor.b * ( 1.0f / 255.0f );
|
||||
|
||||
if( psprite->texFormat == SPR_ALPHTEST && r_lighting_extended->integer )
|
||||
if( psprite->texFormat == SPR_ALPHTEST && r_lighting_extended->integer && e->curstate.rendermode != kRenderTransAdd )
|
||||
{
|
||||
color24 lightColor;
|
||||
qboolean invLight;
|
||||
|
@ -991,7 +991,7 @@ void R_DrawSpriteModel( cl_entity_t *e )
|
|||
}
|
||||
|
||||
// draw the sprite 'lightmap' :-)
|
||||
if( psprite->texFormat == SPR_ALPHTEST && r_lighting_extended->integer )
|
||||
if( psprite->texFormat == SPR_ALPHTEST && r_lighting_extended->integer && e->curstate.rendermode != kRenderTransAdd )
|
||||
{
|
||||
pglEnable( GL_BLEND );
|
||||
pglDepthFunc( GL_EQUAL );
|
||||
|
|
|
@ -26,7 +26,7 @@ typedef struct
|
|||
|
||||
#define TF_SKY (TF_SKYSIDE|TF_UNCOMPRESSED|TF_NOMIPMAP|TF_NOPICMIP)
|
||||
#define TF_FONT (TF_UNCOMPRESSED|TF_NOPICMIP|TF_NOMIPMAP|TF_CLAMP)
|
||||
#define TF_IMAGE (TF_UNCOMPRESSED|TF_NOPICMIP|TF_NOMIPMAP)
|
||||
#define TF_IMAGE (TF_UNCOMPRESSED|TF_NOPICMIP|TF_NOMIPMAP|TF_CLAMP)
|
||||
#define TF_DECAL (TF_CLAMP|TF_UNCOMPRESSED)
|
||||
|
||||
typedef enum
|
||||
|
|
|
@ -517,8 +517,10 @@ void SV_AddGravity( edict_t *ent )
|
|||
{
|
||||
float ent_gravity;
|
||||
|
||||
#if 0
|
||||
if( ent->v.flags & FL_ONGROUND )
|
||||
return; // already onground
|
||||
#endif
|
||||
|
||||
if( ent->v.gravity )
|
||||
ent_gravity = ent->v.gravity;
|
||||
|
|
Reference in New Issue