Custom hardware shaders now can use custom texture units

This commit is contained in:
usernameak 2018-07-04 21:36:33 +03:00 committed by Christoph Oelckers
commit 292458ee2d
3 changed files with 29 additions and 0 deletions

View file

@ -1398,6 +1398,24 @@ class GLDefsParser
sc.MustGetFloat();
speed = float(sc.Float);
}
else if (sc.Compare("texture"))
{
sc.MustGetString();
bool okay = false;
for(int i = 0; i < MAX_CUSTOM_HW_SHADER_TEXTURES; i++) {
if(!tex->CustomShaderTextures[i]) {
tex->CustomShaderTextures[i] = TexMan.FindTexture(sc.String, ETextureType::Any, FTextureManager::TEXMAN_TryAny);
if (!tex->CustomShaderTextures[i]) {
sc.ScriptError("Custom hardware shader texture '%s' not found in texture '%s'\n", sc.String, tex? tex->Name.GetChars() : "(null)");
}
okay = true;
break;
}
}
if(!okay) {
sc.ScriptError("Error: out of texture units in texture '%s'", tex? tex->Name.GetChars() : "(null)");
}
}
}
if (!tex)
{