9 #ifndef Navigation_Endianness_H
10 #define Navigation_Endianness_H
42 #if defined(KY_OS_XBOX360) || defined(KY_OS_PS3) || defined(KY_OS_WII) || defined(KY_OS_WIIU)
84 static inline void Swap16(
void* x)
92 static inline void Swap32(
void* x)
96 ( ( (*(
KyUInt32*)x) << 8 ) & 0x00FF0000 ) |
97 ( ( (*(
KyUInt32*)x) >> 8 ) & 0x0000FF00 ) |
102 static inline void Swap64(
void* x)
106 ( ( (*(
KyUInt64*)x) << 40 ) & 0x00FF000000000000ULL ) |
107 ( ( (*(
KyUInt64*)x) << 24 ) & 0x0000FF0000000000ULL ) |
108 ( ( (*(
KyUInt64*)x) << 8 ) & 0x000000FF00000000ULL ) |
109 ( ( (*(
KyUInt64*)x) >> 8 ) & 0x00000000FF000000ULL ) |
110 ( ( (*(
KyUInt64*)x) >> 24 ) & 0x0000000000FF0000ULL ) |
111 ( ( (*(
KyUInt64*)x) >> 40 ) & 0x000000000000FF00ULL ) |
157 template <
class OSTREAM>
The opposite endianness type from the current platform.
Definition: endianness.h:38
static void Swap64(void *x)
Swaps the endianness of the data in a 64-bit buffer.
Definition: endianness.h:104
The same endianness type as the current platform.
Definition: endianness.h:37
static void Swap32(void *x)
Swaps the endianness of the data in a 32-bit buffer.
Definition: endianness.h:94
static Type GetSystemEndianness()
Retrieves the endianness of the current platform.
Definition: endianness.h:42
int KyInt32
Type used internally to represent a 32-bit integer.
Definition: types.h:35
static Type GetEndiannessFromMem32(const KyUInt32 *mem)
Retrieves the endianness from a 4-byte memory location.
Definition: endianness.h:64
Big-endian format (used, for example, for PlayStation 3, Xbox 360).
Definition: endianness.h:31
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
unsigned __int64 KyUInt64
Type used internally to represent an unsigned 64-bit integer.
Definition: types.h:38
Little-endian format (used, for example, for Windows, Linux).
Definition: endianness.h:30
unsigned char KyUInt8
Type used internally to represent an unsigned 8-bit integer.
Definition: types.h:41
static Type GetInverseEndianness(Type endianness)
Retrieves the endianness opposite to the specified type.
Definition: endianness.h:58
Definition: gamekitcrowddispersion.h:20
static void SetEndiannessToMem32(Type endianness, KyUInt32 *mem)
Sets a 4-byte memory location to the specified endianness.
Definition: endianness.h:70
unsigned short KyUInt16
Type used internally to represent an unsigned 16-bit integer.
Definition: types.h:40
static void SwapEndiannessInMem32(KyUInt32 *mem)
Swaps the endianness in a 4-byte memory location.
Definition: endianness.h:78
signed char KyInt8
Type used internally to represent an 8-bit integer.
Definition: types.h:42
Type
Enumerates possible endianness types.
Definition: endianness.h:28
static Type GetInverseSystemEndianness()
Retrieves the endianness opposite to that of the current platform.
Definition: endianness.h:52
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
static void Swap16(void *x)
Swaps the endianness of the data in a 16-bit buffer.
Definition: endianness.h:86
__int64 KyInt64
Type used internally to represent a 64-bit integer.
Definition: types.h:37
short KyInt16
Type used internally to represent a 16-bit integer.
Definition: types.h:39
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43