Permalink
Browse files

Add alt shader support for idle and idle2

  • Loading branch information...
DolceTriade committed Dec 27, 2015
1 parent b04208d commit 69d60e0293422ba7fef498e582fd6638baee5f74
Showing with 14 additions and 3 deletions.
  1. +9 −0 src/cgame/cg_buildable.cpp
  2. +4 −2 src/cgame/cg_local.h
  3. +1 −1 src/cgame/cg_main.cpp
@@ -2574,6 +2574,15 @@ void CG_Buildable( centity_t *cent )
{
ent.altShaderIndex = CG_ALTSHADER_UNPOWERED;
}
else if ( ( cent->buildableAnim == BANIM_IDLE1 ) )
{
ent.altShaderIndex = CG_ALTSHADER_IDLE;
}
else if ( ( cent->buildableAnim == BANIM_IDLE2 ) )
{
ent.altShaderIndex = CG_ALTSHADER_IDLE2;
}


// add to refresh list
trap_R_AddRefEntityToScene( &ent );
@@ -1722,7 +1722,7 @@ typedef struct

// corpse info
clientInfo_t corpseinfo[ MAX_CLIENTS ];

void *capturedItem;
qhandle_t activeCursor;

@@ -1783,7 +1783,9 @@ typedef enum
{
CG_ALTSHADER_DEFAULT, // must be first
CG_ALTSHADER_UNPOWERED,
CG_ALTSHADER_DEAD
CG_ALTSHADER_DEAD,
CG_ALTSHADER_IDLE,
CG_ALTSHADER_IDLE2
} altShader_t;

//==============================================================================
@@ -1642,7 +1642,7 @@ void CG_Init( int serverMessageNum, int clientNum, glconfig_t gl, GameStateCSs g
( 480.0f * cgs.glconfig.vidWidth ) );

// load a few needed things before we do any screen updates
trap_R_SetAltShaderTokens( "unpowered,destroyed" );
trap_R_SetAltShaderTokens( "unpowered,destroyed,idle,idle2" );
cgs.media.whiteShader = trap_R_RegisterShader("white", (RegisterShaderFlags_t) RSF_DEFAULT);
cgs.media.charsetShader = trap_R_RegisterShader("gfx/2d/bigchars",
(RegisterShaderFlags_t) RSF_DEFAULT);

0 comments on commit 69d60e0

Please sign in to comment.