summaryrefslogtreecommitdiff
path: root/src/engine/objects/CheepCheep.h
diff options
context:
space:
mode:
authorMegaMech <MegaMech@users.noreply.github.com>2025-11-09 19:07:44 -0700
committerGitHub <noreply@github.com>2025-11-09 19:07:44 -0700
commitde9c5d510175bba11ab8704e67be3a3a94f9149e (patch)
tree34c42dbfe9f2a6eb5fbce5f6a31b532ff2a3f243 /src/engine/objects/CheepCheep.h
parent760fa3bf5226c2a6052a5d4d53fd0e27f2911e60 (diff)
Implement SpawnParams struct (#536)
* Impl SpawnParams * Added json submodule * Update json * Update * Works * Remove comment * Works refactor * Snowman and thwomp working * Impl hot air balloon * More progress * All OObjects are done * cleanup * Refactor 2Dpath to normal path * Update nlohmann json & fix compile * Rest of actors * MORE CHANGES * Finish actors * Done PR, some fix to collision viewer * Impl falling rocks * Add const * wip editor refactor * Property work * continue * Overridable editor properties * Actor saving/loading works now * Fix light alignment * Clarification * Impl penguin * params impl signs * properties impl falling rock * More property impls * impl air balloon * Add spawnParams to OObject Translate * Snowman translate better * impl hedgehog properly * properties impl trophy * thwomp progress * Finish impl properties * Fix compile * Fix cursor collisions * Move registered actors * Rename pathPoint XYZ to xyz * Fix editor pause bug * Clean up * Review comments * Remove SpawnParams struct from actor classes * Rename * Player Label First Iteration * Work now * Working 3d text * Fix boo bug * Finish AText actor * Fix spawnparams compile * Register AText * Finish Text Actor * Fix thwomp interpolation * Fix compile * Fix crab and hedgehog * Fix loading flagpole * Fix Hot Air Balloon * Turn zbuffer on for AText * Update --------- Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com>
Diffstat (limited to 'src/engine/objects/CheepCheep.h')
-rw-r--r--src/engine/objects/CheepCheep.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/engine/objects/CheepCheep.h b/src/engine/objects/CheepCheep.h
index 32e9a5aeb..4cbe8bd60 100644
--- a/src/engine/objects/CheepCheep.h
+++ b/src/engine/objects/CheepCheep.h
@@ -3,6 +3,7 @@
#include <libultraship.h>
#include <vector>
#include "Object.h"
+#include "engine/CoreMath.h"
#include "World.h"
@@ -18,20 +19,30 @@ extern "C" {
class OCheepCheep : public OObject {
public:
- enum CheepType {
+ enum class Behaviour : int16_t {
RACE,
PODIUM_CEREMONY
};
- enum Behaviour : uint16_t {
- };
+ // This is simply a helper function to keep Spawning code clean
+ static inline OCheepCheep* Spawn(const FVector& pos, Behaviour behaviour, IPathSpan span) {
+ SpawnParams params = {
+ .Name = "mk:cheep_cheep",
+ .Behaviour = static_cast<int16_t>(behaviour),
+ .Location = pos,
+ .PathSpan = span,
+ };
+ return static_cast<OCheepCheep*>(gWorldInstance.AddObject(new OCheepCheep(params)));
+ }
-public:
+ explicit OCheepCheep(const SpawnParams& params);
- explicit OCheepCheep(const FVector& pos, CheepType type, IPathSpan span);
+ IPathSpan ActivationPoints; // Path points activation points
+ virtual void SetSpawnParams(SpawnParams& params) override;
virtual void Tick() override;
virtual void Draw(s32 cameraId) override;
+ virtual void DrawEditorProperties() override;
void func_8007BBBC(s32 objectIndex);
void func_8007BD04(s32 playerId);
void init_var_cheep_cheep(s32 objectIndex);
@@ -41,8 +52,5 @@ public:
private:
s32 _idx;
- CheepType _type;
- FVector _spawnPos;
- IPathSpan _span;
-
+ Behaviour _behaviour;
};