forked from GuillemFP/DoubleDragon3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Globals.h
52 lines (41 loc) · 1.12 KB
/
Globals.h
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
#ifndef GLOBALS_H
#define GLOBALS_H
#include "MemLeaks.h"
#include <cassert>
#define LOG(format, ...) log(__FILE__, __LINE__, format, __VA_ARGS__);
void log(const char file[], int line, const char* format, ...);
#define MIN( a, b ) ( ((a) < (b)) ? (a) : (b) )
#define MAX( a, b ) ( ((a) > (b)) ? (a) : (b) )
enum update_status
{
UPDATE_CONTINUE = 1,
UPDATE_STOP,
UPDATE_ERROR
};
struct Point3d
{
int x = 0, y = 0, z = 0;
Point3d(int x = 0, int y = 0, int z = 0) : x(x), y(y), z(z) {}
};
// Deletes a buffer
#define RELEASE( x ) \
{ \
if( x != nullptr ) \
{ \
delete x; \
x = nullptr; \
} \
}
// Deletes an array of buffers
#define RELEASE_ARRAY( x ) \
{ \
if( x != nullptr ) \
{ \
delete[] x; \
x = nullptr; \
} \
\
}
// Configuration from JSON file -----------
#define CONFIGJSON "config.json"
#endif // !GLOBALS_H