fixed the pukka3tourney2 slime not being green with r_vertexLight 1

This commit is contained in:
myT 2017-05-04 19:06:51 +02:00
parent 6b167831dd
commit f9d4056e41
2 changed files with 30 additions and 0 deletions

View file

@ -1,6 +1,8 @@
DD Mmm 17 - 1.49
fix: the pukka3tourney2 slime wasn't green with r_vertexLight 1
fix: the ct3ctf1 grate near quad was getting picmipped when it wasn't supposed to be
fix: improved the player name look-up behavior for these commands: kick, banUser, dumpuser

View file

@ -2056,6 +2056,18 @@ static const char* FindShaderInShaderText( const char* shadername )
}
struct vertexLightReplacementShader_t {
const char* mapName;
const char* shaderName;
const char* newShaderName;
int shaderNameHash;
};
static const vertexLightReplacementShader_t g_replacementShaders[] = {
{ "pukka3tourney2", "textures/pukka3tourney2/acid_lm", "textures/pukka3tourney2/acid_vertex", 418 }
};
/*
===============
R_FindShader
@ -2103,6 +2115,22 @@ shader_t* R_FindShader( const char *name, int lightmapIndex, qbool mipRawImage )
hash = Q_FileHash(strippedName, FILE_HASH_SIZE);
// replace some known shaders with more fit versions for r_vertexLight
if (r_vertexLight->integer) {
const int replacementCount = ARRAY_LEN(g_replacementShaders);
for (int i = 0; i < replacementCount; ++i) {
const vertexLightReplacementShader_t* const vlrs = g_replacementShaders + i;
if (vlrs->shaderNameHash == hash &&
strcmp(vlrs->mapName, R_GetMapName()) == 0 &&
strcmp(vlrs->shaderName, name) == 0) {
name = vlrs->newShaderName;
COM_StripExtension(name, strippedName, sizeof(strippedName));
hash = Q_FileHash(strippedName, FILE_HASH_SIZE);
break;
}
}
}
//
// see if the shader is already loaded
//