mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-02 00:00:26 +02:00
Reformat the code, using:
find -type f | # list all regular files grep -E '\.(h|cpp|mm)$' | # filter for source files grep -v '/mt_' | # filter out generated files grep -v '/vendor/' | # and vendored GL grep -v '/test/image_loader_test.cpp' | # and this file (has giant literals arrays) xargs -n 1 -P $(nproc) clang-format -i # reformat everything Co-authored-by: numzero <numzer0@yandex.ru>
This commit is contained in:
@ -15,79 +15,77 @@ 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 u64 byteswap(u64 num);
|
||||
static s64 byteswap(s64 num);
|
||||
static f32 byteswap(f32 num);
|
||||
// prevent accidental swapping of chars
|
||||
static inline u8 byteswap(u8 num) { return num; }
|
||||
static inline c8 byteswap(c8 num) { return num; }
|
||||
};
|
||||
class Byteswap
|
||||
{
|
||||
public:
|
||||
static u16 byteswap(u16 num);
|
||||
static s16 byteswap(s16 num);
|
||||
static u32 byteswap(u32 num);
|
||||
static s32 byteswap(s32 num);
|
||||
static u64 byteswap(u64 num);
|
||||
static s64 byteswap(s64 num);
|
||||
static f32 byteswap(f32 num);
|
||||
// prevent accidental swapping of chars
|
||||
static inline u8 byteswap(u8 num) { return num; }
|
||||
static inline c8 byteswap(c8 num) { return num; }
|
||||
};
|
||||
|
||||
class Printer
|
||||
{
|
||||
public:
|
||||
// prints out a string to the console out stdout or debug log or whatever
|
||||
static void print(const c8* message, ELOG_LEVEL ll = ELL_INFORMATION);
|
||||
static void log(const c8* message, ELOG_LEVEL ll = ELL_INFORMATION);
|
||||
static void log(const wchar_t* message, ELOG_LEVEL ll = ELL_INFORMATION);
|
||||
class Printer
|
||||
{
|
||||
public:
|
||||
// prints out a string to the console out stdout or debug log or whatever
|
||||
static void print(const c8 *message, ELOG_LEVEL ll = ELL_INFORMATION);
|
||||
static void log(const c8 *message, ELOG_LEVEL ll = ELL_INFORMATION);
|
||||
static void log(const wchar_t *message, ELOG_LEVEL ll = ELL_INFORMATION);
|
||||
|
||||
// The string ": " is added between message and hint
|
||||
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;
|
||||
};
|
||||
// The string ": " is added between message and hint
|
||||
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 Timer
|
||||
{
|
||||
public:
|
||||
class Timer
|
||||
{
|
||||
public:
|
||||
//! returns the current time in milliseconds
|
||||
static u32 getTime();
|
||||
|
||||
//! returns the current time in milliseconds
|
||||
static u32 getTime();
|
||||
//! initializes the real timer
|
||||
static void initTimer();
|
||||
|
||||
//! initializes the real timer
|
||||
static void initTimer();
|
||||
//! sets the current virtual (game) time
|
||||
static void setTime(u32 time);
|
||||
|
||||
//! sets the current virtual (game) time
|
||||
static void setTime(u32 time);
|
||||
//! stops the virtual (game) timer
|
||||
static void stopTimer();
|
||||
|
||||
//! stops the virtual (game) timer
|
||||
static void stopTimer();
|
||||
//! starts the game timer
|
||||
static void startTimer();
|
||||
|
||||
//! starts the game timer
|
||||
static void startTimer();
|
||||
//! sets the speed of the virtual timer
|
||||
static void setSpeed(f32 speed);
|
||||
|
||||
//! sets the speed of the virtual timer
|
||||
static void setSpeed(f32 speed);
|
||||
//! gets the speed of the virtual timer
|
||||
static f32 getSpeed();
|
||||
|
||||
//! gets the speed of the virtual timer
|
||||
static f32 getSpeed();
|
||||
//! returns if the timer currently is stopped
|
||||
static bool isStopped();
|
||||
|
||||
//! returns if the timer currently is stopped
|
||||
static bool isStopped();
|
||||
//! makes the virtual timer update the time value based on the real time
|
||||
static void tick();
|
||||
|
||||
//! makes the virtual timer update the time value based on the real time
|
||||
static void tick();
|
||||
//! returns the current real time in milliseconds
|
||||
static u32 getRealTime();
|
||||
|
||||
//! returns the current real time in milliseconds
|
||||
static u32 getRealTime();
|
||||
private:
|
||||
static void initVirtualTimer();
|
||||
|
||||
private:
|
||||
|
||||
static void initVirtualTimer();
|
||||
|
||||
static f32 VirtualTimerSpeed;
|
||||
static s32 VirtualTimerStopCounter;
|
||||
static u32 StartRealTime;
|
||||
static u32 LastVirtualTime;
|
||||
static u32 StaticTime;
|
||||
};
|
||||
static f32 VirtualTimerSpeed;
|
||||
static s32 VirtualTimerStopCounter;
|
||||
static u32 StartRealTime;
|
||||
static u32 LastVirtualTime;
|
||||
static u32 StaticTime;
|
||||
};
|
||||
|
||||
} // end namespace os
|
||||
} // end namespace irr
|
||||
|
Reference in New Issue
Block a user