mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-16 09:31:14 +00:00
- fixed crash in GLDEFS parser caused by missing texture
https://forum.zdoom.org/viewtopic.php?t=64234
This commit is contained in:
parent
9d70b8436a
commit
42b3518266
1 changed files with 17 additions and 14 deletions
|
@ -1278,26 +1278,29 @@ class GLDefsParser
|
|||
}
|
||||
}
|
||||
sc.MustGetString();
|
||||
bool okay = false;
|
||||
for (int i = 0; i < MAX_CUSTOM_HW_SHADER_TEXTURES; i++)
|
||||
if (tex)
|
||||
{
|
||||
if (!tex->CustomShaderTextures[i])
|
||||
bool okay = false;
|
||||
for (int i = 0; i < MAX_CUSTOM_HW_SHADER_TEXTURES; 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)");
|
||||
}
|
||||
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->Name.GetChars());
|
||||
}
|
||||
|
||||
texNameList.Push(textureName);
|
||||
texNameIndex.Push(i);
|
||||
okay = true;
|
||||
break;
|
||||
texNameList.Push(textureName);
|
||||
texNameIndex.Push(i);
|
||||
okay = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!okay)
|
||||
{
|
||||
sc.ScriptError("Error: out of texture units in texture '%s'", tex->Name.GetChars());
|
||||
}
|
||||
}
|
||||
if (!okay)
|
||||
{
|
||||
sc.ScriptError("Error: out of texture units in texture '%s'", tex ? tex->Name.GetChars() : "(null)");
|
||||
}
|
||||
}
|
||||
else if (sc.Compare("define"))
|
||||
|
|
Loading…
Reference in a new issue