1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58 |
#pragma once
// Defines for UNICODE
#include <string>
#include <sstream>
#include <iostream>
#include <fstream>
#include <tchar.h>
using namespace std;
#ifdef _UNICODE // extra unicode defines
#define tstring wstring
#define tcin wcin
#define tcout wcout
#define tstringstream wstringstream
#define tofstream wofstream
#define tifstream wifstream
#define tfstream wfstream
#else
#define tstring string
#define tcin cin
#define tcout cout
#define tstringstream stringstream
#define tofstream ofstream
#define tifstream ifstream
#define tfstream fstream
#endif
// ASSERT macro
#ifndef NDEBUG
#define ASSERT \
if ( false ) {} \
else \
struct LocalAssert { \
int mLine; \
LocalAssert(int line=__LINE__) : mLine(line) {} \
LocalAssert(bool isOK, const TCHAR* message=_T("")) { \
if ( !isOK ) { \
tstringstream buffer; \
buffer << _T("ERROR!! Assert failed on line ") << LocalAssert().mLine << _T(" in file '") << __FILE__ << _T("'\nBoodschap: \"") << message << _T("\"\n"); \
OutputDebugString(buffer.str().c_str()); \
__asm { int 3 } \
} \
} \
} myAsserter = LocalAssert
#else
#define ASSERT \
if ( true ) {} else \
struct NoAssert { \
NoAssert(bool isOK, const TCHAR* message=_T("")) {} \
} myAsserter = NoAssert
#endif
// GAME_ENGINE define
#define GAME_ENGINE (GameEngine::GetSingleton()) |