VRAD - reduce duplicate %alphatexture searches

Per comment on https://github.com/ValveSoftware/source-sdk-2013/pull/1150 by @ficool2
This commit is contained in:
Yui 2025-03-24 20:19:30 -04:00 committed by GitHub
parent 9055a01141
commit bb209357c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -528,14 +528,10 @@ public:
if ( pVMT->LoadFromBuffer( pMaterialName, buf ) )
{
bFound = true;
if ( pVMT->FindKey("$alphatest") || pVMT->FindKey("$translucent") || pVMT->FindKey("%alphatexture") )
KeyValues *pBaseTexture = pVMT->FindKey("%alphatexture");
if ( pBaseTexture || pVMT->FindKey("$alphatest") || pVMT->FindKey("$translucent") )
{
KeyValues *pBaseTexture = NULL;
if ( pVMT->FindKey("%alphatexture") )
{
pBaseTexture = pVMT->FindKey("%alphatexture");
}
else
if ( !pBaseTexture )
{
pBaseTexture = pVMT->FindKey("$basetexture");
}