Skip to content

Commit

Permalink
Merge pull request #313 from cbt6/map-object
Browse files Browse the repository at this point in the history
Document some map object functions
  • Loading branch information
lhearachel authored Dec 4, 2024
2 parents f172250 + 650e797 commit 2ae37a0
Show file tree
Hide file tree
Showing 61 changed files with 1,272 additions and 1,279 deletions.
9 changes: 9 additions & 0 deletions include/constants/map_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@

// Status Flags
#define MAP_OBJ_STATUS_0 (1 << 0)
#define MAP_OBJ_STATUS_1 (1 << 1)
#define MAP_OBJ_STATUS_START_MOVEMENT (1 << 2)
#define MAP_OBJ_STATUS_END_MOVEMENT (1 << 3)
#define MAP_OBJ_STATUS_4 (1 << 4)
#define MAP_OBJ_STATUS_5 (1 << 5)
#define MAP_OBJ_STATUS_PAUSE_MOVEMENT (1 << 6)
#define MAP_OBJ_STATUS_LOCK_DIR (1 << 7)
#define MAP_OBJ_STATUS_PAUSE_ANIMATION (1 << 8)
Expand All @@ -22,6 +24,7 @@
#define MAP_OBJ_STATUS_12 (1 << 12)
#define MAP_OBJ_STATUS_13 (1 << 13)
#define MAP_OBJ_STATUS_14 (1 << 14)
#define MAP_OBJ_STATUS_15 (1 << 15)
#define MAP_OBJ_STATUS_16 (1 << 16)
#define MAP_OBJ_STATUS_17 (1 << 17)
#define MAP_OBJ_STATUS_18 (1 << 18)
Expand All @@ -30,5 +33,11 @@
#define MAP_OBJ_STATUS_21 (1 << 21)
#define MAP_OBJ_STATUS_22 (1 << 22)
#define MAP_OBJ_STATUS_23 (1 << 23)
#define MAP_OBJ_STATUS_24 (1 << 24)
#define MAP_OBJ_STATUS_25 (1 << 25)
#define MAP_OBJ_STATUS_26 (1 << 26)
#define MAP_OBJ_STATUS_27 (1 << 27)
#define MAP_OBJ_STATUS_28 (1 << 28)
#define MAP_OBJ_STATUS_29 (1 << 29)

#endif
172 changes: 86 additions & 86 deletions include/map_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,47 +64,47 @@ void MapObjectMan_SetFieldSystem(MapObjectManager *param0, FieldSystem *fieldSys
FieldSystem *MapObjectMan_FieldSystem(const MapObjectManager *param0);
void sub_0206289C(MapObjectManager *param0, NARC *param1);
NARC *sub_020628A0(const MapObjectManager *param0);
void sub_020628B4(MapObject *param0, u32 param1);
u32 sub_020628B8(const MapObject *param0);
void MapObject_SetStatusFlagOn(MapObject *param0, u32 param1);
void MapObject_SetStatusFlagOff(MapObject *param0, u32 param1);
u32 MapObject_CheckStatus(const MapObject *param0, u32 param1);
u32 MapObject_GetStateFlag(const MapObject *param0, u32 param1);
void MapObject_SetStatus(MapObject *mapObj, u32 status);
u32 MapObject_GetStatus(const MapObject *mapObj);
void MapObject_SetStatusFlagOn(MapObject *mapObj, u32 flag);
void MapObject_SetStatusFlagOff(MapObject *mapObj, u32 flag);
u32 MapObject_CheckStatus(const MapObject *mapObj, u32 flag);
BOOL MapObject_CheckStatusFlag(const MapObject *mapObj, u32 flag);
void sub_020628E8(MapObject *param0, u32 param1);
u32 sub_020628EC(const MapObject *param0);
void sub_020628F0(MapObject *param0, u32 param1);
void sub_020628F8(MapObject *param0, u32 param1);
u32 sub_02062904(const MapObject *param0, u32 param1);
void MapObject_SetId(MapObject *param0, u32 param1);
u32 MapObject_Id(const MapObject *param0);
void MapObject_SetLocalID(MapObject *mapObj, u32 localID);
u32 MapObject_GetLocalID(const MapObject *mapObj);
void sub_02062914(MapObject *param0, int param1);
int sub_02062918(const MapObject *param0);
void sub_0206291C(MapObject *param0, u32 param1);
u32 sub_02062920(const MapObject *param0);
void MapObject_SetGraphicsID(MapObject *mapObj, u32 graphicsID);
u32 MapObject_GetGraphicsID(const MapObject *mapObj);
u32 sub_02062924(const MapObject *param0);
void sub_02062944(MapObject *param0, u32 param1);
u32 MapObject_GetMoveCode(const MapObject *param0);
void sub_0206294C(MapObject *param0, u32 param1);
u32 MapObject_GetEventType(const MapObject *param0);
void sub_02062954(MapObject *param0, u32 param1);
u32 sub_02062958(const MapObject *param0);
void sub_0206295C(MapObject *param0, u32 param1);
u32 MapObject_GetEventID(const MapObject *param0);
void sub_02062964(MapObject *param0, int param1);
u32 sub_02062968(const MapObject *param0);
void sub_0206296C(MapObject *param0, int param1);
void MapObject_SetDir(MapObject *param0, int param1);
int MapObject_Dir(const MapObject *param0);
int sub_02062990(const MapObject *param0);
void sub_02062994(MapObject *param0, int param1);
int MapObject_GetMoveDir(const MapObject *param0);
void sub_020629A0(MapObject *param0, int param1);
void sub_020629B4(MapObject *param0, int param1, int param2);
int sub_020629D8(const MapObject *param0, int param1);
void sub_020629FC(MapObject *param0, int param1);
int MapObject_MaxXOffset(const MapObject *param0);
void sub_02062A04(MapObject *param0, int param1);
int MapObject_MaxZOffset(const MapObject *param0);
void MapObject_SetMovementType(MapObject *mapObj, u32 movementType);
u32 MapObject_GetMovementType(const MapObject *mapObj);
void MapObject_SetTrainerType(MapObject *mapObj, u32 trainerType);
u32 MapObject_GetTrainerType(const MapObject *mapObj);
void MapObject_SetFlag(MapObject *mapObj, u32 flag);
u32 MapObject_GetFlag(const MapObject *mapObj);
void MapObject_SetScript(MapObject *mapObj, u32 script);
u32 MapObject_GetScript(const MapObject *mapObj);
void MapObject_SetInitialDir(MapObject *mapObj, int initialDir);
u32 MapObject_GetInitialDir(const MapObject *mapObj);
void MapObject_Face(MapObject *mapObj, int dir);
void MapObject_TryFace(MapObject *mapObj, int dir);
int MapObject_GetFacingDir(const MapObject *mapObj);
int MapObject_GetPrevFacingDir(const MapObject *mapObj);
void MapObject_Turn(MapObject *mapObj, int dir);
int MapObject_GetMovingDir(const MapObject *mapObj);
void MapObject_TryFaceAndTurn(MapObject *param0, int dir);
void MapObject_SetDataAt(MapObject *mapObj, int value, int index);
int MapObject_GetDataAt(const MapObject *mapObj, int index);
void MapObject_SetMovementRangeX(MapObject *mapObj, int movementRangeX);
int MapObject_GetMovementRangeX(const MapObject *mapObj);
void MapObject_SetMovementRangeZ(MapObject *mapObj, int movementRangeZ);
int MapObject_GetMovementRangeZ(const MapObject *mapObj);
void sub_02062A0C(MapObject *param0, u32 param1);
u32 sub_02062A14(const MapObject *param0);
void sub_02062A1C(MapObject *param0, SysTask *param1);
Expand Down Expand Up @@ -137,8 +137,8 @@ void sub_02062B88(MapObject *param0, UnkFuncPtr_ov5_021FB0F0_3 param1);
void sub_02062B90(MapObject *param0);
void sub_02062B9C(MapObject *param0, UnkFuncPtr_ov5_021FB0F0_4 param1);
void sub_02062BA4(MapObject *param0);
void MapObject_SetAnimationCode(MapObject *param0, int param1);
int MapObject_AnimationCode(const MapObject *param0);
void MapObject_SetMovementAction(MapObject *mapObj, int movementAction);
int MapObject_GetMovementAction(const MapObject *mapObj);
void sub_02062BC0(MapObject *param0, int param1);
void sub_02062BC8(MapObject *param0);
int sub_02062BD8(const MapObject *param0);
Expand Down Expand Up @@ -192,31 +192,31 @@ void sub_02062F90(MapObject *param0, int param1);
int sub_02062FAC(const MapObject *param0);
void sub_02062FC4(MapObject *param0, int param1);
int sub_02062FDC(const MapObject *param0);
int MapObject_XInitial(const MapObject *param0);
void MapObject_SetXInitial(MapObject *param0, int param1);
int MapObject_YInitial(const MapObject *param0);
void MapObject_SetYInitial(MapObject *param0, int param1);
int MapObject_ZInitial(const MapObject *param0);
void MapObject_SetZInitial(MapObject *param0, int param1);
int MapObject_XPosPrev(const MapObject *param0);
void MapObject_SetXPosPrev(MapObject *param0, int param1);
int MapObject_YPosPrev(const MapObject *param0);
void MapObject_SetYPosPrev(MapObject *param0, int param1);
int MapObject_ZPosPrev(const MapObject *param0);
void MapObject_SetZPosPrev(MapObject *param0, int param1);
int MapObject_GetXPos(const MapObject *param0);
void MapObject_SetX(MapObject *param0, int param1);
void MapObject_AddX(MapObject *param0, int param1);
int MapObject_GetYPos(const MapObject *param0);
void MapObject_SetY(MapObject *param0, int param1);
void MapObject_AddY(MapObject *param0, int param1);
int MapObject_GetZPos(const MapObject *param0);
void MapObject_SetZ(MapObject *param0, int param1);
void MapObject_AddZ(MapObject *param0, int param1);
void MapObject_PosVectorOut(const MapObject *param0, VecFx32 *param1);
void MapObject_SetPosVec(MapObject *param0, const VecFx32 *param1);
const VecFx32 *MapObject_PosVector(const MapObject *param0);
fx32 sub_02063074(const MapObject *param0);
int MapObject_GetXInitial(const MapObject *mapObj);
void MapObject_SetXInitial(MapObject *mapObj, int x);
int MapObject_GetYInitial(const MapObject *mapObj);
void MapObject_SetYInitial(MapObject *mapObj, int y);
int MapObject_GetZInitial(const MapObject *mapObj);
void MapObject_SetZInitial(MapObject *mapObj, int z);
int MapObject_GetXPrev(const MapObject *mapObj);
void MapObject_SetXPrev(MapObject *mapObj, int x);
int MapObject_GetYPrev(const MapObject *mapObj);
void MapObject_SetYPrev(MapObject *mapObj, int y);
int MapObject_GetZPrev(const MapObject *mapObj);
void MapObject_SetZPrev(MapObject *mapObj, int z);
int MapObject_GetX(const MapObject *mapObj);
void MapObject_SetX(MapObject *mapObj, int x);
void MapObject_AddX(MapObject *mapObj, int dx);
int MapObject_GetY(const MapObject *mapObj);
void MapObject_SetY(MapObject *mapObj, int y);
void MapObject_AddY(MapObject *mapObj, int dy);
int MapObject_GetZ(const MapObject *mapObj);
void MapObject_SetZ(MapObject *mapObj, int z);
void MapObject_AddZ(MapObject *mapObj, int dz);
void MapObject_GetPosPtr(const MapObject *mapObj, VecFx32 *pos);
void MapObject_SetPos(MapObject *mapObj, const VecFx32 *pos);
const VecFx32 *MapObject_GetPos(const MapObject *mapObj);
fx32 MapObject_GetPosY(const MapObject *mapObj);
void sub_02063078(const MapObject *param0, VecFx32 *param1);
void sub_02063088(MapObject *param0, const VecFx32 *param1);
VecFx32 *sub_02063098(MapObject *param0);
Expand All @@ -225,32 +225,32 @@ void sub_020630AC(MapObject *param0, const VecFx32 *param1);
void sub_020630BC(const MapObject *param0, VecFx32 *param1);
void sub_020630CC(MapObject *param0, const VecFx32 *param1);
int sub_020630DC(const MapObject *param0);
void sub_020630F0(ObjectEvent *param0, int param1);
int sub_020630F4(const ObjectEvent *param0);
void sub_020630F8(ObjectEvent *param0, int param1);
int sub_020630FC(const ObjectEvent *param0);
void sub_02063100(ObjectEvent *param0, int param1);
int sub_02063104(const ObjectEvent *param0);
void sub_02063108(ObjectEvent *param0, int param1);
int sub_0206310C(const ObjectEvent *param0);
void sub_02063110(ObjectEvent *param0, int param1);
int sub_02063114(const ObjectEvent *param0);
void sub_02063118(ObjectEvent *param0, int param1);
int sub_0206311C(const ObjectEvent *param0);
void sub_02063120(ObjectEvent *param0, int param1);
int sub_02063124(const ObjectEvent *param0);
void sub_0206312C(ObjectEvent *param0, int param1, int param2);
int sub_02063150(const ObjectEvent *param0, int param1);
void sub_02063174(ObjectEvent *param0, int param1);
int sub_02063178(const ObjectEvent *param0);
void sub_02063180(ObjectEvent *param0, int param1);
int sub_02063184(const ObjectEvent *param0);
void ObjectEvent_SetXPos(ObjectEvent *param0, int param1);
int sub_02063190(const ObjectEvent *param0);
void sub_02063194(ObjectEvent *param0, int param1);
int sub_02063198(const ObjectEvent *param0);
void ObjectEvent_SetZPos(ObjectEvent *param0, int param1);
int sub_020631A0(const ObjectEvent *param0);
void ObjectEvent_SetLocalID(ObjectEvent *objectEvent, int localID);
int ObjectEvent_GetLocalID(const ObjectEvent *objectEvent);
void ObjectEvent_SetGraphicsID(ObjectEvent *objectEvent, int graphicsID);
int ObjectEvent_GetGraphicsID(const ObjectEvent *objectEvent);
void ObjectEvent_SetMovementType(ObjectEvent *objectEvent, int movementType);
int ObjectEvent_GetMovementType(const ObjectEvent *objectEvent);
void ObjectEvent_SetTrainerType(ObjectEvent *objectEvent, int trainerType);
int ObjectEvent_GetTrainerType(const ObjectEvent *objectEvent);
void ObjectEvent_SetFlag(ObjectEvent *objectEvent, int flag);
int ObjectEvent_GetFlag(const ObjectEvent *objectEvent);
void ObjectEvent_SetScript(ObjectEvent *objectEvent, int script);
int ObjectEvent_GetScript(const ObjectEvent *objectEvent);
void ObjectEvent_SetInitialDir(ObjectEvent *objectEvent, int initialDir);
int ObjectEvent_GetInitialDir(const ObjectEvent *objectEvent);
void ObjectEvent_SetDataAt(ObjectEvent *objectEvent, int value, int index);
int ObjectEvent_GetDataAt(const ObjectEvent *objectEvent, int index);
void ObjectEvent_SetMovementRangeX(ObjectEvent *objectEvent, int movementRangeX);
int ObjectEvent_GetMovementRangeX(const ObjectEvent *objectEvent);
void ObjectEvent_SetMovementRangeZ(ObjectEvent *objectEvent, int movementRangeZ);
int ObjectEvent_GetMovementRangeZ(const ObjectEvent *objectEvent);
void ObjectEvent_SetX(ObjectEvent *objectEvent, int x);
int ObjectEvent_GetX(const ObjectEvent *objectEvent);
void ObjectEvent_SetY(ObjectEvent *objectEvent, int y);
int ObjectEvent_GetY(const ObjectEvent *objectEvent);
void ObjectEvent_SetZ(ObjectEvent *objectEvent, int z);
int ObjectEvent_GetZ(const ObjectEvent *objectEvent);
MapObject *sub_0206326C(const MapObjectManager *param0, int param1, int param2, int param3);
void sub_020632D4(MapObject *param0, const VecFx32 *param1, int param2);
void MapObject_SetPosDir(MapObject *param0, int param1, int param2, int param3, int param4);
Expand Down
2 changes: 1 addition & 1 deletion include/struct_decls/struct_02061AB4_decl.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef POKEPLATINUM_STRUCT_02061AB4_DECL_H
#define POKEPLATINUM_STRUCT_02061AB4_DECL_H

typedef struct UnkStruct_02061AB4_t MapObject;
typedef struct MapObject MapObject;

#endif // POKEPLATINUM_STRUCT_02061AB4_DECL_H
2 changes: 1 addition & 1 deletion src/comm_player_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ static void CommPlayer_Add(u8 netId)
GF_ASSERT(playerAvatar != NULL);
sCommPlayerManager->playerAvatar[netId] = playerAvatar;

MapObject_SetId(Player_MapObject(playerAvatar), 0xff + netId + 1);
MapObject_SetLocalID(Player_MapObject(playerAvatar), 0xff + netId + 1);

if (sCommPlayerManager->isUnderground) {
UndergroundMan_SetReturnLog(netId);
Expand Down
Loading

0 comments on commit 2ae37a0

Please sign in to comment.