1
- // ////////////////////////////////////////////////////////////////////////////////////////
2
- // File: ActorEditor.cpp
3
- // ////////////////////////////////////////////////////////////////////////////////////////
4
- // Description: Source file for the ActorEditor class.
5
- // Project: Retro Terrain Engine
6
- // Author(s): Daniel Tabar
7
-
8
- // http://www.datarealms.com
9
-
10
- // ////////////////////////////////////////////////////////////////////////////////////////
11
- // Inclusions of header files
12
-
13
1
#include " ActorEditor.h"
14
2
15
3
#include " PresetMan.h"
16
4
#include " MovableMan.h"
17
5
#include " FrameMan.h"
18
6
#include " CameraMan.h"
19
7
#include " UInputMan.h"
20
- // #include "AHuman.h"
21
- // #include "MOPixel.h"
8
+ // #include "AHuman.h"
9
+ // #include "MOPixel.h"
22
10
#include " SLTerrain.h"
23
11
#include " Controller.h"
24
- // #include "AtomGroup.h"
12
+ // #include "AtomGroup.h"
25
13
#include " Actor.h"
26
14
#include " AHuman.h"
27
15
#include " ACRocket.h"
@@ -35,22 +23,11 @@ namespace RTE {
35
23
36
24
ConcreteClassInfo (ActorEditor, EditorActivity, 0 );
37
25
38
- // ////////////////////////////////////////////////////////////////////////////////////////
39
- // Method: Clear
40
- // ////////////////////////////////////////////////////////////////////////////////////////
41
- // Description: Clears all the member variables of this ActorEditor, effectively
42
- // resetting the members of this abstraction level only.
43
-
44
26
void ActorEditor::Clear () {
45
27
m_pEditedActor = 0 ;
46
28
m_pPicker = 0 ;
47
29
}
48
30
49
- // ////////////////////////////////////////////////////////////////////////////////////////
50
- // Virtual method: Create
51
- // ////////////////////////////////////////////////////////////////////////////////////////
52
- // Description: Makes the ActorEditor object ready for use.
53
-
54
31
int ActorEditor::Create () {
55
32
if (EditorActivity::Create () < 0 )
56
33
return -1 ;
@@ -60,11 +37,6 @@ namespace RTE {
60
37
return 0 ;
61
38
}
62
39
63
- // ////////////////////////////////////////////////////////////////////////////////////////
64
- // Virtual method: Create
65
- // ////////////////////////////////////////////////////////////////////////////////////////
66
- // Description: Creates a ActorEditor to be identical to another, by deep copy.
67
-
68
40
int ActorEditor::Create (const ActorEditor& reference) {
69
41
if (EditorActivity::Create (reference) < 0 )
70
42
return -1 ;
@@ -75,14 +47,6 @@ namespace RTE {
75
47
return 0 ;
76
48
}
77
49
78
- // ////////////////////////////////////////////////////////////////////////////////////////
79
- // Virtual method: ReadProperty
80
- // ////////////////////////////////////////////////////////////////////////////////////////
81
- // Description: Reads a property value from a reader stream. If the name isn't
82
- // recognized by this class, then ReadProperty of the parent class
83
- // is called. If the property isn't recognized by any of the base classes,
84
- // false is returned, and the reader's position is untouched.
85
-
86
50
int ActorEditor::ReadProperty (const std::string_view& propName, Reader& reader) {
87
51
StartPropertyList (return EditorActivity::ReadProperty (propName, reader));
88
52
/*
@@ -93,22 +57,11 @@ namespace RTE {
93
57
EndPropertyList;
94
58
}
95
59
96
- // ////////////////////////////////////////////////////////////////////////////////////////
97
- // Virtual method: Save
98
- // ////////////////////////////////////////////////////////////////////////////////////////
99
- // Description: Saves the complete state of this ActorEditor with a Writer for
100
- // later recreation with Create(Reader &reader);
101
-
102
60
int ActorEditor::Save (Writer& writer) const {
103
61
EditorActivity::Save (writer);
104
62
return 0 ;
105
63
}
106
64
107
- // ////////////////////////////////////////////////////////////////////////////////////////
108
- // Method: Destroy
109
- // ////////////////////////////////////////////////////////////////////////////////////////
110
- // Description: Destroys and resets (through Clear()) the ActorEditor object.
111
-
112
65
void ActorEditor::Destroy (bool notInherited) {
113
66
delete m_pEditedActor;
114
67
delete m_pPicker;
@@ -118,12 +71,6 @@ namespace RTE {
118
71
Clear ();
119
72
}
120
73
121
- // ////////////////////////////////////////////////////////////////////////////////////////
122
- // Virtual method: Start
123
- // ////////////////////////////////////////////////////////////////////////////////////////
124
- // Description: Officially starts this. Creates all the data etc necessary to start
125
- // the activity.
126
-
127
74
int ActorEditor::Start () {
128
75
int error = EditorActivity::Start ();
129
76
@@ -144,33 +91,17 @@ namespace RTE {
144
91
return error;
145
92
}
146
93
147
- // ////////////////////////////////////////////////////////////////////////////////////////
148
- // Method: Pause
149
- // ////////////////////////////////////////////////////////////////////////////////////////
150
- // Description: Pauses and unpauses the game.
151
-
152
94
void ActorEditor::SetPaused (bool pause) {
153
95
// Override the pause
154
96
m_Paused = false ;
155
97
}
156
98
157
- // ////////////////////////////////////////////////////////////////////////////////////////
158
- // Method: End
159
- // ////////////////////////////////////////////////////////////////////////////////////////
160
- // Description: Forces the current game's end.
161
-
162
99
void ActorEditor::End () {
163
100
EditorActivity::End ();
164
101
165
102
m_ActivityState = ActivityState::Over;
166
103
}
167
104
168
- // ////////////////////////////////////////////////////////////////////////////////////////
169
- // Method: Update
170
- // ////////////////////////////////////////////////////////////////////////////////////////
171
- // Description: Updates the state of this ActorEditor. Supposed to be done every frame
172
- // before drawing.
173
-
174
105
void ActorEditor::Update () {
175
106
// And object hasn't been loaded yet, so get the loading picker going
176
107
if (!m_pEditedActor) {
@@ -245,11 +176,6 @@ namespace RTE {
245
176
}
246
177
}
247
178
248
- // ////////////////////////////////////////////////////////////////////////////////////////
249
- // Method: DrawGUI
250
- // ////////////////////////////////////////////////////////////////////////////////////////
251
- // Description: Draws the currently active GUI of a screen to a BITMAP of choice.
252
-
253
179
void ActorEditor::DrawGUI (BITMAP* pTargetBitmap, const Vector& targetPos, int which) {
254
180
// Draw the edited actor and pie menu
255
181
if (m_pEditedActor) {
@@ -266,21 +192,10 @@ namespace RTE {
266
192
EditorActivity::DrawGUI (pTargetBitmap, targetPos, which);
267
193
}
268
194
269
- // ////////////////////////////////////////////////////////////////////////////////////////
270
- // Method: Draw
271
- // ////////////////////////////////////////////////////////////////////////////////////////
272
- // Description: Draws this ActorEditor's current graphical representation to a
273
- // BITMAP of choice. This includes all game-related graphics.
274
-
275
195
void ActorEditor::Draw (BITMAP* pTargetBitmap, const Vector& targetPos) {
276
196
EditorActivity::Draw (pTargetBitmap, targetPos);
277
197
}
278
198
279
- // ////////////////////////////////////////////////////////////////////////////////////////
280
- // Method: LoadActor
281
- // ////////////////////////////////////////////////////////////////////////////////////////
282
- // Description: Reloads the Actor itself and sets up the pie menu to match its setup.
283
-
284
199
bool ActorEditor::LoadActor (const Entity* pActorToLoad) {
285
200
if (!pActorToLoad)
286
201
return false ;
@@ -312,8 +227,6 @@ namespace RTE {
312
227
return true ;
313
228
}
314
229
315
- // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
316
-
317
230
bool ActorEditor::ReloadActorData () {
318
231
if (m_pEditedActor) {
319
232
std::string presetName = m_pEditedActor->GetPresetName ();
0 commit comments