diff options
-rw-r--r-- | src/cgame/cg_local.h | 1 | ||||
-rw-r--r-- | src/game/bg_public.h | 18 | ||||
-rw-r--r-- | src/game/g_misc.c | 22 |
3 files changed, 33 insertions, 8 deletions
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 9f701bc8..cd6ae57c 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -279,6 +279,7 @@ typedef struct localEntity_s { float initAlp, finalAlp; float initRad, finalRad; qboolean overdraw; + qboolean realLight; } localEntity_t; //====================================================================== diff --git a/src/game/bg_public.h b/src/game/bg_public.h index da4f09ea..8886f74a 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -286,9 +286,9 @@ typedef enum { // entityState_t->eFlags #define EF_DEAD 0x00000001 // don't draw a foe marker over players with EF_DEAD -#define EF_TELEPORT_BIT 0x00000004 // toggled every time the origin abruptly changes -#define EF_AWARD_EXCELLENT 0x00000008 // draw an excellent sprite -#define EF_PLAYER_EVENT 0x00000010 +#define EF_TELEPORT_BIT 0x00000002 // toggled every time the origin abruptly changes +#define EF_AWARD_EXCELLENT 0x00000004 // draw an excellent sprite +#define EF_PLAYER_EVENT 0x00000008 #define EF_BOUNCE 0x00000010 // for missiles #define EF_BOUNCE_HALF 0x00000020 // for missiles #define EF_AWARD_GAUNTLET 0x00000040 // draw a gauntlet sprite @@ -296,11 +296,13 @@ typedef enum { #define EF_FIRING 0x00000100 // for lightning gun #define EF_FIRING2 0x00000200 // alt fire #define EF_MOVER_STOP 0x00000400 // will push otherwise -#define EF_TALK 0x00001000 // draw a talk balloon -#define EF_CONNECTION 0x00002000 // draw a connection trouble sprite -#define EF_VOTED 0x00004000 // already cast a vote -#define EF_TEAMVOTED 0x00008000 // already cast a vote -#define EF_AWARD_IMPRESSIVE 0x00010000 // draw an impressive sprite +#define EF_TALK 0x00000800 // draw a talk balloon +#define EF_CONNECTION 0x00001000 // draw a connection trouble sprite +#define EF_VOTED 0x00002000 // already cast a vote +#define EF_TEAMVOTED 0x00004000 // already cast a vote +#define EF_AWARD_IMPRESSIVE 0x00008000 // draw an impressive sprite +#define EF_OVERDRAW_OFF 0x00010000 // TA: disable overdraw protection on sprites +#define EF_REAL_LIGHT 0x00020000 // TA: light sprites according to ambient light typedef enum { PW_NONE, diff --git a/src/game/g_misc.c b/src/game/g_misc.c index 870b5144..27f0450b 100644 --- a/src/game/g_misc.c +++ b/src/game/g_misc.c @@ -364,12 +364,24 @@ void ShineTorch( gentity_t *self ) trap_LinkEntity( self ); } +//TA: use function for spriter +void SP_use_spriter( gentity_t *self, gentity_t *other, gentity_t *activator ) +{ + //toggle EF_NODRAW + if( self->s.eFlags & EF_NODRAW ) + self->s.eFlags &= ~EF_NODRAW; + else + self->s.eFlags |= EF_NODRAW; +} + +//TA: spawn function for spriter void SP_spriter( gentity_t *self ) { vec3_t accel; G_SetOrigin( self, self->s.origin ); + //set a bunch of stuff to be visible client side VectorCopy( self->acceleration, self->s.origin2 ); self->s.time = (int)self->speed; @@ -388,8 +400,18 @@ void SP_spriter( gentity_t *self ) else self->s.angles2[ 1 ] = 1000; + //add the shader to the client precache list self->s.weapon = G_ShaderIndex( self->targetShaderName ); + if( self->spawnflags & 1 ) + self->s.eFlags |= EF_OVERDRAW_OFF; + if( self->spawnflags & ( 1 << 1 ) ) + self->s.eFlags |= EF_REAL_LIGHT; + if( self->spawnflags & ( 1 << 2 ) ) + self->s.eFlags |= EF_NODRAW; + + self->use = SP_use_spriter; + self->s.eType = ET_SPRITER; trap_LinkEntity( self ); |