File tree Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -486,12 +486,12 @@ function readTiles(reader, world) {
486
486
487
487
tilesProcessed += world . height ;
488
488
489
- if ( x % 2 == 0 ) {
489
+ if ( x % 2 == 1 ) {
490
490
self . postMessage ( {
491
491
'status' : "Reading tile " + tilesProcessed . toLocaleString ( ) + " of " + world . totalTileCount . toLocaleString ( ) ,
492
492
// 'tilesProcessed': tilesProcessed,
493
493
// 'totalTileCount': world.totalTileCount,
494
- 'x' : x ,
494
+ 'x' : x - 1 ,
495
495
'tiles' : tiles ,
496
496
} ) ;
497
497
tiles = [ ] ;
Original file line number Diff line number Diff line change @@ -764,17 +764,12 @@ function onWorldLoaderWorkerMessage(e) {
764
764
if ( e . data . status )
765
765
$ ( "#status" ) . html ( e . data . status ) ;
766
766
767
- var x = 0 ;
768
- var i = 0 ;
769
- var tile ;
770
-
771
767
if ( e . data . tiles ) {
772
- x = e . data . x ;
773
-
774
- for ( x = e . data . x ; x <= e . data . x + 1 ; x ++ ) {
775
- for ( y = 0 ; y < e . data . tiles . length / 2 ; y ++ ) {
776
- tile = e . data . tiles [ y ] ;
777
-
768
+ let xlimit = e . data . x + e . data . tiles . length / world . height ;
769
+ let i = 0 ;
770
+ for ( let x = e . data . x ; x < xlimit ; x ++ ) {
771
+ for ( let y = 0 ; y < world . height ; y ++ ) {
772
+ let tile = e . data . tiles [ i ++ ] ;
778
773
if ( tile ) {
779
774
tile . info = getTileInfo ( tile ) ;
780
775
world . tiles . push ( tile ) ;
You can’t perform that action at this time.
0 commit comments