protected void renderIsometricMap ( int x , int y , int sx , int sy , int width , int height , Layer layer , boolean lineByLine ) { ArrayList drawLayers = layers ; if ( layer != null ) { drawLayers = new ArrayList ( ) ; drawLayers . add ( layer ) ; } int maxCount = width * height ; int allCount = 0 ; boolean allProcessed = false ; int initialLineX = x ; int initialLineY = y ; int startLineTileX = 0 ; int startLineTileY = 0 ; while ( ! allProcessed ) { int currentTileX = startLineTileX ; int currentTileY = startLineTileY ; int currentLineX = initialLineX ; int min = 0 ; if ( height > width ) min = ( startLineTileY < width - 1 ) ? startLineTileY : ( width - currentTileX < height ) ? width - currentTileX - 1 : width - 1 ; else min = ( startLineTileY < height - 1 ) ? startLineTileY : ( width - currentTileX < height ) ? width - currentTileX - 1 : height - 1 ; for ( int burner = 0 ; burner <= min ; currentTileX ++ , currentTileY -- , burner ++ ) { for ( int layerIdx = 0 ; layerIdx < drawLayers . size ( ) ; layerIdx ++ ) { Layer currentLayer = ( Layer ) drawLayers . get ( layerIdx ) ; currentLayer . render ( currentLineX , initialLineY , currentTileX , currentTileY , 1 , 0 , lineByLine , tileWidth , tileHeight ) ; } currentLineX += tileWidth ; allCount ++ ; } // System.out.println("Line : " + counter++ + " - " + count + // "allcount : " + allCount); if ( startLineTileY < ( height - 1 ) ) { startLineTileY += 1 ; initialLineX -= tileWidth / 2 ; initialLineY += tileHeight / 2 ; } else { startLineTileX += 1 ; initialLineX += tileWidth / 2 ; initialLineY += tileHeight / 2 ; } if ( allCount >= maxCount ) allProcessed = true ; } }
Render of isometric map renders .