mirror of https://github.com/PrimeDecomp/prime.git
29 lines
443 B
C++
29 lines
443 B
C++
#ifndef _CBASICS
|
|
#define _CBASICS
|
|
|
|
#include "types.h"
|
|
|
|
namespace CBasics {
|
|
void Init();
|
|
char* Stringize(const char* fmt, ...);
|
|
inline uint SwapBytes(uint x) {
|
|
#if 0
|
|
x = ((x << 24) | ((x << 8) & 0x00FF0000) | ((x >> 8) & 0x0000FF00) | (x >> 24));
|
|
#endif
|
|
return x;
|
|
}
|
|
inline float SwapBytes(float x) {
|
|
union {
|
|
float f;
|
|
uint u;
|
|
};
|
|
f = x;
|
|
#if 0
|
|
u = SwapBytes(u);
|
|
#endif
|
|
return f;
|
|
}
|
|
}; // namespace CBasics
|
|
|
|
#endif // _CBASICS
|