mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
correct imageassetarrays having a singular texture profile as oposed to a type per.
while that certainly works for most cases it falls apart when dealing with postfx where it's an unnamed array of variable types of inputs. shifted the profile assignment to #define INIT_IMAGEASSET_ARRAY(name, profile, index) so there's still a really obvious point where you can see the default setting, even if it's not in the more desireable OG definition spot for postfx in particular, given we can swap that, provided an example of how to do just that
This commit is contained in:
parent
a0e0e1f220
commit
e45b959d7d
15 changed files with 66 additions and 48 deletions
|
|
@ -508,7 +508,7 @@ PostEffect::PostEffect()
|
|||
|
||||
for (U32 i = 0; i < NumTextures; i++)
|
||||
{
|
||||
INIT_ASSET_ARRAY(Texture, i);
|
||||
INIT_IMAGEASSET_ARRAY(Texture, PostFxTextureProfile, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -602,9 +602,19 @@ bool PostEffect::onAdd()
|
|||
scriptPath.setExtension( String::EmptyString );
|
||||
|
||||
// Find additional textures
|
||||
for( S32 i = 0; i < NumTextures; i++ )
|
||||
for (S32 i = 0; i < NumTextures; i++)
|
||||
{
|
||||
mTextureType[i] = NormalTextureType;
|
||||
String texFilename = getTexture(i);
|
||||
|
||||
// Skip empty stages or ones with variable or target names.
|
||||
if (texFilename.isEmpty() ||
|
||||
texFilename[0] == '$' ||
|
||||
texFilename[0] == '#')
|
||||
continue;
|
||||
|
||||
mTextureProfile[i] = (mTexSRGB[i]) ? &PostFxTextureSRGBProfile : &PostFxTextureProfile;
|
||||
_setTexture(texFilename, i);
|
||||
}
|
||||
|
||||
// Is the target a named target?
|
||||
|
|
@ -1625,12 +1635,8 @@ void PostEffect::setTexture( U32 index, const String &texFilePath )
|
|||
texFilePath[0] == '#' )
|
||||
return;
|
||||
|
||||
GFXTextureProfile* profile = &PostFxTextureProfile;
|
||||
if (mTexSRGB[index])
|
||||
profile = &PostFxTextureSRGBProfile;
|
||||
|
||||
// Try to load the texture.
|
||||
mTexture[index].set( texFilePath, profile, avar( "%s() - (line %d)", __FUNCTION__, __LINE__ ) );
|
||||
mTextureProfile[index] = (mTexSRGB[index])? &PostFxTextureSRGBProfile : &PostFxTextureProfile;
|
||||
_setTexture(texFilePath, index);
|
||||
|
||||
mTextureType[index] = NormalTextureType;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue