From 7f22f75db7fa7a1b2149bc953d2a159c52bc5e8b Mon Sep 17 00:00:00 2001 From: MegaMech Date: Fri, 13 Dec 2024 15:19:39 -0700 Subject: Trophy, Object impl, and cleanup --- src/engine/objects/GameObject.cpp | 20 -------------------- src/engine/objects/GameObject.h | 24 ------------------------ src/engine/objects/Object.cpp | 20 ++++++++++++++++++++ src/engine/objects/Object.h | 24 ++++++++++++++++++++++++ src/engine/objects/Thwomp.h | 2 +- src/engine/objects/Trophy.h | 11 +++++++++++ 6 files changed, 56 insertions(+), 45 deletions(-) delete mode 100644 src/engine/objects/GameObject.cpp delete mode 100644 src/engine/objects/GameObject.h create mode 100644 src/engine/objects/Object.cpp create mode 100644 src/engine/objects/Object.h (limited to 'src/engine/objects') diff --git a/src/engine/objects/GameObject.cpp b/src/engine/objects/GameObject.cpp deleted file mode 100644 index c7be32769..000000000 --- a/src/engine/objects/GameObject.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include "GameObject.h" - -#include "World.h" - -extern "C" { - #include "camera.h" -} - - - //GameActor() - -GameObject::GameObject() {} - - // Virtual functions to be overridden by derived classes -void GameObject::Tick() { } -void GameObject::Draw(Camera* camera) { } -void GameObject::Collision() {} -void GameObject::Expire() { } -void GameObject::Destroy() { } diff --git a/src/engine/objects/GameObject.h b/src/engine/objects/GameObject.h deleted file mode 100644 index 19d5301cd..000000000 --- a/src/engine/objects/GameObject.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include - -extern "C" { - #include "camera.h" - #include "objects.h" -} - -class GameObject { -public: - uint8_t uuid[16]; - Object o; - - virtual ~GameObject() = default; - - explicit GameObject(); - - virtual void Tick(); - virtual void Draw(Camera* camera); - virtual void Collision(); - virtual void Expire(); - virtual void Destroy(); -}; diff --git a/src/engine/objects/Object.cpp b/src/engine/objects/Object.cpp new file mode 100644 index 000000000..74143a923 --- /dev/null +++ b/src/engine/objects/Object.cpp @@ -0,0 +1,20 @@ +#include +#include "Object.h" + +#include "World.h" + +extern "C" { + #include "camera.h" +} + + + //GameActor() + +OObject::OObject() {} + + // Virtual functions to be overridden by derived classes +void OObject::Tick() { } +void OObject::Draw(s32 cameraId) { } +void OObject::Collision() {} +void OObject::Expire() { } +void OObject::Destroy() { } diff --git a/src/engine/objects/Object.h b/src/engine/objects/Object.h new file mode 100644 index 000000000..c41cfae6d --- /dev/null +++ b/src/engine/objects/Object.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +extern "C" { + #include "camera.h" + #include "objects.h" +} + +class OObject { +public: + uint8_t uuid[16]; + Object o; + + virtual ~OObject() = default; + + explicit OObject(); + + virtual void Tick(); + virtual void Draw(s32 cameraId); + virtual void Collision(); + virtual void Expire(); + virtual void Destroy(); +}; diff --git a/src/engine/objects/Thwomp.h b/src/engine/objects/Thwomp.h index 517d2972d..f64318e4d 100644 --- a/src/engine/objects/Thwomp.h +++ b/src/engine/objects/Thwomp.h @@ -18,7 +18,7 @@ extern "C" { //! @todo make adjustable properties for squishSize and boundingBoxSize /** - * Thwomp GameObject + * Thwomp OObject * * The game automatically places the actor on the ground so you do not need to provide a Y coordinate value. * diff --git a/src/engine/objects/Trophy.h b/src/engine/objects/Trophy.h index 76834d77e..d73e04929 100644 --- a/src/engine/objects/Trophy.h +++ b/src/engine/objects/Trophy.h @@ -15,6 +15,17 @@ extern "C" { #include "some_data.h" } +//! @todo move this like World.h or something +struct FVector { + float x, y, z; + + FVector& operator=(const FVector& other) { + x = other.x; + y = other.y; + z = other.z; + return *this; + } +}; class OTrophy : public OObject { public: -- cgit v1.2.3