public static boolean compareTile ( int tw , int th , ImageBuffer a , int xa , int ya , ImageBuffer b , int xb , int yb ) { for ( int x = 0 ; x < tw ; x ++ ) { for ( int y = 0 ; y < th ; y ++ ) { final int colorA = a . getRgb ( x + xa , y + ya ) ; final int colorB = b . getRgb ( x + xb , y + yb ) ; if ( colorA != colorB ) { return false ; } } } return true ; }
Compare two tiles by checking all pixels .