All pastes #2056468 Raw Edit

Something

public text v1 · immutable
#2056468 ·published 2011-05-10 21:53 UTC
rendered paste body
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<size;k++)
	{
		unsigned char temp[8][8];
		for(i=0;i<8;i++)
			for(j=0;j<4;j++)
			{
				temp[i][j*2]=target[l+(i*4)+j]>>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;
	}	
}