Krig Game Engine
Loading...
Searching...
No Matches
constants.h
1#ifndef _CONSTANTS_H_
2#define _CONSTANTS_H_
3
4#include <cstring>
5
6// Switches ///////////////////////////////////////////////////////////////////
7/*
8The FULL_SCREEN flag is disabled by default (set to 0).
9When the this flag is enabled (set to 1), Krig will launch with full screen
10rendering. Full screen rendering is not compatible with the EDIT flag and will
11be ignored when EDIT is also enabled.
12*/
13#define FULL_SCREEN 0
14/*
15The EDIT flag is disabled by default (set to 0).
16When the EDIT flag is enabled (set to 1), Krig will launch in edit mode. This
17mode is designed to aid in level creation. Edit mode gives users the ability to
18move around the level freely, manipulate the terrain, and experiment with
19certain level-specific variables which can be tweaked on the fly.
20*/
21#ifndef DEBUG
22#define EDIT 0
23/*
24The DEBUG flag is disabled by default (set to 0).
25To enable debug mode, set this value to 1. Debug mode will output debug messages
26to stdout in the console. Additionally, the state of debug flag can be queried
27from game scripts to provide debug-specific behavior.
28*/
29#define DEBUG 0
30/*
31The MSG_LVL setting is used with the DEBUG flag and is set to 0 by default.
32Lower values will output minimal debug. While higher values will output an
33increasingly larger number of messages.
34Be careful - higher numbers will output a lot of information!
35*/
36#define MSG_LVL 0
37#endif
38
39// General Constants //////////////////////////////////////////////////////////
40#define MAX_PATH_LEN 128
41
42// Logging Macros /////////////////////////////////////////////////////////////
43#define PRINT_DEBUG(format, ...) \
44 PRINT_DEBUG_LVL(0, format, ##__VA_ARGS__)
45
46#define PRINT_DEBUG_LVL(level, format, ...) \
47 if (DEBUG) PRINT_MESSAGE(level, format, "DEBUG", ##__VA_ARGS__)
48
49#define PRINT_ERROR(format, ...) \
50 PRINT_MESSAGE(0, format, "ERROR", ##__VA_ARGS__)
51
52#define PRINT_MESSAGE(level, format, type, ...) \
53 if (level <= MSG_LVL) \
54 printf("[%s|%s:%s] " format, type, \
55 strrchr(__FILE__, '/') + 1, \
56 __FUNCTION__, ##__VA_ARGS__);
57
58#endif