1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 1998-2000, Matthes Bender
5  * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
6  * Copyright (c) 2009-2016, The OpenClonk Team and contributors
7  *
8  * Distributed under the terms of the ISC license; see accompanying file
9  * "COPYING" for details.
10  *
11  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
12  * See accompanying file "TRADEMARK" for details.
13  *
14  * To redistribute this file separately, substitute the full license texts
15  * for the above references.
16  */
17 
18 /* Lots of constants */
19 
20 #ifndef INC_C4Constants
21 #define INC_C4Constants
22 
23 //============================= Main =====================================================
24 
25 const size_t C4MaxTitle = 512;
26 const int
27 	C4MaxDefString = 100,
28 	C4MaxMessage = 256,
29 	C4RetireDelay =  60,
30 	C4MaxKey = 12,
31 	C4MaxKeyboardSet = 4,
32 	C4MaxControlSet = C4MaxKeyboardSet+4, // keyboard sets+gamepads
33 	C4MaxControlRate = 20,
34 	C4MaxGammaUserRamps = 8,
35 	C4MaxGammaRamps = C4MaxGammaUserRamps+1;
36 
37 // gamma ramp indices
38 #define   C4GRI_SCENARIO  0
39 #define   C4GRI_SEASON    1
40 #define   C4GRI_RESERVED1 2
41 #define   C4GRI_DAYTIME   3
42 #define   C4GRI_RESERVED2 4
43 #define   C4GRI_LIGHTNING 5
44 #define   C4GRI_MAGIC     6
45 #define   C4GRI_RESERVED3 7
46 #define   C4GRI_USER      8
47 
48 const int
49 	C4M_MaxName = 15,
50 	C4M_MaxDefName = 2*C4M_MaxName+1,
51 	C4M_MaxTexIndex = 255; // last texture map index is reserved for diff
52 
53 const int C4S_MaxPlayer = 4;
54 
55 const int C4D_MaxVertex = 30;
56 
57 const int
58 	C4SymbolSize = 35,
59 	C4UpperBoardHeight = 50,
60 	C4PictureSize = 64,
61 	C4MaxBigIconSize = 64;
62 
63 const int C4P_MaxPosition = 4;
64 
65 const int C4ViewportScrollBorder = 40; // scrolling past landscape allowed at range of this border
66 
67 //============================= Engine Return Values ======================================
68 
69 const int
70 	C4XRV_Completed = 0,
71 	C4XRV_Failure = 1,
72 	C4XRV_Aborted = 2;
73 
74 //============================= Object Character Flags ====================================
75 
76 const uint32_t
77 	OCF_None = 0,
78 	OCF_All = ~OCF_None,
79 	OCF_Normal = 1,
80 	OCF_Construct = 1<<1,
81 	OCF_Grab = 1<<2,
82 	OCF_Carryable = 1<<3,
83 	OCF_OnFire = 1<<4,
84 	OCF_HitSpeed1 = 1<<5,
85 	OCF_FullCon = 1<<6,
86 	OCF_Inflammable = 1<<7,
87 
88 	OCF_Rotate = 1<<9,
89 	OCF_Exclusive = 1<<10,
90 	OCF_Entrance = 1<<11,
91 	OCF_HitSpeed2 = 1<<12,
92 	OCF_HitSpeed3 = 1<<13,
93 	OCF_Collection = 1<<14,
94 
95 	OCF_HitSpeed4 = 1<<16,
96 	OCF_NotContained = 1<<18,
97 	OCF_CrewMember = 1<<19,
98 	OCF_InLiquid = 1<<20,
99 	OCF_InSolid = 1<<21,
100 	OCF_InFree = 1<<22,
101 	OCF_Available = 1<<23,
102 	OCF_Container = 1<<24,
103 	OCF_Alive = 1<<25;
104 
105 //================================== Contact / Attachment ==============================================
106 
107 const BYTE // Directional
108 	CNAT_None = 0,
109 	CNAT_Left = 1,
110 	CNAT_Right = 2,
111 	CNAT_Top = 4,
112 	CNAT_Bottom = 8,
113 	CNAT_Center = 16,
114 	// Additional flags
115 	CNAT_MultiAttach = 32, // new attachment behaviour; see C4Shape::Attach
116 	CNAT_NoCollision = 64, // turn off collision for this vertex
117 	CNAT_PhaseHalfVehicle = 128;
118 
119 const BYTE CNAT_Flags = CNAT_MultiAttach | CNAT_NoCollision | CNAT_PhaseHalfVehicle; // all attchment flags that can be combined with regular attachment
120 
121 //=================================== Control Commands ======================================================
122 
123 const BYTE
124 	COM_MenuEnter = 38,
125 	COM_MenuEnterAll = 39,
126 	COM_MenuClose = 40,
127 	COM_MenuShowText = 42,
128 	COM_MenuLeft = 52,
129 	COM_MenuRight = 53,
130 	COM_MenuUp = 54,
131 	COM_MenuDown = 55,
132 	COM_MenuSelect = 60;
133 
134 //=================================== Owners ==============================================
135 
136 const int
137 	NO_OWNER = -1,
138 	ANY_OWNER = -2;
139 
140 //=================================== League (escape those damn circular includes =========
141 
142 enum C4LeagueDisconnectReason
143 {
144 	C4LDR_Unknown,
145 	C4LDR_ConnectionFailed,
146 	C4LDR_Desync
147 };
148 
149 //=================================== Player (included by C4PlayerInfo and C4Player)
150 
151 enum C4PlayerType
152 {
153 	C4PT_None = 0,
154 	C4PT_User = 1,     // Normal player
155 	C4PT_Script = 2    // AI players, etc.
156 };
157 
158 //=================================== AllowPictureStack (DefCore value)
159 
160 enum C4AllowPictureStack
161 {
162 	APS_Color = 1<<0,
163 	APS_Graphics = 1<<1,
164 	APS_Name = 1<<2,
165 	APS_Overlay = 1<<3
166 };
167 
168 // Material constants
169 // Material Density Levels
170 const int32_t
171 	C4M_Vehicle = 100,
172 	C4M_Solid = 50,
173 	C4M_SemiSolid = 25,
174 	C4M_Liquid = 25,
175 	C4M_Background = 0;
176 
177 const int32_t MNone = -1;
178 
179 
180 // Object size
181 const int32_t FullCon = 100000;
182 
183 #endif // INC_C4Constants
184