@@ -46,12 +46,6 @@ Phaser.Loader = function (game) {
4646 */
4747 this . _xhr = new XMLHttpRequest ( ) ;
4848
49- /**
50- * @property {number } - Length of assets queue.
51- * @default
52- */
53- this . queueSize = 0 ;
54-
5549 /**
5650 * @property {boolean } isLoading - True if the Loader is in the process of loading the queue.
5751 * @default
@@ -250,6 +244,8 @@ Phaser.Loader.prototype = {
250244 loaded : false
251245 } ;
252246
247+ console . log ( 'addToFileList' , entry ) ;
248+
253249 if ( typeof properties !== "undefined" )
254250 {
255251 for ( var prop in properties )
@@ -685,6 +681,8 @@ Phaser.Loader.prototype = {
685681 */
686682 start : function ( ) {
687683
684+ console . log ( 'Loader start' , this . _fileList ) ;
685+
688686 if ( this . isLoading )
689687 {
690688 return ;
@@ -733,10 +731,10 @@ Phaser.Loader.prototype = {
733731 file . data = new Image ( ) ;
734732 file . data . name = file . key ;
735733 file . data . onload = function ( ) {
736- return _this . fileComplete ( this . _fileIndex ) ;
734+ return _this . fileComplete ( _this . _fileIndex ) ;
737735 } ;
738736 file . data . onerror = function ( ) {
739- return _this . fileError ( this . _fileIndex ) ;
737+ return _this . fileError ( _this . _fileIndex ) ;
740738 } ;
741739 file . data . crossOrigin = this . crossOrigin ;
742740 file . data . src = this . baseURL + file . url ;
@@ -753,10 +751,10 @@ Phaser.Loader.prototype = {
753751 this . _xhr . open ( "GET" , this . baseURL + file . url , true ) ;
754752 this . _xhr . responseType = "arraybuffer" ;
755753 this . _xhr . onload = function ( ) {
756- return _this . fileComplete ( this . _fileIndex ) ;
754+ return _this . fileComplete ( _this . _fileIndex ) ;
757755 } ;
758756 this . _xhr . onerror = function ( ) {
759- return _this . fileError ( this . _fileIndex ) ;
757+ return _this . fileError ( _this . _fileIndex ) ;
760758 } ;
761759 this . _xhr . send ( ) ;
762760 }
@@ -776,7 +774,7 @@ Phaser.Loader.prototype = {
776774 file . data = new Audio ( ) ;
777775 file . data . name = file . key ;
778776 file . data . onerror = function ( ) {
779- return _this . fileError ( this . _fileIndex ) ;
777+ return _this . fileError ( _this . _fileIndex ) ;
780778 } ;
781779 file . data . preload = 'auto' ;
782780 file . data . src = this . baseURL + file . url ;
@@ -799,13 +797,13 @@ Phaser.Loader.prototype = {
799797 if ( file . format == Phaser . Tilemap . TILED_JSON )
800798 {
801799 this . _xhr . onload = function ( ) {
802- return _this . jsonLoadComplete ( this . _fileIndex ) ;
800+ return _this . jsonLoadComplete ( _this . _fileIndex ) ;
803801 } ;
804802 }
805803 else if ( file . format == Phaser . Tilemap . CSV )
806804 {
807805 this . _xhr . onload = function ( ) {
808- return _this . csvLoadComplete ( this . _fileIndex ) ;
806+ return _this . csvLoadComplete ( _this . _fileIndex ) ;
809807 } ;
810808 }
811809 else
@@ -814,7 +812,7 @@ Phaser.Loader.prototype = {
814812 }
815813
816814 this . _xhr . onerror = function ( ) {
817- return _this . dataLoadError ( this . _fileIndex ) ;
815+ return _this . dataLoadError ( _this . _fileIndex ) ;
818816 } ;
819817 this . _xhr . send ( ) ;
820818 break ;
@@ -823,10 +821,10 @@ Phaser.Loader.prototype = {
823821 this . _xhr . open ( "GET" , this . baseURL + file . url , true ) ;
824822 this . _xhr . responseType = "text" ;
825823 this . _xhr . onload = function ( ) {
826- return _this . fileComplete ( this . _fileIndex ) ;
824+ return _this . fileComplete ( _this . _fileIndex ) ;
827825 } ;
828826 this . _xhr . onerror = function ( ) {
829- return _this . fileError ( this . _fileIndex ) ;
827+ return _this . fileError ( _this . _fileIndex ) ;
830828 } ;
831829 this . _xhr . send ( ) ;
832830 break ;
@@ -889,6 +887,8 @@ Phaser.Loader.prototype = {
889887 */
890888 fileComplete : function ( index ) {
891889
890+ console . log ( 'fileComplete' , index ) ;
891+
892892 if ( ! this . _fileList [ index ] )
893893 {
894894 console . warn ( 'Phaser.Loader fileComplete invalid index ' + index ) ;
@@ -1189,7 +1189,7 @@ Phaser.Loader.prototype = {
11891189
11901190 var total = 0 ;
11911191
1192- for ( var i = 0 ; i < this . _fileList ; i ++ )
1192+ for ( var i = 0 ; i < this . _fileList . length ; i ++ )
11931193 {
11941194 if ( this . _fileList [ i ] . loaded )
11951195 {
@@ -1210,7 +1210,7 @@ Phaser.Loader.prototype = {
12101210
12111211 var total = 0 ;
12121212
1213- for ( var i = 0 ; i < this . _fileList ; i ++ )
1213+ for ( var i = 0 ; i < this . _fileList . length ; i ++ )
12141214 {
12151215 if ( this . _fileList [ i ] . loaded === false )
12161216 {
0 commit comments