Merge pull request #1200 from Spel0/no-preload-crash-fix
No characters preload crash fix
This commit is contained in:
commit
b5fab53ac9
@ -131,7 +131,10 @@ class Paths
|
|||||||
inline static public function getSparrowAtlas(key:String, ?library:String, ?isCharacter:Bool = false)
|
inline static public function getSparrowAtlas(key:String, ?library:String, ?isCharacter:Bool = false)
|
||||||
{
|
{
|
||||||
if (isCharacter)
|
if (isCharacter)
|
||||||
|
if (FlxG.save.data.cacheImages)
|
||||||
return FlxAtlasFrames.fromSparrow(imageCached(key), file('images/characters/$key.xml', library));
|
return FlxAtlasFrames.fromSparrow(imageCached(key), file('images/characters/$key.xml', library));
|
||||||
|
else
|
||||||
|
return FlxAtlasFrames.fromSparrow(image('characters/$key'), file('images/characters/$key.xml'));
|
||||||
return FlxAtlasFrames.fromSparrow(image(key, library), file('images/$key.xml', library));
|
return FlxAtlasFrames.fromSparrow(image(key, library), file('images/$key.xml', library));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,7 +148,10 @@ class Paths
|
|||||||
inline static public function getPackerAtlas(key:String, ?library:String, ?isCharacter:Bool = false)
|
inline static public function getPackerAtlas(key:String, ?library:String, ?isCharacter:Bool = false)
|
||||||
{
|
{
|
||||||
if (isCharacter)
|
if (isCharacter)
|
||||||
return FlxAtlasFrames.fromSpriteSheetPacker(imageCached(key), file('images/characters/$key.txt', library));
|
if (FlxG.save.data.cacheImages)
|
||||||
|
return FlxAtlasFrames.fromSpriteSheetPacker(imageCached(key), file('images/$key.txt', library));
|
||||||
|
else
|
||||||
|
return FlxAtlasFrames.fromSpriteSheetPacker(image('characters/$key'), file('images/characters/$key.txt'));
|
||||||
return FlxAtlasFrames.fromSpriteSheetPacker(image(key, library), file('images/$key.txt', library));
|
return FlxAtlasFrames.fromSpriteSheetPacker(image(key, library), file('images/$key.txt', library));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user