There was an issue when loading Normal Maps with Sprite Sheets. Often, if the normal map image completed loading before the sprite sheet, it would cause it to be incorrectly added to the Texture Manager, resulting in broken frames. Now, regardless of the load order, the sprite sheet is added with its normal map correctly together. Fix #6491

This commit is contained in:
Richard Davey 2023-11-08 18:40:08 +00:00
parent b730d185c3
commit cda0c04afd

View file

@ -209,8 +209,11 @@ var ImageFile = new Class({
// We do, but has it loaded?
if (linkFile.state >= CONST.FILE_COMPLETE)
{
// Both files have loaded
if (this.type === 'normalMap')
if (linkFile.type === 'spritesheet')
{
linkFile.addToCache();
}
else if (this.type === 'normalMap')
{
// linkFile.data = Image
// this.data = Normal Map