mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-25 19:55:54 +01:00
Merge pull request #30 from Yamagi/bswap32
bswap_32() is a linuxism, use inline code instead.
This commit is contained in:
commit
26b4941010
|
@ -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