@@ -23,7 +23,8 @@ Phaser.Animation.Parser = {
2323 // How big is our image?
2424 var img = game . cache . getImage ( key ) ;
2525
26- if ( img == null ) {
26+ if ( img == null )
27+ {
2728 return null ;
2829 }
2930
@@ -33,13 +34,15 @@ Phaser.Animation.Parser = {
3334 var column = Math . round ( height / frameHeight ) ;
3435 var total = row * column ;
3536
36- if ( frameMax !== - 1 ) {
37+ if ( frameMax !== - 1 )
38+ {
3739 total = frameMax ;
3840 }
3941
4042 // Zero or smaller than frame sizes?
41- if ( width == 0 || height == 0 || width < frameWidth || height < frameHeight || total === 0 ) {
42- throw new Error ( "AnimationLoader.parseSpriteSheet: width/height zero or width/height < given frameWidth/frameHeight" ) ;
43+ if ( width == 0 || height == 0 || width < frameWidth || height < frameHeight || total === 0 )
44+ {
45+ console . warn ( "Phaser.Animation.Parser.spriteSheet: width/height zero or width/height < given frameWidth/frameHeight" ) ;
4346 return null ;
4447 }
4548
@@ -82,9 +85,11 @@ Phaser.Animation.Parser = {
8285 JSONData : function ( game , json , cacheKey ) {
8386
8487 // Malformed?
85- if ( ! json [ 'frames' ] ) {
88+ if ( ! json [ 'frames' ] )
89+ {
90+ console . warn ( "Phaser.Animation.Parser.JSONData: Invalid Texture Atlas JSON given, missing 'frames' array" ) ;
8691 console . log ( json ) ;
87- throw new Error ( "Phaser.AnimationLoader.parseJSONData: Invalid Texture Atlas JSON given, missing 'frames' array" ) ;
92+ return ;
8893 }
8994
9095 // Let's create some frames then
@@ -143,14 +148,16 @@ Phaser.Animation.Parser = {
143148 JSONDataHash : function ( game , json , cacheKey ) {
144149
145150 // Malformed?
146- if ( ! json [ 'frames' ] ) {
151+ if ( ! json [ 'frames' ] )
152+ {
153+ console . warn ( "Phaser.Animation.Parser.JSONDataHash: Invalid Texture Atlas JSON given, missing 'frames' object" ) ;
147154 console . log ( json ) ;
148- throw new Error ( "Phaser.AnimationLoader.parseJSONDataHash: Invalid Texture Atlas JSON given, missing 'frames' object" ) ;
155+ return ;
149156 }
150157
151158 // Let's create some frames then
152159 var data = new Phaser . Animation . FrameData ( ) ;
153-
160+
154161 // By this stage frames is a fully parsed array
155162 var frames = json [ 'frames' ] ;
156163 var newFrame ;
@@ -204,8 +211,10 @@ Phaser.Animation.Parser = {
204211 XMLData : function ( game , xml , cacheKey ) {
205212
206213 // Malformed?
207- if ( ! xml . getElementsByTagName ( 'TextureAtlas' ) ) {
208- throw new Error ( "Phaser.AnimationLoader.parseXMLData: Invalid Texture Atlas XML given, missing <TextureAtlas> tag" ) ;
214+ if ( ! xml . getElementsByTagName ( 'TextureAtlas' ) )
215+ {
216+ console . warn ( "Phaser.Animation.Parser.XMLData: Invalid Texture Atlas XML given, missing <TextureAtlas> tag" ) ;
217+ return ;
209218 }
210219
211220 // Let's create some frames then
0 commit comments