This repository has been archived on 2025-03-10. You can view files and clone it, but cannot push or open issues or pull requests.
Grayson Riffe (Laptop) e8bc0903e6 Added state changing
2021-08-18 13:54:06 -05:00

36 lines
1.1 KiB
C++

#pragma once
#include <chrono>
#include <thread>
#include <iostream>
#include <string>
namespace nf {
#ifdef _DEBUG
#define __FILENAME__ strrchr(__FILE__, '\\') + 1
#define DEBUGINIT std::chrono::steady_clock::time_point Debug::m_initTime = std::chrono::high_resolution_clock::now();
#define SleepS(x) std::this_thread::sleep_for(std::chrono::seconds(x))
#define SleepMS(x) std::this_thread::sleep_for(std::chrono::milliseconds(x))
#define Log(x) nf::Debug::LogImp(x)
#define Error(x) nf::Debug::ErrorImp(x,__FILENAME__, __LINE__);\
DebugBreak();
class Debug {
private:
static std::chrono::steady_clock::time_point m_initTime;
static std::chrono::duration<float> getCurrentTime();
public:
static void LogImp(const char* in);
static void LogImp(const std::string& in);
static void LogImp(int in);
static void LogImp(double in);
static void ErrorImp(const char* in, const char* filename, int line);
};
#else
#define DEBUGINIT
#define Log(x)
#define Error(x) MessageBox(FindWindow(L"NFClass", NULL), toWide(x), L"NF Engine Error", MB_OK | MB_ICONERROR);\
std::exit(-1)
#endif
const wchar_t* toWide(const char* in);
}