Skip to content

Commit 601f072

Browse files
committed
Get some updated sources from RTE
1 parent 05740fe commit 601f072

15 files changed

+1681
-1694
lines changed

GUIEditor.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@
218218
<ClInclude Include="GUI\Wrappers\AllegroScreen.h" />
219219
<ClInclude Include="GUI\Wrappers\GUIInterface.h" />
220220
<ClInclude Include="Resources\resource.h" />
221+
<ClInclude Include="System\Constants.h" />
221222
<ClInclude Include="System\ContentFile.h" />
222223
<ClInclude Include="System\Reader.h" />
223224
<ClInclude Include="System\RTEError.h" />

GUIEditor.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@
284284
<ClInclude Include="System\StandardIncludes.h">
285285
<Filter>System</Filter>
286286
</ClInclude>
287+
<ClInclude Include="System\Constants.h">
288+
<Filter>System</Filter>
289+
</ClInclude>
287290
</ItemGroup>
288291
<ItemGroup>
289292
<ResourceCompile Include="Resources\Resource.rc">

System/Constants.h

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
#ifndef _RTECONSTANTS_
2+
#define _RTECONSTANTS_
3+
4+
namespace RTE {
5+
6+
#pragma region Type Definitions
7+
// TODO: Look into not using distinctive types for IDs.
8+
typedef int MOID; //!< Distinctive type definition for MovableObject IDs.
9+
typedef int MID; //!< Distinctive type definition for Material IDs.
10+
#pragma endregion
11+
12+
#pragma region Game Version
13+
static constexpr char *c_GameVersion = "Pre-Release 3";
14+
#pragma endregion
15+
16+
#pragma region Filesystem Constants
17+
static constexpr char *c_ScreenshotDirectory = { "_Screenshots" };
18+
#pragma endregion
19+
20+
#pragma region Physics Constants
21+
static constexpr float c_PPM = 20.0F; //!< Pixels per Meter constant.
22+
static constexpr float c_MPP = 1.0F / c_PPM; //!< Meters per Pixel constant.
23+
static constexpr float c_PPL = 1000.0F / ((100.0F / c_PPM) * (100.0F / c_PPM) * (100.0F / c_PPM)); //!< Pixels per Liter constant.
24+
static constexpr float c_LPP = 1.0F / c_PPL; //!< Liters per Pixel constant.
25+
26+
static constexpr int c_DefaultAtomGroupResolution = 5; //!< The global default AtomGroup resolution setting.
27+
#pragma endregion
28+
29+
#pragma region Graphics Constants
30+
static constexpr unsigned short c_MaxScreenCount = 4; //!< Maximum number of player screens.
31+
static constexpr unsigned short c_PaletteEntriesNumber = 256; //!< Number of indexes in the graphics palette.
32+
static constexpr unsigned short c_MOIDLayerBitDepth = 16; //!< Bit depth of MOID layer bitmap.
33+
static constexpr unsigned short c_GoldMaterialID = 2; //!< Index of gold material in the material palette.
34+
35+
enum ColorKeys {
36+
g_MaskColor = 0, //!< Mask color for all 8bpp bitmaps (palette index 0 (255,0,255)). This color is fully transparent.
37+
//g_MOIDMaskColor = 0, //!< Mask color for 8bpp MOID layer bitmaps (palette index 0 (255,0,255)). This color is fully transparent.
38+
g_MOIDMaskColor = 0xF81F, //!< Mask color for 16bpp MOID layer bitmaps (255,0,255). This color is fully transparent.
39+
//g_MOIDMaskColor = 0xFF00FF, //!< Mask color for 32bpp MOID layer bitmaps (255,0,255). This color is fully transparent.
40+
g_BlackColor = 245,
41+
g_WhiteColor = 254,
42+
g_RedColor = 13,
43+
g_YellowGlowColor = 117,
44+
g_NoMOID = 255
45+
};
46+
47+
enum DotGlowColor { NoDot = 0, YellowDot, RedDot, BlueDot };
48+
enum TransparencyPreset { LessTrans = 0, HalfTrans, MoreTrans };
49+
50+
// GUI colors
51+
#define c_GUIColorWhite makecol(255, 255, 255)
52+
#define c_GUIColorYellow makecol(255, 255, 128)
53+
#define c_GUIColorRed makecol(255, 100, 100)
54+
#define c_GUIColorGreen makecol(128, 255, 128)
55+
#define c_GUIColorLightBlue makecol(109, 117, 170)
56+
#define c_GUIColorBlue makecol(59, 65, 83)
57+
#define c_GUIColorDarkBlue makecol(12, 20, 39)
58+
#define c_GUIColorGray makecol(232, 232, 248)
59+
60+
#define c_PlayerSlotColorDefault makecol(161, 109, 20)
61+
#define c_PlayerSlotColorHovered makecol(203, 130, 56)
62+
#define c_PlayerSlotColorDisabled makecol(104, 67, 15)
63+
#pragma endregion
64+
65+
#pragma region Math Constants
66+
static constexpr float c_TwoPI = 6.28318531F;
67+
static constexpr float c_PI = 3.14159265F;
68+
static constexpr float c_HalfPI = 1.57079633F;
69+
static constexpr float c_QuarterPI = 0.78539816F;
70+
static constexpr float c_EighthPI = 0.39269908F;
71+
static constexpr float c_SixteenthPI = 0.19634954F;
72+
#pragma endregion
73+
74+
#pragma region Audio Constants
75+
static constexpr std::array<const char*, 3> c_SupportedAudioFormats = { ".wav", ".ogg", ".flac" };
76+
77+
static constexpr unsigned short c_MaxSoftwareChannels = 128;
78+
static constexpr unsigned short c_MaxVirtualChannels = 1024;
79+
static constexpr unsigned short c_MaxPlayingSoundsPerContainer = 128;
80+
/* TODO These have been temporarily replaced with variables in settingsman to allow for easy tweaking. This needs to be undone once our soundscape is sorted out.
81+
static constexpr unsigned short c_ListenerZOffset = 50; //!< The Z offset for Audio listeners. Can be used to lessen harsh panning if panning effect strength is at max.
82+
static constexpr unsigned short c_MinimumDistanceForPanning = 50; //!< The minimum distance before which sound panning should not occur. Not relevant for immobile sounds or in splitscreen.
83+
*/
84+
static constexpr unsigned short c_DefaultAttenuationStartDistance = 100; //!< The default start distance for attenuating sounds. Individual sounds can have different values for this.
85+
static constexpr unsigned int c_SoundMaxAudibleDistance = 100000; //!< The maximum distance at which any sound can possibly be heard, after which point it will have 0 volume. Arbitrary default suggested by FMOD.
86+
#pragma endregion
87+
88+
#pragma region Network Constants
89+
static constexpr unsigned short c_MaxClients = 4;
90+
static constexpr unsigned short c_FramesToRemember = 3;
91+
static constexpr unsigned short c_MaxLayersStoredForNetwork = 10;
92+
static constexpr unsigned short c_MaxPixelLineBufferSize = 8192;
93+
#pragma endregion
94+
95+
#pragma region Input Constants
96+
/// <summary>
97+
/// Enumeration for different types of input devices.
98+
/// </summary>
99+
enum InputDevice {
100+
DEVICE_KEYB_ONLY = 0,
101+
DEVICE_MOUSE_KEYB,
102+
DEVICE_GAMEPAD_1,
103+
DEVICE_GAMEPAD_2,
104+
DEVICE_GAMEPAD_3,
105+
DEVICE_GAMEPAD_4,
106+
DEVICE_COUNT
107+
};
108+
109+
/// <summary>
110+
/// Enumeration for different input scheme presets.
111+
/// </summary>
112+
enum InputPreset {
113+
PRESET_P1DEFAULT = -1,
114+
PRESET_P2DEFAULT = -2,
115+
PRESET_P3DEFAULT = -3,
116+
PRESET_P4DEFAULT = -4,
117+
PRESET_NONE = 0,
118+
PRESET_WASDKEYS,
119+
PRESET_CURSORKEYS,
120+
PRESET_XBOX360,
121+
PRESET_COUNT
122+
};
123+
124+
/// <summary>
125+
/// Enumeration for different elements the input scheme is composed of.
126+
/// </summary>
127+
enum InputElements {
128+
INPUT_L_UP = 0,
129+
INPUT_L_DOWN,
130+
INPUT_L_LEFT,
131+
INPUT_L_RIGHT,
132+
INPUT_R_UP,
133+
INPUT_R_DOWN,
134+
INPUT_R_LEFT,
135+
INPUT_R_RIGHT,
136+
INPUT_FIRE,
137+
INPUT_AIM,
138+
INPUT_AIM_UP,
139+
INPUT_AIM_DOWN,
140+
INPUT_AIM_LEFT,
141+
INPUT_AIM_RIGHT,
142+
INPUT_PIEMENU,
143+
INPUT_JUMP,
144+
INPUT_CROUCH,
145+
INPUT_NEXT,
146+
INPUT_PREV,
147+
INPUT_START,
148+
INPUT_BACK,
149+
INPUT_WEAPON_CHANGE_NEXT,
150+
INPUT_WEAPON_CHANGE_PREV,
151+
INPUT_WEAPON_PICKUP,
152+
INPUT_WEAPON_DROP,
153+
INPUT_WEAPON_RELOAD,
154+
INPUT_COUNT
155+
};
156+
157+
/// <summary>
158+
/// Enumeration for mouse button types.
159+
/// </summary>
160+
enum MouseButtons {
161+
MOUSE_NONE = -1,
162+
MOUSE_LEFT = 0,
163+
MOUSE_RIGHT,
164+
MOUSE_MIDDLE,
165+
MAX_MOUSE_BUTTONS
166+
};
167+
168+
/// <summary>
169+
/// Enumeration for joystick button types.
170+
/// </summary>
171+
enum JoyButtons {
172+
JOY_NONE = -1,
173+
JOY_1 = 0,
174+
JOY_2,
175+
JOY_3,
176+
JOY_4,
177+
JOY_5,
178+
JOY_6,
179+
JOY_7,
180+
JOY_8,
181+
JOY_9,
182+
JOY_10,
183+
JOY_11,
184+
JOY_12,
185+
MAX_JOY_BUTTONS
186+
};
187+
188+
/// <summary>
189+
/// Enumeration for joystick direction types.
190+
/// </summary>
191+
enum JoyDirections { JOYDIR_ONE = 0, JOYDIR_TWO };
192+
193+
/// <summary>
194+
/// Enumeration for joystick dead zone types.
195+
/// Square deadzone cuts-off any input from every axis separately. For example if x-axis has less than 20% input and y-axis has more, x-axis input is ignored.
196+
/// Circle uses a round zone to capture stick position on both axis then cut-off if this position is inside the round dead zone.
197+
/// </summary>
198+
enum DeadZoneType { CIRCLE = 0, SQUARE = 1 };
199+
#pragma endregion
200+
201+
#pragma region Global Enumerations
202+
/// <summary>
203+
/// Enumeration all available players.
204+
/// </summary>
205+
enum Players {
206+
NoPlayer = -1,
207+
PlayerOne = 0,
208+
PlayerTwo,
209+
PlayerThree,
210+
PlayerFour,
211+
MaxPlayerCount
212+
};
213+
#pragma endregion
214+
215+
#pragma region Un-Definitions
216+
// Allegro defines these via define in astdint.h and Boost with stdlib go crazy so we need to undefine them manually.
217+
#undef int8_t
218+
#undef uint8_t
219+
#undef int16_t
220+
#undef uint16_t
221+
#undef int32_t
222+
#undef uint32_t
223+
#undef intptr_t
224+
#undef uintptr_t
225+
#undef LONG_LONG
226+
#undef int64_t
227+
#undef uint64_t
228+
#pragma endregion
229+
}
230+
#endif

0 commit comments

Comments
 (0)