void networkToMachineOrder(void *buffer, int width, int count) { if ( boost::is_same<MachineByteOrder, NetworkByteOrder>::value ) { reverseByteOrder(buffer, width, count); } }
// Reverse the order of the bytes void BitmapFont::reverseBitmapOrder(GLubyte* bitmap, unsigned int numBitmapBytes, unsigned int numBytesWide) { GLubyte* temp = new GLubyte[numBytesWide]; for (unsigned int i = 0; i < numBitmapBytes/2; i += numBytesWide) { unsigned int j = 0; for (j = 0; j < numBytesWide; j++) temp[j] = reverseByteOrder(bitmap[i+j]); for (j = 0; j < numBytesWide; j++) bitmap[i+j] = reverseByteOrder(bitmap[numBitmapBytes-i-numBytesWide+j]); for (j = 0; j < numBytesWide; j++) bitmap[numBitmapBytes-i-numBytesWide+j] = temp[j]; } delete [] temp; }