#ifndef __IRR_OS_H_INCLUDED__
#define __IRR_OS_H_INCLUDED__
#include "IrrCompileConfig.h"
#include "irrTypes.h"
#include "irrString.h"
#include "path.h"
#include "ILogger.h"
#include "ITimer.h"
namespace irr
{
namespace os
{
class Byteswap
{
public:
static u16 byteswap(u16 num);
static s16 byteswap(s16 num);
static u32 byteswap(u32 num);
static s32 byteswap(s32 num);
static f32 byteswap(f32 num);
static u8 byteswap(u8 num);
static c8 byteswap(c8 num);
};
class Printer
{
public:
static void print(const c8* message);
static void log(const c8* message, ELOG_LEVEL ll = ELL_INFORMATION);
static void log(const wchar_t* message, ELOG_LEVEL ll = ELL_INFORMATION);
static void log(const c8* message, const c8* hint, ELOG_LEVEL ll = ELL_INFORMATION);
static void log(const c8* message, const io::path& hint, ELOG_LEVEL ll = ELL_INFORMATION);
static ILogger* Logger;
};
class Randomizer
{
public:
static void reset();
static s32 rand();
static f32 frand();
static s32 randMax();
private:
static s32 seed;
static const s32 m = 2147483399;
static const s32 a = 40692;
static const s32 q = m/a;
static const s32 r = m%a;
static const s32 rMax = m-1;
};
class Timer
{
public:
static u32 getTime();
static ITimer::RealTimeDate getRealTimeAndDate();
static void initTimer(bool usePerformanceTimer=true);
static void setTime(u32 time);
static void stopTimer();
static void startTimer();
static void setSpeed(f32 speed);
static f32 getSpeed();
static bool isStopped();
static void tick();
static u32 getRealTime();
private:
static void initVirtualTimer();
static f32 VirtualTimerSpeed;
static s32 VirtualTimerStopCounter;
static u32 StartRealTime;
static u32 LastVirtualTime;
static u32 StaticTime;
};
}
}
#endif