Skip to content

Commit

Permalink
some more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
red031000 committed Oct 19, 2024
1 parent 557f4dd commit 1f32096
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
25 changes: 10 additions & 15 deletions include/map_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,16 @@ s32 MapObject_GetYRange(LocalMapObject *object);
void sub_0205F328(LocalMapObject *obj, u32 param1);
u32 sub_0205F330(LocalMapObject *object);
MapObjectManager *MapObject_GetManager(LocalMapObject *object);
u8 *sub_0205F370(LocalMapObject *object, s32 size);
u8 *sub_0205F394(LocalMapObject *object);
u8 *sub_0205F398(LocalMapObject *object, s32 size);
u8 *sub_0205F3BC(LocalMapObject *object);
u8 *sub_0205F3C0(LocalMapObject *object, s32 size);
u8 *sub_0205F3E4(LocalMapObject *object);
u8 *sub_0205F3E8(LocalMapObject *object, s32 size);
u8 *sub_0205F40C(LocalMapObject *object);
void sub_0205F41C(LocalMapObject *object);
void sub_0205F430(LocalMapObject *object);

// FIXME: Functions beyond here aren't organized according to the corresponding c file
void sub_0205FC94(LocalMapObject *object, u32 movement);
Expand Down Expand Up @@ -275,8 +285,6 @@ void ObjectEvent_SetYRange(ObjectEvent *, s16);
void ObjectEvent_SetXCoord(ObjectEvent *, u32);
void ObjectEvent_SetYCoord(ObjectEvent *, u32);
void ObjectEvent_SetHeight(ObjectEvent *, u32);
u8 *sub_0205F3BC(LocalMapObject *object);
u8 *sub_0205F394(LocalMapObject *object);
BOOL MapObject_CheckIgnoreHeights(LocalMapObject *object);
BOOL MapObject_CheckFlag29(LocalMapObject *object);
fx32 MapObject_GetPosVecYCoord(LocalMapObject *object);
Expand Down Expand Up @@ -307,27 +315,20 @@ u32 sub_0205F544(LocalMapObject *object);
int MapObject_CheckFlag25(LocalMapObject *object);
void MapObject_SetFlag25(LocalMapObject *object, BOOL set);
void sub_0205FD20(LocalMapObject *object);
u8 *sub_0205F3E4(LocalMapObject *object);
u8 *sub_0205F40C(LocalMapObject *object);
void sub_0205F444(LocalMapObject *object);
void sub_0205F450(LocalMapObject *object);
void sub_0205F468(LocalMapObject *object, LocalMapObject_UnkCallback callback);
void sub_0205F47C(LocalMapObject *object, LocalMapObject_UnkCallback callback);
void sub_0205F490(LocalMapObject *object, LocalMapObject_UnkCallback callback);
void sub_0205F498(LocalMapObject *object);
void sub_0205F4A4(LocalMapObject *object, LocalMapObject_UnkCallback callback);
void sub_0205F4B8(LocalMapObject *object, LocalMapObject_UnkCallback callback);
MapObjectManager *sub_0205F364(LocalMapObject *object);
ObjectEvent *ObjectEvent_GetById(u16 id, int num_templates, ObjectEvent *templates);
BOOL FieldSystem_FlagCheck(FieldSystem *, u16);
u16 ObjectEvent_GetXCoord(ObjectEvent *template);
u32 ObjectEvent_GetHeight(ObjectEvent *template);
u16 ObjectEvent_GetYCoord(ObjectEvent *template);
UnkLMOCallbackStruct *sub_0205FB00(u32 movement);
void *sub_0205F538(LocalMapObject *object);
void sub_0205F414(LocalMapObject *object, LocalMapObject_UnkCallback callback);
void sub_0205F428(LocalMapObject *object, LocalMapObject_UnkCallback callback);
void sub_0205F43C(LocalMapObject *object, LocalMapObject_UnkCallback callback);
void sub_0205F470(LocalMapObject *object);
void MapObject_SetFlag14(LocalMapObject *object);
LocalMapObject_UnkCallback sub_0205FB18(UnkLMOCallbackStruct *unk);
Expand All @@ -348,12 +349,6 @@ void sub_0205FCD0(LocalMapObject *object);
BOOL sub_0205F73C(LocalMapObject *object);
BOOL sub_0205F5D4(MapObjectManager *manager);
SysTask *sub_0205F340(LocalMapObject *object);
u8 *sub_0205F370(LocalMapObject *object, s32 size);
u8 *sub_0205F398(LocalMapObject *object, s32 size);
u8 *sub_0205F3C0(LocalMapObject *object, s32 size);
u8 *sub_0205F3E8(LocalMapObject *object, s32 size);
void sub_0205F41C(LocalMapObject *object);
void sub_0205F430(LocalMapObject *object);
void sub_0205F484(LocalMapObject *object);
void MapObject_SetMovementCommand(LocalMapObject *object, u32 command);
u32 MapObject_GetMovementCommand(LocalMapObject *object);
Expand Down
19 changes: 12 additions & 7 deletions src/map_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ static void sub_0205F338(LocalMapObject *object, SysTask *sysTask);
static SysTask *sub_0205F340(LocalMapObject *object);
static void sub_0205F348(LocalMapObject *object);
static void MapObject_SetManager(LocalMapObject *object, MapObjectManager *manager);
static MapObjectManager *MapObject_GetManagerFromManager(LocalMapObject *object);
static void sub_0205F414(LocalMapObject *object, LocalMapObject_UnkCallback callback);
static void sub_0205F428(LocalMapObject *object, LocalMapObject_UnkCallback callback);
static void sub_0205F43C(LocalMapObject *object, LocalMapObject_UnkCallback callback);
static void sub_0205F444(LocalMapObject *object);

MapObjectManager *MapObjectManager_Init(FieldSystem *fieldSystem, u32 objectCount, u32 priority) {
MapObjectManager *ret = MapObjectManager_New(objectCount);
Expand Down Expand Up @@ -217,7 +222,7 @@ void MapObject_Remove(LocalMapObject *object) {
}
sub_0205F444(object);
sub_0205F348(object);
sub_0205F174(sub_0205F364(object));
sub_0205F174(MapObject_GetManagerFromManager(object));
MapObject_Clear(object);
}

Expand Down Expand Up @@ -1139,7 +1144,7 @@ MapObjectManager *MapObject_GetManager(LocalMapObject *object) {
return object->manager;
}

MapObjectManager *sub_0205F364(LocalMapObject *object) {
static MapObjectManager *MapObject_GetManagerFromManager(LocalMapObject *object) {
return MapObjectManager_Get(object->manager);
}

Expand Down Expand Up @@ -1191,27 +1196,27 @@ u8 *sub_0205F40C(LocalMapObject *object) {
return object->unk108;
}

void sub_0205F414(LocalMapObject *object, LocalMapObject_UnkCallback callback) {
static void sub_0205F414(LocalMapObject *object, LocalMapObject_UnkCallback callback) {
object->unkB8 = callback;
}

void sub_0205F41C(LocalMapObject *object) {
object->unkB8(object);
}

void sub_0205F428(LocalMapObject *object, LocalMapObject_UnkCallback callback) {
static void sub_0205F428(LocalMapObject *object, LocalMapObject_UnkCallback callback) {
object->unkBC = callback;
}

void sub_0205F430(LocalMapObject *object) {
object->unkBC(object);
}

void sub_0205F43C(LocalMapObject *object, LocalMapObject_UnkCallback callback) {
static void sub_0205F43C(LocalMapObject *object, LocalMapObject_UnkCallback callback) {
object->unkC0 = callback;
}

void sub_0205F444(LocalMapObject *object) {
static void sub_0205F444(LocalMapObject *object) {
object->unkC0(object);
}

Expand Down Expand Up @@ -1305,7 +1310,7 @@ u16 sub_0205F524(LocalMapObject *object) {
}

FieldSystem *MapObject_GetFieldSystem(LocalMapObject *object) {
return MapObjectManager_GetFieldSystem(sub_0205F364(object));
return MapObjectManager_GetFieldSystem(MapObject_GetManagerFromManager(object));
}

void *sub_0205F538(LocalMapObject *object) { // TODO: this is not void
Expand Down

0 comments on commit 1f32096

Please sign in to comment.