mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-22 10:20:26 +01:00
bswap_32() is a linuxism, use inline code instead.
bswap_32() is a function specific to Linux, unavailable on FreeBSD and OS X. Instead of messing with other platform specific functions, #ifdef and so on provide a fast inline implementation.
This commit is contained in:
parent
fd1ba82bc8
commit
794180c598
|
@ -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/Fog_internal.h>
|
||||||
#include <Engine/Graphics/GfxProfile.h>
|
#include <Engine/Graphics/GfxProfile.h>
|
||||||
#include <Engine/Graphics/ImageInfo.h>
|
#include <Engine/Graphics/ImageInfo.h>
|
||||||
#ifdef USE_PORTABLE_C
|
|
||||||
# include <byteswap.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// asm shortcuts
|
// asm shortcuts
|
||||||
#define O offset
|
#define O offset
|
||||||
|
@ -75,7 +72,8 @@ ULONG PrepareTexture( UBYTE *pubTexture, PIX pixSizeI, PIX pixSizeJ)
|
||||||
DWORD* dst = (DWORD*)(pubTexture+pixTextureSize);
|
DWORD* dst = (DWORD*)(pubTexture+pixTextureSize);
|
||||||
for (int i=0; i<pixTextureSize; i++) {
|
for (int i=0; i<pixTextureSize; i++) {
|
||||||
const DWORD tmp = ((DWORD)*src) | 0xFFFFFF00;
|
const DWORD tmp = ((DWORD)*src) | 0xFFFFFF00;
|
||||||
*dst = bswap_32(tmp);
|
*dst = ((tmp << 24) & 0xff000000 ) | ((tmp << 8) & 0x00ff0000 ) |
|
||||||
|
((tmp >> 8) & 0x0000ff00 ) | ((tmp >> 24) & 0x000000ff );
|
||||||
src++;
|
src++;
|
||||||
dst++;
|
dst++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user