summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAetias <144526980+AetiasHax@users.noreply.github.com>2025-07-25 15:59:54 +0200
committerGitHub <noreply@github.com>2025-07-25 15:59:54 +0200
commit8ad6359c7d3c7afcbddd7d450b7fa4b9764255b6 (patch)
tree09095f8f36375fe4bb358c163d614ebfbc8fe344 /include
parentdda45d5574798dc45a31437f473eaa55b9142e13 (diff)
ActorSwitchObject OK (#130)
* Map symbol in Game * ActorSwitchObject OK * Mark ActorSwitchObject as complete * Document `mTrapActors` * Fix FilterActorBase * Fix regressions
Diffstat (limited to 'include')
-rw-r--r--include/Actor/ActorManager.hpp6
-rw-r--r--include/Actor/ActorRef.hpp4
-rw-r--r--include/Actor/ActorSpawner.hpp6
-rw-r--r--include/Actor/Dungeon/ActorSwitchObject.hpp11
-rw-r--r--include/Actor/FilterActorBase.hpp10
-rw-r--r--include/Map/Course.hpp11
-rw-r--r--include/Map/MapBase.hpp18
-rw-r--r--include/Map/MapManager.hpp42
-rw-r--r--include/Map/TilePos.hpp17
-rw-r--r--include/Player/PlayerControl.hpp8
-rw-r--r--include/Unknown/UnkStruct_020eec9c.hpp1
11 files changed, 87 insertions, 47 deletions
diff --git a/include/Actor/ActorManager.hpp b/include/Actor/ActorManager.hpp
index fd246f37..08ef7fd2 100644
--- a/include/Actor/ActorManager.hpp
+++ b/include/Actor/ActorManager.hpp
@@ -78,13 +78,13 @@ public:
/* c4 */
void DeleteActor(u32 index, bool param2);
- static void func_ov00_020c3484(ActorRef *ref, ActorManager *actorMgr, unk32 param3);
+ ActorRef func_ov00_020c3484(unk32 param3);
void Actor_vfunc_10(u32 param1);
Actor *FindActorById(s32 id);
Actor *GetActor(ActorRef *ref);
s32 FilterActors(FilterActorBase *filter, ActorList *filteredActors);
- static void FindActorByType(ActorRef *ref, ActorManager *actorMgr, ActorTypeId type);
- static void FindNearestActorOfType(ActorRef *ref, ActorManager *actorMgr, ActorTypeId type, Vec3p *pos);
+ ActorRef FindActorByType(ActorTypeId type);
+ ActorRef FindNearestActorOfType(ActorTypeId type, Vec3p *pos);
bool func_ov00_020c398c(u32 index);
void func_ov00_020c399c(u32 index, Cylinder *cylinder);
Actor *func_ov00_020c39ac(s32 index, const ActorTypeId *actorTypes, bool param3);
diff --git a/include/Actor/ActorRef.hpp b/include/Actor/ActorRef.hpp
index eeace571..5ef03f2c 100644
--- a/include/Actor/ActorRef.hpp
+++ b/include/Actor/ActorRef.hpp
@@ -8,7 +8,9 @@ struct ActorRef {
/* 4 */ s32 index;
/* 8 */
- inline ActorRef() {}
+ inline ActorRef() {
+ Reset();
+ }
inline ActorRef(s32 id, s32 index) :
id(id),
index(index) {}
diff --git a/include/Actor/ActorSpawner.hpp b/include/Actor/ActorSpawner.hpp
index e99bafb3..05bb46a9 100644
--- a/include/Actor/ActorSpawner.hpp
+++ b/include/Actor/ActorSpawner.hpp
@@ -19,6 +19,12 @@ struct ActorSpawnOptions {
/* 24 */ unk32 mUnk_24;
/* 28 */ unk32 mUnk_28;
/* 2c */
+
+ void func_ov000_020c3348();
+ inline ActorSpawnOptions() :
+ mUnk_1c(-1, -1) {
+ func_ov000_020c3348();
+ }
};
class ActorSpawner : public SysObject {
diff --git a/include/Actor/Dungeon/ActorSwitchObject.hpp b/include/Actor/Dungeon/ActorSwitchObject.hpp
index 0658fcb2..12fcc16a 100644
--- a/include/Actor/Dungeon/ActorSwitchObject.hpp
+++ b/include/Actor/Dungeon/ActorSwitchObject.hpp
@@ -17,7 +17,7 @@ public:
/* 164 */ unk32 mUnk_164;
/* 168 */ unk32 mUnk_168;
/* 16c */ u32 mUnk_16c;
- /* 170 */ ActorRef mUnk_170[5];
+ /* 170 */ ActorRef mTrapActors[5];
/* 198 */
/* 00 */ virtual ~ActorSwitchObject() override;
@@ -27,10 +27,17 @@ public:
/* 18 */ virtual void vfunc_18(u32 param1) override;
/* b4 */
+ inline ActorSwitchObject() :
+ mUnk_158(0),
+ mUnk_15c(0),
+ mUnk_160(0),
+ mUnk_164(0),
+ mUnk_168(0) {}
+
static ActorSwitchObject *Create();
bool func_ov000_0208fc10(s32 param1);
void func_ov000_0208fc7c();
- bool func_ov000_0208fcb4();
+ unk32 func_ov000_0208fcb4();
void func_ov000_0208fef8();
void func_ov000_0209032c();
};
diff --git a/include/Actor/FilterActorBase.hpp b/include/Actor/FilterActorBase.hpp
index 8d721195..1ef32ccb 100644
--- a/include/Actor/FilterActorBase.hpp
+++ b/include/Actor/FilterActorBase.hpp
@@ -20,14 +20,4 @@ public:
class FilterActorReturn {
public:
/* 00 */ ActorRef refs[20];
-
- inline FilterActorReturn() {
- ActorRef *ref = refs;
- ActorRef *end;
- do {
- end = &refs[20];
- ref->Reset();
- ref++;
- } while (ref < end);
- }
};
diff --git a/include/Map/Course.hpp b/include/Map/Course.hpp
index 569f3765..2cbf8387 100644
--- a/include/Map/Course.hpp
+++ b/include/Map/Course.hpp
@@ -5,6 +5,7 @@
#include "Map/Course_Unk_c8.hpp"
#include "Map/MapData.hpp"
+#include "Map/TilePos.hpp"
#include "Physics/AABB.hpp"
#include "System/SysNew.hpp"
@@ -32,11 +33,11 @@ public:
/* 004 */ CourseType mType;
/* 008 */ unk32 mUnk_008;
/* 00c */ char mName[0x10];
- /* 01c */ Vec2b mCurrMapPos; // position in the map grid
- /* 01e */ Vec2b mUnk_01e;
+ /* 01c */ TilePos mCurrMapPos; // position in the map grid
+ /* 01e */ TilePos mUnk_01e;
/* 020 */ u8 mMapGrid[10][10];
- /* 084 */ Vec2b mMainGrid; // part of the grid where you can walk off screen to another map
- /* 086 */ Vec2b mMainGridSize;
+ /* 084 */ TilePos mMainGrid; // part of the grid where you can walk off screen to another map
+ /* 086 */ TilePos mMainGridSize;
/* 088 */ s32 mScreenMapOffsetX;
/* 08c */ s32 mScreenMapOffsetY;
/* 090 */ unk32 mUnk_090;
@@ -68,7 +69,7 @@ public:
void func_ov00_0207ca78(unk32 param_2, unk8 param_3, unk32 param_4);
bool func_ov00_0207caa8(s32 param_2, unk32 *param_3, unk8 *param_4);
unk32 func_ov00_0207cb30(s32 param_2);
- static void FindMapGridPos(Vec2b *pos, Course *param_2, u32 map);
+ TilePos FindMapGridPos(u32 map);
Vec3p *FindMapCenter(unk32 map);
void func_ov00_0207cbe8(s32 param_2);
unk8 func_ov00_0207cc24(s32 param_2);
diff --git a/include/Map/MapBase.hpp b/include/Map/MapBase.hpp
index f711dbbb..286e6156 100644
--- a/include/Map/MapBase.hpp
+++ b/include/Map/MapBase.hpp
@@ -135,22 +135,22 @@ public:
/* 48 */ virtual void vfunc_48();
/* 4c */ virtual s32 vfunc_4c();
/* 50 */ virtual unk32 vfunc_50();
- /* 54 */ virtual unk32 vfunc_54(Vec2b *param_1);
- /* 58 */ virtual unk32 vfunc_58(Vec2b *param_1, int param_2);
+ /* 54 */ virtual unk32 vfunc_54(TilePos *param_1);
+ /* 58 */ virtual unk32 vfunc_58(TilePos *param_1, int param_2);
/* 5c */ virtual unk32 vfunc_5c();
- /* 60 */ virtual unk32 vfunc_60(Vec2b *param_1);
+ /* 60 */ virtual unk32 vfunc_60(TilePos *param_1);
/* 64 */ virtual unk32 vfunc_64();
/* 68 */ virtual unk32 vfunc_68(Vec3p *param_1, bool param_2);
/* 6c */ virtual unk8 vfunc_6c(unk32 param_2, unk32 param_3, unk32 param_4);
/* 70 */ virtual unk32 vfunc_70(Vec3p *param_2);
/* 74 */ virtual unk32 *vfunc_74(Vec3p *param_2);
- /* 78 */ virtual unk32 *vfunc_78(Vec2b *param_1);
+ /* 78 */ virtual unk32 *vfunc_78(TilePos *param_1);
/* 7c */ virtual s32 vfunc_7c(s32 param_1, unk32 *param_2, s32 param_3, short param_4[4]);
/* 80 */ virtual unk32 vfunc_80();
/* 84 */ virtual void vfunc_84(unk32 param_2);
/* 88 */ virtual unk32 vfunc_88();
/* 8c */ virtual unk32 vfunc_8c();
- /* 90 */ virtual unk8 vfunc_90(Vec2b *param_2, unk32 param_3);
+ /* 90 */ virtual unk8 vfunc_90(TilePos *param_2, unk32 param_3);
/* 94 */ virtual void vfunc_94();
/* 98 */ virtual void vfunc_98(unk32 param_2, unk32 param_3, unk32 param_4);
/* 9c */ virtual void vfunc_9c();
@@ -183,13 +183,13 @@ public:
bool func_ov00_0207f38c(s32 *param_2);
void func_ov00_0207f4a4(Vec2s *param_2, unk32 param_3);
static void func_ov00_0207f53c(Vec2s *param_1, MapBase *param_2, Vec3p *param_3);
- static void func_ov00_0207f588(Vec2s *param_1, MapBase *param_2, Vec2b *param_3, unk32 param_4);
+ static void func_ov00_0207f588(Vec2s *param_1, MapBase *param_2, TilePos *param_3, unk32 param_4);
void func_ov00_0207f630(Vec2s *param_2, Vec3p *param_3);
unk8 GetTileStartX(unk32 x);
unk8 GetTileStartZ(unk32 z);
s32 GetTileEndX(unk32 x);
s32 GetTileEndZ(unk32 z);
- void GetTileBounds(Vec2b *tilePos, AABB *bounds);
+ void GetTileBounds(TilePos *tilePos, AABB *bounds);
s32 GetClampedTileX(s32 worldX);
s32 GetClampedTileY(s32 worldZ);
unk8 GetTileX(s32 worldX);
@@ -227,8 +227,8 @@ public:
bool AddUnk_130(s32 param_2);
bool func_ov00_020809b8(s32 param_2);
unk8 func_ov00_02080a78(Vec3p *param_2);
- unk8 func_ov00_02080b24(Vec2b *param_2);
- void func_ov00_02080d08(Vec2b *param_2);
+ unk8 func_ov00_02080b24(TilePos *param_2);
+ void func_ov00_02080d08(TilePos *param_2);
bool TriggerOfType_vfunc_10(unk32 type);
void func_ov00_02080de4();
unk8 func_ov00_02080de8(unk32 param_2);
diff --git a/include/Map/MapManager.hpp b/include/Map/MapManager.hpp
index a6fd03fe..9989f31f 100644
--- a/include/Map/MapManager.hpp
+++ b/include/Map/MapManager.hpp
@@ -16,6 +16,9 @@ struct MapManager_Unk1 {
/* 4 */ unk32 mUnk_4;
/* 8 */
+ inline MapManager_Unk1(unk32 unk0, unk32 unk4) :
+ mUnk_0(unk0),
+ mUnk_4(unk4) {}
~MapManager_Unk1();
};
@@ -24,9 +27,20 @@ struct MapManager_Unk2 {
/* 4 */ unk32 mUnk_4;
/* 8 */
+ inline MapManager_Unk2(unk32 unk0, unk32 unk4) :
+ mUnk_0(unk0),
+ mUnk_4(unk4) {}
~MapManager_Unk2();
};
+struct MapManager_Unk3 {
+ /* 0 */ unk32 mUnk_0;
+ /* 4 */
+
+ inline MapManager_Unk3(unk32 unk0) :
+ mUnk_0(unk0) {}
+};
+
struct UnkStruct_0208210c_param3 {
/* 000 */ unk32 mUnk_00;
/* 004 */ unk8 mUnk_04;
@@ -117,7 +131,7 @@ public:
u8 GetCurrentMapPosY();
u8 func_ov00_02082d40();
u32 func_ov00_02082d74(unk32 param_2);
- void func_ov00_02082d84(Vec2b *param_2, s32 *param_3, s32 *param_4);
+ void func_ov00_02082d84(TilePos *param_2, s32 *param_3, s32 *param_4);
bool func_ov00_02082e1c(s32 *param_2, s32 *param_3);
void func_ov00_0208306c(s32 *param_2, s32 *param_3);
void func_ov00_0208315c(s32 *param_2, s32 *param_3);
@@ -148,7 +162,7 @@ public:
void func_ov00_0208346c(AABB *param_2);
void func_ov00_020834bc(Vec3p *param_2, unk32 param_3, unk32 param_4);
void func_ov00_02083524(Vec3p *param_2, unk32 param_3, unk32 param_4);
- static void func_ov00_02083560(Vec2b *param_1, MapManager *param_2, u32 param_3);
+ TilePos func_ov00_02083560(u32 param_3);
u8 func_ov00_02083570(u8 param_2, u8 param_3);
unk32 func_ov00_02083588();
unk32 func_ov00_020835a4();
@@ -183,37 +197,37 @@ public:
bool func_ov00_020839c4(s32 param_2);
s32 func_ov00_020839d4(s32 param_2);
s32 func_ov00_020839f8(s32 param_2);
- static void func_ov00_02083a1c(Vec2b *param_1, MapManager *param_2, Vec3p *param_3);
- static void func_ov00_02083a54(Vec2b *param_1, MapManager *param_2, Vec3p *param_3, s32 param_4, unk32 param_5);
+ TilePos func_ov00_02083a1c(Vec3p *param_3);
+ TilePos func_ov00_02083a54(Vec3p *param_3, s32 param_4, unk32 param_5);
s32 GetTileStartX(unk32 x);
s32 GetTileStartZ(unk32 z);
s32 GetTileEndX(unk32 x);
s32 GetTileEndZ(unk32 z);
s32 func_ov00_02083c24(unk32 x);
s32 func_ov00_02083c50(unk32 z);
- void func_ov00_02083c7c(Vec3p *param_2, Vec2b param_3);
- void func_ov00_02083ce8(Vec3p *param_2, Vec2b param_3, s32 param_4, u32 param_5);
+ void func_ov00_02083c7c(Vec3p *param_2, TilePos param_3);
+ void func_ov00_02083ce8(Vec3p *param_2, TilePos param_3, s32 param_4, u32 param_5);
s32 func_ov00_02083e34(unk8 param_2, unk8 param_3, unk32 param_4);
- unk32 MapData_vfunc_60(Vec2b *param_1);
- bool func_ov00_02083e70(Vec2b *param_2);
+ unk32 MapData_vfunc_60(TilePos *param_1);
+ bool func_ov00_02083e70(TilePos *param_2);
unk32 MapData_vfunc_68(Vec3p *param_1, bool param_2);
s32 func_ov00_02083ef8(Vec3p *param_2, Vec3p *param_3, bool param_4);
unk32 func_ov00_02083f44(Vec3p *param_2, bool param_3);
unk8 MapData_vfunc_6c(unk32 param_2, unk32 param_3, unk32 param_4);
unk32 MapData_vfunc_70(Vec3p *param_2);
static void func_ov00_02083fb0(u32 *param_1, MapManager *param_2, Vec3p *param_3);
- void GetTileWorldBounds(Vec2b *tile, AABB *tileBounds);
- unk32 MapData_vfunc_54(Vec2b *a);
+ void GetTileWorldBounds(TilePos *tile, AABB *tileBounds);
+ unk32 MapData_vfunc_54(TilePos *a);
unk32 func_ov00_020840a0(u8 param_2, u8 param_3);
- unk32 *MapData_vfunc_78(Vec2b *param_1);
- unk32 func_ov00_020840dc(Vec2b *param_1);
+ unk32 *MapData_vfunc_78(TilePos *param_1);
+ unk32 func_ov00_020840dc(TilePos *param_1);
static unk8 func_ov00_02084100(unk32 *param_1, MapManager *param_2);
unk32 GetMapData_Unk_48();
unk32 GetMapData_Unk_4c();
unk32 func_ov00_0208412c();
void func_ov00_0208413c(unk32 param_2);
- unk8 MapData_vfunc_58(Vec2b *param_1, int param_2);
- s32 func_ov00_02084164(Vec2b *param_2);
+ unk8 MapData_vfunc_58(TilePos *param_1, int param_2);
+ s32 func_ov00_02084164(TilePos *param_2);
u8 GetMapData_Unk_0a();
u8 GetMapData_Unk_0b();
unk8 MapData_vfunc_a4(unk8 *param_1);
diff --git a/include/Map/TilePos.hpp b/include/Map/TilePos.hpp
new file mode 100644
index 00000000..419361d9
--- /dev/null
+++ b/include/Map/TilePos.hpp
@@ -0,0 +1,17 @@
+#pragma once
+
+#include "global.h"
+#include "types.h"
+
+class TilePos {
+public:
+ u8 x;
+ u8 y;
+
+ inline TilePos() :
+ x(0),
+ y(0) {}
+ inline TilePos(u8 x, u8 y) :
+ x(x),
+ y(y) {}
+};
diff --git a/include/Player/PlayerControl.hpp b/include/Player/PlayerControl.hpp
index 11dd6488..adf10925 100644
--- a/include/Player/PlayerControl.hpp
+++ b/include/Player/PlayerControl.hpp
@@ -1,13 +1,15 @@
#pragma once
#include "global.h"
-#include "nds/math.h"
#include "types.h"
+#include <nds/math.h>
+
#include "Actor/Actor.hpp"
#include "Actor/ActorManager.hpp"
#include "Debug/DebugHierarchy.hpp"
#include "Item/Item.hpp"
+#include "Map/TilePos.hpp"
#include "Player/TouchControl.hpp"
#include "Player/TouchGesture.hpp"
@@ -57,7 +59,7 @@ public:
/* 84 */ ActorRef mFollowRef;
/* 8c */ ActorRef mNextFollowRef;
/* 94 */ ActorRef mLastFollowRef;
- /* 9c */ Vec2b mUnk_9c;
+ /* 9c */ TilePos mUnk_9c;
/* 9e */ unk8 mUnk_9e[2];
/* a0 */ void *mFollowObject;
/* a4 */ q20 mFollowDist;
@@ -78,7 +80,7 @@ public:
void func_ov00_020aef30();
void UpdateAim();
Actor *GetFollowActor();
- bool func_ov00_020af01c(Vec2b *param1);
+ bool func_ov00_020af01c(TilePos *param1);
void SetUnk_80();
void StopFollowing();
void func_ov00_020af06c();
diff --git a/include/Unknown/UnkStruct_020eec9c.hpp b/include/Unknown/UnkStruct_020eec9c.hpp
index 9fce4067..bcb289ff 100644
--- a/include/Unknown/UnkStruct_020eec9c.hpp
+++ b/include/Unknown/UnkStruct_020eec9c.hpp
@@ -38,6 +38,7 @@ public:
void func_ov000_020d77e4(unk32);
unk32 func_ov000_020d7f18(unk32);
+ void func_ov000_020d7ad4(unk32);
void func_ov008_0211337c();
};