func: void tile_manager_write_pixel_data(TileManager *tm,gint x1,gint y1,gint x2,gint y2,const guchar *buffer,guint stride) guint x ; guint y ; for (y = y1; y <= y2; y += 64 - y % 64) for (x = x1; x <= x2; x += 64 - x % 64) Tile * tile = tile_manager_get_tile ( tm , x , y , ! 0 , ! 0 ) ; Tile *tile_manager_get_tile(TileManager *tm,gint xpixel,gint ypixel,gboolean wantread,gboolean wantwrite) if ( tm != ( ( void * ) 0 ) )  return ( ( void * ) 0 ) ; while ( 0 )  return tile_manager_get ( tm , tile_manager_get_tile_num ( tm , xpixel , ypixel ) , wantread , wantwrite ) ; inline static gint tile_manager_get_tile_num(TileManager *tm,gint xpixel,gint ypixel) if ( xpixel < 0 || xpixel >= tm -> width || ypixel < 0 || ypixel >= tm -> height )  return - 1 ; return ypixel / 64 * tm -> ntile_cols + xpixel / 64 ; Tile *tile_manager_get(TileManager *tm,gint tile_num,gboolean wantread,gboolean wantwrite) Tile * tile ; gint ntiles ; if ( tm != ( ( void * ) 0 ) )  return ( ( void * ) 0 ) ; while ( 0 )  ntiles = tm -> ntile_rows * tm -> ntile_cols; if ( tile_num < 0 || tile_num >= ntiles )  return ( ( void * ) 0 ) ; tile = tm -> tiles [ tile_num ]; if ( wantread )  if ( wantwrite )  if ( tile -> share_count > 1 )  Tile * new = tile_new ( ( tile -> bpp ) new -> ewidth = tile -> new -> eheight = tile -> new -> valid = ( tile -> valid new -> size = ( new -> ewidth ) * ( new -> eheight ) * ( new -> bpp new -> data = ( ( guchar * ) ( g_malloc_n ( ( new -> size ) , sizeof ( guchar ) ) ) ) if ( tile -> data )  memcpy ( ( new -> data ) , ( tile -> data ) , ( new -> size ) ) memcpy ( ( new -> data ) , ( tile -> data ) , ( new -> size ) ) tile_attach ( new , tm , tile_num tile = new tile -> write_count ++; tile -> dirty = ( ! 0 ); return tile ; const guchar * s = buffer + stride * ( y - y1 ) + ( tm -> bpp ) * ( x - x1 ) ; guchar * d = tile -> data + ( ( y & ( 64 - 1 ) ) * ( tile -> ewidth ) + ( x & ( 64 - 1 ) ) ) * ( tile -> bpp ) ; guint rows ; guint cols ; guint dststride ; rows = ( tile -> eheight ) - y % 64; if ( rows > y2 - y + 1 )  rows = y2 - y + 1; cols = ( tile -> ewidth ) - x % 64; if ( cols > x2 - x + 1 )  cols = x2 - x + 1; dststride = ( ( tile -> ewidth ) * ( tile -> bpp ) ); while ( rows -- )  memcpy ( d , s , ( cols * ( tm -> bpp ) ) ); s += stride; d += dststride; 