diff --git a/polymer/eduke32/source/android/etcpak/ProcessRGB.cpp b/polymer/eduke32/source/android/etcpak/ProcessRGB.cpp index 2c23ae4cb..0e0cf17f5 100644 --- a/polymer/eduke32/source/android/etcpak/ProcessRGB.cpp +++ b/polymer/eduke32/source/android/etcpak/ProcessRGB.cpp @@ -12,6 +12,11 @@ namespace { +static inline uint32 byteswap(uint32 l) +{ + return ((l >> 8u) & 0xff00u) | ((l & 0xff00u) << 8u) | (l << 24u) | (l >> 24u); +} + typedef std::array v4i; void Average( const uint8* data, v4i* a ) @@ -361,8 +366,8 @@ std::pair Planar(const uint8* src) lo |= g_flags[idx]; - uint64 result = static_cast(_bswap(lo)); - result |= static_cast(static_cast(_bswap(hi))) << 32; + uint64 result = static_cast(byteswap(lo)); + result |= static_cast(static_cast(byteswap(hi))) << 32; return std::make_pair(result, error); }