Merge pull request #30 from Yamagi/bswap32

bswap_32() is a linuxism, use inline code instead.
This commit is contained in:
Ryan C. Gordon 2016-04-19 13:11:33 -04:00
commit 26b4941010

View File

@ -25,9 +25,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <Engine/Graphics/Fog_internal.h>
#include <Engine/Graphics/GfxProfile.h>
#include <Engine/Graphics/ImageInfo.h>
#ifdef USE_PORTABLE_C
# include <byteswap.h>
#endif
// asm shortcuts
#define O offset
@ -75,7 +72,8 @@ ULONG PrepareTexture( UBYTE *pubTexture, PIX pixSizeI, PIX pixSizeJ)
DWORD* dst = (DWORD*)(pubTexture+pixTextureSize);
for (int i=0; i<pixTextureSize; i++) {
const DWORD tmp = ((DWORD)*src) | 0xFFFFFF00;
*dst = bswap_32(tmp);
*dst = ((tmp << 24) & 0xff000000 ) | ((tmp << 8) & 0x00ff0000 ) |
((tmp >> 8) & 0x0000ff00 ) | ((tmp >> 24) & 0x000000ff );
src++;
dst++;
}