Skip to content

Commit e322216

Browse files
authored
Merge pull request #26 from cortex-command-community/recompilation-speed
Pragma once + Recompilation speed
2 parents 02b3f85 + 0aa55f1 commit e322216

File tree

295 files changed

+1802
-1346
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

295 files changed

+1802
-1346
lines changed

Resources/Credits.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef _RTECREDITS_
2-
#define _RTECREDITS_
1+
#pragma once
32

43
// DO NOT INDENT!
54
// String literals are kinda trash and any whitespace/indentation will be part of the string.
@@ -142,5 +141,3 @@ FMOD Studio by Firelight Technologies Pty Ltd.
142141
143142
144143
Cortex Command is TM and © 2023 Data Realms, LLC)";
145-
146-
#endif

Source/Activities/ActorEditor.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ namespace RTE {
2323

2424
ConcreteClassInfo(ActorEditor, EditorActivity, 0);
2525

26+
ActorEditor::ActorEditor() {
27+
Clear();
28+
}
29+
30+
ActorEditor::~ActorEditor() {
31+
Destroy(true);
32+
}
33+
2634
void ActorEditor::Clear() {
2735
m_pEditedActor = 0;
2836
m_pPicker = 0;
@@ -167,9 +175,9 @@ namespace RTE {
167175
PieMenu* editedActorPieMenu = m_pEditedActor->GetPieMenu();
168176
editedActorPieMenu->SetEnabled(m_PlayerController[0].IsState(ControlState::PIE_MENU_ACTIVE) && m_EditorMode != EditorActivity::LOADDIALOG);
169177

170-
if (editedActorPieMenu->GetPieCommand() == PieSlice::SliceType::EditorLoad) {
178+
if (editedActorPieMenu->GetPieCommand() == PieSliceType::EditorLoad) {
171179
ReloadActorData();
172-
} else if (editedActorPieMenu->GetPieCommand() == PieSlice::SliceType::EditorPick) {
180+
} else if (editedActorPieMenu->GetPieCommand() == PieSliceType::EditorPick) {
173181
m_EditorMode = EditorActivity::LOADDIALOG;
174182
m_ModeChange = true;
175183
}

Source/Activities/ActorEditor.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef _RTEACTOREDITOR_
2-
#define _RTEACTOREDITOR_
1+
#pragma once
32

43
/// Header file for the ActorEditor class.
54
/// @author Daniel Tabar
@@ -37,11 +36,11 @@ namespace RTE {
3736

3837
/// Constructor method used to instantiate a ActorEditor object in system
3938
/// memory. Create() should be called before using the object.
40-
ActorEditor() { Clear(); }
39+
ActorEditor();
4140

4241
/// Destructor method used to clean up a ActorEditor object before deletion
4342
/// from system memory.
44-
~ActorEditor() override { Destroy(true); }
43+
~ActorEditor() override;
4544

4645
/// Makes the ActorEditor object ready for use.
4746
/// @return An error return value signaling sucess or any particular failure.
@@ -129,5 +128,3 @@ namespace RTE {
129128
};
130129

131130
} // namespace RTE
132-
133-
#endif // File

Source/Activities/AreaEditor.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ namespace RTE {
3030

3131
ConcreteClassInfo(AreaEditor, EditorActivity, 0);
3232

33+
AreaEditor::AreaEditor() {
34+
Clear();
35+
}
36+
37+
AreaEditor::~AreaEditor() {
38+
Destroy(true);
39+
}
40+
3341
void AreaEditor::Clear() {
3442
m_pEditorGUI = 0;
3543
m_pNewAreaName = 0;
@@ -211,24 +219,24 @@ namespace RTE {
211219
m_NeedSave = m_pEditorGUI->EditMade() || m_NeedSave;
212220

213221
// Get any mode change commands that the user gave the Editor GUI
214-
if (m_pEditorGUI->GetActivatedPieSlice() == PieSlice::SliceType::EditorNew && m_EditorMode != NEWDIALOG) {
222+
if (m_pEditorGUI->GetActivatedPieSlice() == PieSliceType::EditorNew && m_EditorMode != NEWDIALOG) {
215223
m_pEditorGUI->SetEditorGUIMode(AreaEditorGUI::INACTIVE);
216224
m_EditorMode = EditorActivity::NEWDIALOG;
217225
m_ModeChange = true;
218226
// This is ahack so we don't get a 'save changes dialog' when we jsut want to create a new area.
219227
// Will turn on dirtyness immediately as New button is pressed below
220228
m_NeedSave = false;
221-
} else if (m_pEditorGUI->GetActivatedPieSlice() == PieSlice::SliceType::EditorLoad && m_EditorMode != LOADDIALOG) {
229+
} else if (m_pEditorGUI->GetActivatedPieSlice() == PieSliceType::EditorLoad && m_EditorMode != LOADDIALOG) {
222230
m_pEditorGUI->SetEditorGUIMode(AreaEditorGUI::INACTIVE);
223231
m_EditorMode = EditorActivity::LOADDIALOG;
224232
m_ModeChange = true;
225-
} else if (m_pEditorGUI->GetActivatedPieSlice() == PieSlice::SliceType::EditorSave && m_EditorMode != SAVEDIALOG) {
233+
} else if (m_pEditorGUI->GetActivatedPieSlice() == PieSliceType::EditorSave && m_EditorMode != SAVEDIALOG) {
226234
m_pEditorGUI->SetEditorGUIMode(AreaEditorGUI::INACTIVE);
227235
m_EditorMode = EditorActivity::SAVEDIALOG;
228236
m_ModeChange = true;
229237
}
230238
// Test the scene by starting a Skirmish Defense with it, after saving
231-
else if (m_pEditorGUI->GetActivatedPieSlice() == PieSlice::SliceType::EditorDone || m_EditorMode == TESTINGOBJECT) {
239+
else if (m_pEditorGUI->GetActivatedPieSlice() == PieSliceType::EditorDone || m_EditorMode == TESTINGOBJECT) {
232240
m_pEditorGUI->SetEditorGUIMode(AreaEditorGUI::INACTIVE);
233241

234242
if (m_NeedSave) {
@@ -418,7 +426,7 @@ namespace RTE {
418426
///////////////////////////////////////
419427
// Clicks on the New Scene Module combo
420428
421-
if (anEvent.GetControl() == m_pNewModuleCombo)
429+
if (anEvent.GetControl() == m_pNewModuleCombo)
422430
{
423431
// Closed it, IE selected somehting
424432
if(anEvent.GetMsg() == GUIComboBox::Closed)

Source/Activities/AreaEditor.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef _RTEAREAEDITOR_
2-
#define _RTEAREAEDITOR_
1+
#pragma once
32

43
/// Header file for the AreaEditor class.
54
/// @author Daniel Tabar
@@ -35,11 +34,11 @@ namespace RTE {
3534

3635
/// Constructor method used to instantiate a AreaEditor object in system
3736
/// memory. Create() should be called before using the object.
38-
AreaEditor() { Clear(); }
37+
AreaEditor();
3938

4039
/// Destructor method used to clean up a AreaEditor object before deletion
4140
/// from system memory.
42-
~AreaEditor() override { Destroy(true); }
41+
~AreaEditor() override;
4342

4443
/// Makes the AreaEditor object ready for use.
4544
/// @return An error return value signaling sucess or any particular failure.
@@ -142,5 +141,3 @@ namespace RTE {
142141
};
143142

144143
} // namespace RTE
145-
146-
#endif // File

Source/Activities/AssemblyEditor.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ namespace RTE {
3030

3131
ConcreteClassInfo(AssemblyEditor, EditorActivity, 0);
3232

33+
AssemblyEditor::AssemblyEditor() {
34+
Clear();
35+
}
36+
37+
AssemblyEditor::~AssemblyEditor() {
38+
Destroy(true);
39+
}
40+
3341
void AssemblyEditor::Clear() {
3442
m_pEditorGUI = 0;
3543
m_pModuleCombo = 0;
@@ -189,15 +197,15 @@ namespace RTE {
189197
m_NeedSave = m_pEditorGUI->EditMade() || m_NeedSave;
190198

191199
// Get any mode change commands that the user gave the Editor GUI
192-
if (m_pEditorGUI->GetActivatedPieSlice() == PieSlice::SliceType::EditorNew && m_EditorMode != NEWDIALOG) {
200+
if (m_pEditorGUI->GetActivatedPieSlice() == PieSliceType::EditorNew && m_EditorMode != NEWDIALOG) {
193201
m_pEditorGUI->SetEditorGUIMode(AssemblyEditorGUI::INACTIVE);
194202
m_EditorMode = EditorActivity::NEWDIALOG;
195203
m_ModeChange = true;
196-
} else if (m_pEditorGUI->GetActivatedPieSlice() == PieSlice::SliceType::EditorLoad && m_EditorMode != LOADDIALOG) {
204+
} else if (m_pEditorGUI->GetActivatedPieSlice() == PieSliceType::EditorLoad && m_EditorMode != LOADDIALOG) {
197205
m_pEditorGUI->SetEditorGUIMode(AssemblyEditorGUI::INACTIVE);
198206
m_EditorMode = EditorActivity::LOADDIALOG;
199207
m_ModeChange = true;
200-
} else if (m_pEditorGUI->GetActivatedPieSlice() == PieSlice::SliceType::EditorSave && m_EditorMode != SAVEDIALOG) {
208+
} else if (m_pEditorGUI->GetActivatedPieSlice() == PieSliceType::EditorSave && m_EditorMode != SAVEDIALOG) {
201209
m_pEditorGUI->SetEditorGUIMode(AssemblyEditorGUI::INACTIVE);
202210
m_EditorMode = EditorActivity::SAVEDIALOG;
203211
m_ModeChange = true;

Source/Activities/AssemblyEditor.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef _RTEASSEMBLYEDITOR_
2-
#define _RTEASSEMBLYEDITOR_
1+
#pragma once
32

43
/// Header file for the AssemblyEditor class.
54
/// @author Daniel Tabar
@@ -37,11 +36,11 @@ namespace RTE {
3736

3837
/// Constructor method used to instantiate a AssemblyEditor object in system
3938
/// memory. Create() should be called before using the object.
40-
AssemblyEditor() { Clear(); }
39+
AssemblyEditor();
4140

4241
/// Destructor method used to clean up a AssemblyEditor object before deletion
4342
/// from system memory.
44-
~AssemblyEditor() override { Destroy(true); }
43+
~AssemblyEditor() override;
4544

4645
/// Makes the AssemblyEditor object ready for use.
4746
/// @return An error return value signaling sucess or any particular failure.
@@ -147,5 +146,3 @@ namespace RTE {
147146
};
148147

149148
} // namespace RTE
150-
151-
#endif // File

Source/Activities/BaseEditor.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ namespace RTE {
2525

2626
ConcreteClassInfo(BaseEditor, Activity, 0);
2727

28+
BaseEditor::BaseEditor() {
29+
Clear();
30+
}
31+
32+
BaseEditor::~BaseEditor() {
33+
Destroy(true);
34+
}
35+
2836
void BaseEditor::Clear() {
2937
m_pEditorGUI = 0;
3038
m_NeedSave = false;
@@ -211,7 +219,7 @@ namespace RTE {
211219

212220
// Get any mode change commands that the user gave the Editor GUI
213221
// Done with editing for now; save and return to campaign screen
214-
if (m_pEditorGUI->GetActivatedPieSlice() == PieSlice::SliceType::EditorDone) {
222+
if (m_pEditorGUI->GetActivatedPieSlice() == PieSliceType::EditorDone) {
215223
m_pEditorGUI->SetEditorGUIMode(SceneEditorGUI::INACTIVE);
216224

217225
if (m_NeedSave)

Source/Activities/BaseEditor.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef _RTEBASEEDITOR_
2-
#define _RTEBASEEDITOR_
1+
#pragma once
32

43
/// Header file for the BaseEditor class.
54
/// @author Daniel Tabar
@@ -36,11 +35,11 @@ namespace RTE {
3635

3736
/// Constructor method used to instantiate a BaseEditor object in system
3837
/// memory. Create() should be called before using the object.
39-
BaseEditor() { Clear(); }
38+
BaseEditor();
4039

4140
/// Destructor method used to clean up a BaseEditor object before deletion
4241
/// from system memory.
43-
~BaseEditor() override { Destroy(true); }
42+
~BaseEditor() override;
4443

4544
/// Makes the BaseEditor object ready for use.
4645
/// @return An error return value signaling sucess or any particular failure.
@@ -121,5 +120,3 @@ namespace RTE {
121120
};
122121

123122
} // namespace RTE
124-
125-
#endif // File

Source/Activities/EditorActivity.cpp

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ namespace RTE {
2424

2525
AbstractClassInfo(EditorActivity, Activity);
2626

27+
EditorActivity::EditorActivity() {
28+
Clear();
29+
}
30+
31+
EditorActivity::~EditorActivity() {
32+
Destroy(true);
33+
}
34+
2735
void EditorActivity::Clear() {
2836
// Most editors are single player affairs
2937
m_MaxPlayerSupport = 1;
@@ -275,20 +283,20 @@ namespace RTE {
275283
////////////////////////////////////////////////////////
276284
// Handle events for mouse input on the controls
277285
278-
GUIEvent anEvent;
279-
while(m_pGUIController->GetEvent(&anEvent))
286+
GUIEvent anEvent;
287+
while(m_pGUIController->GetEvent(&anEvent))
280288
{
281289
// If we're not supposed to have mouse control, then ignore these messages
282290
// Uh this is not right, editor always has mouse control so far
283291
// if (!m_PlayerController[0].IsMouseControlled())
284292
// break;
285293
286-
if (anEvent.GetType() == GUIEvent::Command)
294+
if (anEvent.GetType() == GUIEvent::Command)
287295
{
288296
//////////////////////////////////////////////////////////
289-
// NEW button pressed; create a new scene
297+
// NEW button pressed; create a new scene
290298
291-
if (anEvent.GetControl() == m_pNewButton)
299+
if (anEvent.GetControl() == m_pNewButton)
292300
{
293301
// Get the selected Module
294302
GUIListPanel::Item *pItem = m_pNewModuleCombo->GetItem(m_pNewModuleCombo->GetSelectedIndex());
@@ -345,9 +353,9 @@ namespace RTE {
345353
}
346354
347355
//////////////////////////////////////////////////////////
348-
// LOAD button pressed; load the selected Scene
356+
// LOAD button pressed; load the selected Scene
349357
350-
if (anEvent.GetControl() == m_pLoadButton)
358+
if (anEvent.GetControl() == m_pLoadButton)
351359
{
352360
GUIListPanel::Item *pItem = m_pLoadNameCombo->GetItem(m_pLoadNameCombo->GetSelectedIndex());
353361
if (pItem && !pItem->m_Name.empty())
@@ -371,9 +379,9 @@ namespace RTE {
371379
}
372380
373381
//////////////////////////////////////////////////////////
374-
// SAVE button pressed; save the selected Scene
382+
// SAVE button pressed; save the selected Scene
375383
376-
if (anEvent.GetControl() == m_pSaveButton)
384+
if (anEvent.GetControl() == m_pSaveButton)
377385
{
378386
if (!m_pSaveNameBox->GetText().empty())
379387
{
@@ -396,9 +404,9 @@ namespace RTE {
396404
}
397405
398406
///////////////////////////////////////////////////////////////
399-
// Save Changes YES pressed
407+
// Save Changes YES pressed
400408
401-
if (anEvent.GetControl() == m_pChangesYesButton)
409+
if (anEvent.GetControl() == m_pChangesYesButton)
402410
{
403411
if (m_HasEverBeenSaved)
404412
{
@@ -422,9 +430,9 @@ namespace RTE {
422430
}
423431
424432
///////////////////////////////////////////////////////////////
425-
// Save Changes NO pressed
433+
// Save Changes NO pressed
426434
427-
if (anEvent.GetControl() == m_pChangesNoButton)
435+
if (anEvent.GetControl() == m_pChangesNoButton)
428436
{
429437
// Just go back to previous mode
430438
m_EditorMode = m_PreviousMode;
@@ -433,9 +441,9 @@ namespace RTE {
433441
}
434442
435443
///////////////////////////////////////////////////////////////
436-
// Overwrite Scene YES pressed
444+
// Overwrite Scene YES pressed
437445
438-
if (anEvent.GetControl() == m_pOverwriteYesButton)
446+
if (anEvent.GetControl() == m_pOverwriteYesButton)
439447
{
440448
// Force overwrite
441449
if (SaveScene(g_SceneMan.GetScene()->GetPresetName(), true))
@@ -451,19 +459,19 @@ namespace RTE {
451459
}
452460
453461
///////////////////////////////////////////////////////////////
454-
// Overwrite Scene NO pressed
462+
// Overwrite Scene NO pressed
455463
456-
if (anEvent.GetControl() == m_pOverwriteNoButton)
464+
if (anEvent.GetControl() == m_pOverwriteNoButton)
457465
{
458466
// Just go back to previous mode
459467
m_EditorMode = m_PreviousMode;
460468
m_ModeChange = true;
461469
}
462470
463471
///////////////////////////////////////////////////////////////
464-
// CANCEL button pressed; exit any active dialog box
472+
// CANCEL button pressed; exit any active dialog box
465473
466-
if (anEvent.GetControl() == m_pNewCancel || anEvent.GetControl() == m_pLoadCancel || anEvent.GetControl() == m_pSaveCancel)
474+
if (anEvent.GetControl() == m_pNewCancel || anEvent.GetControl() == m_pLoadCancel || anEvent.GetControl() == m_pSaveCancel)
467475
{
468476
m_EditorMode = m_PreviousMode = EDITINGOBJECT;
469477
m_ModeChange = true;
@@ -476,7 +484,7 @@ namespace RTE {
476484
///////////////////////////////////////
477485
// Clicks on the New Scene Module combo
478486
479-
if (anEvent.GetControl() == m_pNewModuleCombo)
487+
if (anEvent.GetControl() == m_pNewModuleCombo)
480488
{
481489
// Closed it, IE selected somehting
482490
if(anEvent.GetMsg() == GUIComboBox::Closed)

0 commit comments

Comments
 (0)