Skip to content

Commit c8a09d6

Browse files
committed
Clean up a bunch of unneeded crap
1 parent 953babd commit c8a09d6

13 files changed

+29
-391
lines changed

GUIEditor.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<ClCompile>
6262
<Optimization>Disabled</Optimization>
6363
<AdditionalIncludeDirectories>$(ProjectDir)external\include;$(ProjectDir)GUI\Wrappers;$(SolutionDir)GUI;$(ProjectDir)System;$(ProjectDir)Editor;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
64-
<PreprocessorDefinitions>_WINDOWS;WIN32;WIN32_LEAN_AND_MEAN;_HAS_ITERATOR_DEBUGGING=0;ALLEGRO_STATICLINK;ALLEGRO_NO_ASM;ALLEGRO_NO_STD_HEADERS;ALLEGRO_NO_MAGIC_MAIN;GUI_STANDALONE;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
64+
<PreprocessorDefinitions>_WINDOWS;WIN32;WIN32_LEAN_AND_MEAN;_HAS_ITERATOR_DEBUGGING=0;ALLEGRO_STATICLINK;ALLEGRO_NO_ASM;ALLEGRO_NO_STD_HEADERS;ALLEGRO_NO_MAGIC_MAIN;GUI_STANDALONE;_DEBUG;DEBUG_BUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
6565
<MinimalRebuild>false</MinimalRebuild>
6666
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
6767
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>

System/Constants.h

Lines changed: 0 additions & 174 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,7 @@
33

44
namespace RTE {
55

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-
296
#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-
357
enum ColorKeys {
368
g_MaskColor = 0, //!< Mask color for all 8bpp bitmaps (palette index 0 (255,0,255)). This color is fully transparent.
379
//g_MOIDMaskColor = 0, //!< Mask color for 8bpp MOID layer bitmaps (palette index 0 (255,0,255)). This color is fully transparent.
@@ -44,7 +16,6 @@ namespace RTE {
4416
g_NoMOID = 255
4517
};
4618

47-
enum DotGlowColor { NoDot = 0, YellowDot, RedDot, BlueDot };
4819
enum TransparencyPreset { LessTrans = 0, HalfTrans, MoreTrans };
4920

5021
// GUI colors
@@ -56,10 +27,6 @@ namespace RTE {
5627
#define c_GUIColorBlue makecol(59, 65, 83)
5728
#define c_GUIColorDarkBlue makecol(12, 20, 39)
5829
#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)
6330
#pragma endregion
6431

6532
#pragma region Math Constants
@@ -71,147 +38,6 @@ namespace RTE {
7138
static constexpr float c_SixteenthPI = 0.19634954F;
7239
#pragma endregion
7340

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-
21541
#pragma region Un-Definitions
21642
// Allegro defines these via define in astdint.h and Boost with stdlib go crazy so we need to undefine them manually.
21743
#undef int8_t

System/ContentFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace RTE {
55

6-
const string ContentFile::m_ClassName = "ContentFile";
6+
const std::string ContentFile::m_ClassName = "ContentFile";
77
std::unordered_map<std::string, BITMAP *> ContentFile::m_LoadedBitmaps;
88

99
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

System/ContentFile.h

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ struct BITMAP;
88
namespace RTE {
99

1010
/// <summary>
11-
/// A representation of a content file that is stored either directly on on disk or packaged in another file.
11+
/// A representation of a content file that is stored either directly on disk or packaged in another file.
1212
/// </summary>
1313
class ContentFile : public Serializable {
1414

@@ -28,7 +28,7 @@ class ContentFile : public Serializable {
2828
/// <summary>
2929
/// Destructor method used to clean up a ContentFile object before deletion from system memory.
3030
/// </summary>
31-
virtual ~ContentFile() { Destroy(); }
31+
~ContentFile() { Destroy(); }
3232

3333
//////////////////////////////////////////////////////////////////////////////////////////
3434
// Virtual method: Create
@@ -39,7 +39,7 @@ class ContentFile : public Serializable {
3939
// Return value: An error return value signaling success or any particular failure.
4040
// Anything below 0 is an error signal.
4141

42-
virtual int Create(const char *filePath);
42+
int Create(const char *filePath);
4343

4444

4545
//////////////////////////////////////////////////////////////////////////////////////////
@@ -53,20 +53,6 @@ class ContentFile : public Serializable {
5353
int Create(const ContentFile &reference);
5454

5555

56-
57-
//////////////////////////////////////////////////////////////////////////////////////////
58-
// Virtual method: Reset
59-
//////////////////////////////////////////////////////////////////////////////////////////
60-
// Description: Resets the entire ContentFile, including its inherited members, to their
61-
// default settings or values.
62-
// Arguments: None.
63-
// Return value: None.
64-
65-
virtual void Reset() { Clear(); /*Serializable::Reset();*/ }
66-
67-
68-
69-
7056
//////////////////////////////////////////////////////////////////////////////////////////
7157
// Virtual method: Destroy
7258
//////////////////////////////////////////////////////////////////////////////////////////

System/RTEError.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,14 @@ namespace RTE {
1010
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1111

1212
extern bool RTEAbortFunc(const char *description, const char *file, int line) {
13-
// Save out the screen bitmap, after making a copy of it, faster sometimes
14-
if (screen) {
15-
BITMAP *abortScreenBuffer = create_bitmap(screen->w, screen->h);
16-
blit(screen, abortScreenBuffer, 0, 0, 0, 0, screen->w, screen->h);
17-
PALETTE palette;
18-
get_palette(palette);
19-
save_bmp("abortscreen.bmp", abortScreenBuffer, palette);
20-
destroy_bitmap(abortScreenBuffer);
21-
}
2213
// Ditch the video mode so the message box appears without problems
2314
if (screen != 0) { set_gfx_mode(GFX_TEXT, 0, 0, 0, 0); }
2415
// Set title of the messagebox
2516
set_window_title("RTE Aborted! (x_x)");
2617

2718
char message[512];
2819

29-
#if defined DEBUG_BUILD || defined MIN_DEBUG_BUILD
20+
#if defined DEBUG_BUILD
3021
// Show message box with explanation
3122
std::snprintf(message, sizeof(message), "Runtime Error in file %s, line %i, because:\n\n%s\n\nThe last frame has been dumped to 'abortscreen.bmp'", file, line, description);
3223
allegro_message(message);

System/RTEError.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,12 @@
22
#define _RTEERROR_
33

44
#include "allegro.h"
5-
//#include "loadpng.h"
65

76
#undef max
87
#undef min
98

10-
#ifdef _WIN32
11-
#define DebuggerBreak __debugbreak();
12-
#else
13-
#define DebuggerBreak ;
14-
#endif
15-
16-
#if defined DEBUG_BUILD || defined MIN_DEBUG_BUILD
17-
#define AbortAction DebuggerBreak
9+
#if defined DEBUG_BUILD
10+
#define AbortAction __debugbreak();
1811
#else
1912
#define AbortAction std::exit(EXIT_FAILURE);
2013
#endif

0 commit comments

Comments
 (0)