-
Notifications
You must be signed in to change notification settings - Fork 5
/
global.h
119 lines (102 loc) · 2.2 KB
/
global.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
Copyright 2013-2015 Rohit Nirmal
This file is part of Clonepoint.
Clonepoint is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clonepoint is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clonepoint. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GLOBAL_H
#define GLOBAL_H
#if 0
#define LOGF(a) fprintf a
#else
#define LOGF(a) (void)0
#endif
# define MY_PI 3.14159265358979323846
#define ToRadian(x) ((x) * MY_PI / 180.0f)
#define ToDegree(x) ((x) * 180.0f / MY_PI)
#ifdef DEBUG
#define Assert(x) if (!x) { printf("Assertion failed!\n"); *(int*)0 = 0; }
#else
#define Assert(x)
#endif
#define ENTDIM 128
#define COLLISION_ACTIVE (1 << 0)
#define COLLISION_GLASS (1 << 1)
#define COLLISION_DOOR (1 << 2)
#define COLLISION_GUARDBLOCK (1 << 3) //invisible volume that makes guards turn around.
struct Rect
{
float x;
float y;
float w;
float h;
};
struct CollisionVolume
{
Rect rect;
unsigned int flags;
bool active() { return flags & COLLISION_ACTIVE; }
bool glass() { return flags & COLLISION_GLASS; }
bool door() { return flags & COLLISION_DOOR; }
bool guardblock() { return flags & COLLISION_GUARDBLOCK; }
};
enum Circuit
{
BLUE = 0,
GREEN,
YELLOW,
VIOLET,
RED
};
enum Direction
{
Left = 0,
Right
};
enum MouseOverObject
{
MO_CircuitBox = 0,
MO_MainComputer,
MO_LightFixture,
MO_Switch,
MO_HandScanner,
MO_Elevator,
MO_MotionScanner,
MO_Door,
MO_TrapDoor,
MO_VaultDoor,
MO_SoundDetector,
MO_Alarm,
MO_PowerSocket,
MO_SecurityCamera,
MO_Guard,
MO_Enforcer,
MO_Professional,
MO_Sniper,
NUMBER_OF_MOUSEOVER_OBJECTS
};
enum StringMessage
{
SM_Start = 0,
SM_Jumping,
SM_Falling,
SM_Guards1,
SM_Guards2,
SM_Crosslink1,
SM_Crosslink2,
SM_Objectives,
SM_Elevators,
SM_Optional,
SM_Circuits,
SM_ObjectivesIncomplete,
NUMBER_OF_STRING_MESSAGES
};
#endif