File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
frameworks/js-bindings/bindings/script Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -574,10 +574,11 @@ cc.loader = {
574
574
} ) ;
575
575
}
576
576
else {
577
- var tex = cc . textureCache . _addImage ( url ) ;
578
- if ( tex instanceof cc . Texture2D )
579
- cb && cb ( null , tex ) ;
580
- else cb && cb ( "Load image failed" ) ;
577
+ cc . textureCache . _addImageAsync ( url , function ( tex ) {
578
+ if ( tex instanceof cc . Texture2D )
579
+ cb && cb ( null , tex ) ;
580
+ else cb && cb ( "Load image failed" ) ;
581
+ } ) ;
581
582
}
582
583
} ,
583
584
/**
@@ -932,8 +933,8 @@ cc.configuration = cc.Configuration.getInstance();
932
933
* cc.textureCache is the global cache for cc.Texture2D
933
934
*/
934
935
cc . textureCache = cc . director . getTextureCache ( ) ;
935
- cc . TextureCache . prototype . _addImage = cc . TextureCache . prototype . addImage ;
936
- cc . TextureCache . prototype . addImage = function ( url , cb , target ) {
936
+ cc . TextureCache . prototype . _addImageAsync = cc . TextureCache . prototype . addImageAsync ;
937
+ cc . TextureCache . prototype . addImageAsync = function ( url , cb , target ) {
937
938
var localTex = null ;
938
939
cc . loader . loadImg ( url , function ( err , tex ) {
939
940
if ( err ) tex = null ;
You can’t perform that action at this time.
0 commit comments