diff --git a/lime/app/Preloader.hx b/lime/app/Preloader.hx index 1a8418508..0a414ed7b 100644 --- a/lime/app/Preloader.hx +++ b/lime/app/Preloader.hx @@ -286,7 +286,14 @@ class Preloader #if flash extends Sprite #end { #if flash private function current_onEnter (event:Event):Void { - + + // Failsafe for small binary missing the 'onComplete' handler + if(!complete && Lib.current.loaderInfo.bytesLoaded == Lib.current.loaderInfo.bytesTotal) + { + complete = true; + update (Lib.current.loaderInfo.bytesLoaded, Lib.current.loaderInfo.bytesTotal); + } + if (complete) { Lib.current.removeEventListener (Event.ENTER_FRAME, current_onEnter); diff --git a/templates/haxe/DefaultAssetLibrary.hx b/templates/haxe/DefaultAssetLibrary.hx index dae62895f..9837242f6 100644 --- a/templates/haxe/DefaultAssetLibrary.hx +++ b/templates/haxe/DefaultAssetLibrary.hx @@ -792,7 +792,7 @@ class DefaultAssetLibrary extends AssetLibrary { ::if (assets != null)::::foreach assets::::if (!embed)::::if (type == "font")::@:keep #if display private #end class __ASSET__::flatName:: extends lime.text.Font { public function new () { __fontPath = #if ios "assets/" + #end "::targetPath::"; name = "::fontName::"; super (); }} ::end::::end::::end::::end:: -#if (windows || mac || linux) +#if (windows || mac || linux || cpp) ::if (assets != null):: ::foreach assets::::if (embed)::::if (type == "image")::@:image("::sourcePath::") #if display private #end class __ASSET__::flatName:: extends lime.graphics.Image {}