Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 4 additions & 3 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: DontAlign
AlignEscapedNewlines: DontAlign
AlignOperands: true
AlignTrailingComments: false
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
Expand Down Expand Up @@ -73,7 +73,7 @@ PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 6000
PointerAlignment: Left
ReflowComments: false
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
Expand All @@ -95,6 +95,7 @@ SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
#InsertNewlineAtEOF: true
Standard: c++17
StatementMacros:
- Q_UNUSED
Expand Down
93 changes: 3 additions & 90 deletions Source/Activities/ActorEditor.cpp
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
//////////////////////////////////////////////////////////////////////////////////////////
// File: ActorEditor.cpp
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Source file for the ActorEditor class.
// Project: Retro Terrain Engine
// Author(s): Daniel Tabar
// data@datarealms.com
// http://www.datarealms.com

//////////////////////////////////////////////////////////////////////////////////////////
// Inclusions of header files

#include "ActorEditor.h"

#include "PresetMan.h"
#include "MovableMan.h"
#include "FrameMan.h"
#include "CameraMan.h"
#include "UInputMan.h"
//#include "AHuman.h"
//#include "MOPixel.h"
// #include "AHuman.h"
// #include "MOPixel.h"
#include "SLTerrain.h"
#include "Controller.h"
//#include "AtomGroup.h"
// #include "AtomGroup.h"
#include "Actor.h"
#include "AHuman.h"
#include "ACRocket.h"
Expand All @@ -35,22 +23,11 @@ namespace RTE {

ConcreteClassInfo(ActorEditor, EditorActivity, 0);

//////////////////////////////////////////////////////////////////////////////////////////
// Method: Clear
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Clears all the member variables of this ActorEditor, effectively
// resetting the members of this abstraction level only.

void ActorEditor::Clear() {
m_pEditedActor = 0;
m_pPicker = 0;
}

//////////////////////////////////////////////////////////////////////////////////////////
// Virtual method: Create
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Makes the ActorEditor object ready for use.

int ActorEditor::Create() {
if (EditorActivity::Create() < 0)
return -1;
Expand All @@ -60,11 +37,6 @@ namespace RTE {
return 0;
}

//////////////////////////////////////////////////////////////////////////////////////////
// Virtual method: Create
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Creates a ActorEditor to be identical to another, by deep copy.

int ActorEditor::Create(const ActorEditor& reference) {
if (EditorActivity::Create(reference) < 0)
return -1;
Expand All @@ -75,14 +47,6 @@ namespace RTE {
return 0;
}

//////////////////////////////////////////////////////////////////////////////////////////
// Virtual method: ReadProperty
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Reads a property value from a reader stream. If the name isn't
// recognized by this class, then ReadProperty of the parent class
// is called. If the property isn't recognized by any of the base classes,
// false is returned, and the reader's position is untouched.

int ActorEditor::ReadProperty(const std::string_view& propName, Reader& reader) {
StartPropertyList(return EditorActivity::ReadProperty(propName, reader));
/*
Expand All @@ -93,22 +57,11 @@ namespace RTE {
EndPropertyList;
}

//////////////////////////////////////////////////////////////////////////////////////////
// Virtual method: Save
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Saves the complete state of this ActorEditor with a Writer for
// later recreation with Create(Reader &reader);

int ActorEditor::Save(Writer& writer) const {
EditorActivity::Save(writer);
return 0;
}

//////////////////////////////////////////////////////////////////////////////////////////
// Method: Destroy
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Destroys and resets (through Clear()) the ActorEditor object.

void ActorEditor::Destroy(bool notInherited) {
delete m_pEditedActor;
delete m_pPicker;
Expand All @@ -118,12 +71,6 @@ namespace RTE {
Clear();
}

//////////////////////////////////////////////////////////////////////////////////////////
// Virtual method: Start
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Officially starts this. Creates all the data etc necessary to start
// the activity.

int ActorEditor::Start() {
int error = EditorActivity::Start();

Expand All @@ -144,33 +91,17 @@ namespace RTE {
return error;
}

//////////////////////////////////////////////////////////////////////////////////////////
// Method: Pause
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Pauses and unpauses the game.

void ActorEditor::SetPaused(bool pause) {
// Override the pause
m_Paused = false;
}

//////////////////////////////////////////////////////////////////////////////////////////
// Method: End
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Forces the current game's end.

void ActorEditor::End() {
EditorActivity::End();

m_ActivityState = ActivityState::Over;
}

//////////////////////////////////////////////////////////////////////////////////////////
// Method: Update
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Updates the state of this ActorEditor. Supposed to be done every frame
// before drawing.

void ActorEditor::Update() {
// And object hasn't been loaded yet, so get the loading picker going
if (!m_pEditedActor) {
Expand Down Expand Up @@ -245,11 +176,6 @@ namespace RTE {
}
}

//////////////////////////////////////////////////////////////////////////////////////////
// Method: DrawGUI
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Draws the currently active GUI of a screen to a BITMAP of choice.

void ActorEditor::DrawGUI(BITMAP* pTargetBitmap, const Vector& targetPos, int which) {
// Draw the edited actor and pie menu
if (m_pEditedActor) {
Expand All @@ -266,21 +192,10 @@ namespace RTE {
EditorActivity::DrawGUI(pTargetBitmap, targetPos, which);
}

//////////////////////////////////////////////////////////////////////////////////////////
// Method: Draw
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Draws this ActorEditor's current graphical representation to a
// BITMAP of choice. This includes all game-related graphics.

void ActorEditor::Draw(BITMAP* pTargetBitmap, const Vector& targetPos) {
EditorActivity::Draw(pTargetBitmap, targetPos);
}

//////////////////////////////////////////////////////////////////////////////////////////
// Method: LoadActor
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Reloads the Actor itself and sets up the pie menu to match its setup.

bool ActorEditor::LoadActor(const Entity* pActorToLoad) {
if (!pActorToLoad)
return false;
Expand Down Expand Up @@ -312,8 +227,6 @@ namespace RTE {
return true;
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

bool ActorEditor::ReloadActorData() {
if (m_pEditedActor) {
std::string presetName = m_pEditedActor->GetPresetName();
Expand Down
Loading