static void rotate_tile(unsigned int size,unsigned char *target) { unsigned char rotate[8][8]; unsigned int i,j,k,l=0; for (k=0;k>4; temp[i][(j*2)+1]=target[l+(i*4)+j]&0x0f; } for(i=0;i<8;i++) for(j=0;j<8;j++) rotate[i][j]=temp[8-j-1][i]; for(i=0;i<8;i++) for(j=0;j<8;j++) temp[i][j]= rotate[i][j]; for(i=0;i<8;i++) for(j=0;j<8;j+=2) target[l+i*4+(j/2)]= (temp[i][j]<<4)|temp[i][j+1] ; l+=32; } }