This commit is contained in:
Artem Kharytoniuk 2017-04-05 15:17:16 +03:00
parent 76d4deb58a
commit a45d37355e
3 changed files with 7 additions and 25 deletions

View File

@ -404,20 +404,10 @@ typedef struct shader_s {
int numUnfoggedPasses;
shaderStage_t *stages[MAX_SHADER_STAGES];
void (*optimalStageIteratorFunc)( void );
float clampTime; // time this shader is clamped to
float timeOffset; // current time offset for this shader
float clampTime; // time this shader is clamped to
float timeOffset; // current time offset for this shader
int numStates; // if non-zero this is a state shader
struct shader_s *currentShader; // current state if this is a state shader
struct shader_s *parentShader; // current state if this is a state shader
int currentState; // current state index for cycle purposes
long expireTime; // time in milliseconds this expires
struct shader_s *remappedShader; // current shader this one is remapped too
int shaderStates[MAX_STATES_PER_SHADER]; // index to valid shader states
struct shader_s *remappedShader; // current shader this one is remapped too
struct shader_s *next;
} shader_t;

View File

@ -167,7 +167,8 @@ void RB_BeginSurface( shader_t *shader, int fogNum ) {
tess.dlightBits = 0; // will be OR'd in by surface functions
tess.xstages = state->stages;
tess.numPasses = state->numUnfoggedPasses;
tess.currentStageIteratorFunc = state->optimalStageIteratorFunc;
tess.currentStageIteratorFunc = state->isSky ? RB_StageIteratorSky : RB_StageIteratorGeneric;
tess.shaderTime = backEnd.refdef.floatTime - tess.shader->timeOffset;
if (tess.shader->clampTime && tess.shaderTime >= tess.shader->clampTime) {

View File

@ -2161,13 +2161,6 @@ static shader_t *FinishShader( void ) {
shader.sort = SS_FOG;
}
// determine which stage iterator function is appropriate
if ( shader.isSky ) {
shader.optimalStageIteratorFunc = RB_StageIteratorSky;
} else {
shader.optimalStageIteratorFunc = RB_StageIteratorGeneric;
}
return GeneratePermanentShader();
}
@ -2700,12 +2693,10 @@ void R_ShaderList_f (void) {
ri.Printf( PRINT_ALL, " " );
}
if ( shader->optimalStageIteratorFunc == RB_StageIteratorGeneric ) {
if ( !shader->isSky ) {
ri.Printf( PRINT_ALL, "gen " );
} else if ( shader->optimalStageIteratorFunc == RB_StageIteratorSky ) {
ri.Printf( PRINT_ALL, "sky " );
} else {
ri.Printf( PRINT_ALL, " " );
ri.Printf( PRINT_ALL, "sky " );
}
if ( shader->defaultShader ) {