1313Phaser . TilemapParser = {
1414
1515 /**
16- * When scanning the Tiled map data the TilemapParser can either insert a null value (true) or
16+ * When scanning the Tiled map data the TilemapParser can either insert a null value (true) or
1717 * a Phaser.Tile instance with an index of -1 (false, the default). Depending on your game type
1818 * depends how this should be configured. If you've a large sparsely populated map and the tile
1919 * data doesn't need to change then setting this value to `true` will help with memory consumption.
@@ -233,15 +233,15 @@ Phaser.TilemapParser = {
233233 }
234234
235235 var curl = json . layers [ i ] ;
236-
236+
237237 // Base64 decode data if necessary
238- // NOTE: uncompressed base64 only.
238+ // NOTE: uncompressed base64 only.
239239 if ( ! curl . compression && curl . encoding && curl . encoding === "base64" ) {
240240 var binaryString = window . atob ( curl . data ) ;
241241 var len = binaryString . length ;
242242 var bytes = new Array ( len ) ;
243243 // Interpret binaryString as an array of bytes representing
244- // little-endian encoded uint32 values.
244+ // little-endian encoded uint32 values.
245245 for ( var j = 0 ; j < len ; j += 4 ) {
246246 bytes [ j / 4 ] = ( binaryString . charCodeAt ( j ) |
247247 binaryString . charCodeAt ( j + 1 ) << 8 |
@@ -250,6 +250,10 @@ Phaser.TilemapParser = {
250250 }
251251 curl . data = bytes ;
252252 }
253+ else if ( curl . compression ) {
254+ console . warn ( 'TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer \'' + curl . name + '\'' ) ;
255+ continue ;
256+ }
253257
254258
255259 var layer = {
@@ -292,7 +296,7 @@ Phaser.TilemapParser = {
292296 flipped = false ;
293297 gid = curl . data [ t ] ;
294298
295- // If true the current tile is flipped or rotated (Tiled TMX format)
299+ // If true the current tile is flipped or rotated (Tiled TMX format)
296300 if ( gid > 0x20000000 )
297301 {
298302 flippedVal = 0 ;
@@ -317,7 +321,7 @@ Phaser.TilemapParser = {
317321 gid -= 0x20000000 ;
318322 flippedVal += 1 ;
319323 }
320-
324+
321325 switch ( flippedVal )
322326 {
323327 case 5 :
@@ -446,7 +450,7 @@ Phaser.TilemapParser = {
446450 else
447451 {
448452 var newCollection = new Phaser . ImageCollection ( set . name , set . firstgid , set . tilewidth , set . tileheight , set . margin , set . spacing , set . properties ) ;
449-
453+
450454 for ( var ti in set . tiles )
451455 {
452456 var image = set . tiles [ ti ] . image ;
0 commit comments