From 650e797595ea307fc023be9c978ea55f477ad406 Mon Sep 17 00:00:00 2001 From: cbt6 <91667135+cbt6@users.noreply.github.com> Date: Sat, 30 Nov 2024 10:37:20 +0800 Subject: [PATCH] Document some map object functions --- include/constants/map_object.h | 9 + include/map_object.h | 172 ++--- include/struct_decls/struct_02061AB4_decl.h | 2 +- src/comm_player_manager.c | 2 +- src/map_object.c | 744 ++++++++++---------- src/map_object_move.c | 150 ++-- src/overlay005/field_control.c | 22 +- src/overlay005/ov5_021DFB54.c | 44 +- src/overlay005/ov5_021E1154.c | 6 +- src/overlay005/ov5_021EB1A0.c | 52 +- src/overlay005/ov5_021ECA70.c | 10 +- src/overlay005/ov5_021ECC20.c | 12 +- src/overlay005/ov5_021ECE40.c | 40 +- src/overlay005/ov5_021F10E8.c | 6 +- src/overlay005/ov5_021F134C.c | 16 +- src/overlay005/ov5_021F17B8.c | 12 +- src/overlay005/ov5_021F1CC8.c | 10 +- src/overlay005/ov5_021F204C.c | 8 +- src/overlay005/ov5_021F23D0.c | 6 +- src/overlay005/ov5_021F25C0.c | 8 +- src/overlay005/ov5_021F2850.c | 4 +- src/overlay005/ov5_021F2A7C.c | 2 +- src/overlay005/ov5_021F2BD0.c | 2 +- src/overlay005/ov5_021F2D20.c | 16 +- src/overlay005/ov5_021F3284.c | 4 +- src/overlay005/ov5_021F348C.c | 6 +- src/overlay005/ov5_021F37A8.c | 16 +- src/overlay005/ov5_021F3A50.c | 16 +- src/overlay005/ov5_021F3D00.c | 6 +- src/overlay005/ov5_021F3E74.c | 6 +- src/overlay005/ov5_021F47B0.c | 20 +- src/overlay005/ov5_021F50BC.c | 8 +- src/overlay005/ov5_021F5284.c | 8 +- src/overlay005/ov5_021F5428.c | 8 +- src/overlay005/ov5_021F5894.c | 4 +- src/overlay005/ov5_021F5A10.c | 6 +- src/overlay005/ov5_021F600C.c | 4 +- src/overlay005/ov5_021F61BC.c | 8 +- src/overlay005/ov5_021F6454.c | 30 +- src/overlay005/ov5_021F8560.c | 6 +- src/overlay005/vs_seeker.c | 37 +- src/overlay006/ov6_0223E140.c | 22 +- src/overlay006/ov6_02248050.c | 8 +- src/overlay008/ov8_02249960.c | 42 +- src/overlay009/ov9_02249960.c | 214 +++--- src/overlay023/ov23_022521F0.c | 2 +- src/player_avatar.c | 44 +- src/scrcmd.c | 36 +- src/script_manager.c | 2 +- src/unk_0203C954.c | 2 +- src/unk_02048614.c | 4 +- src/unk_02055C50.c | 30 +- src/unk_0205C22C.c | 14 +- src/unk_0205F180.c | 170 ++--- src/unk_0206450C.c | 144 ++-- src/unk_020655F4.c | 120 ++-- src/unk_020673B8.c | 36 +- src/unk_020677F4.c | 8 +- src/unk_02067A84.c | 47 +- src/unk_02069BE0.c | 56 +- src/unk_0207070C.c | 2 +- 61 files changed, 1272 insertions(+), 1279 deletions(-) diff --git a/include/constants/map_object.h b/include/constants/map_object.h index 1d038abf21..f3bcc40803 100644 --- a/include/constants/map_object.h +++ b/include/constants/map_object.h @@ -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) @@ -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) @@ -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 diff --git a/include/map_object.h b/include/map_object.h index cd03585ff7..a98a388eae 100644 --- a/include/map_object.h +++ b/include/map_object.h @@ -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); @@ -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); @@ -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); @@ -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); diff --git a/include/struct_decls/struct_02061AB4_decl.h b/include/struct_decls/struct_02061AB4_decl.h index ee2429c7cb..41446340a3 100644 --- a/include/struct_decls/struct_02061AB4_decl.h +++ b/include/struct_decls/struct_02061AB4_decl.h @@ -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 diff --git a/src/comm_player_manager.c b/src/comm_player_manager.c index dc1f67b74f..7fa3884742 100644 --- a/src/comm_player_manager.c +++ b/src/comm_player_manager.c @@ -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); diff --git a/src/map_object.c b/src/map_object.c index 8e090c246d..56adc2e348 100644 --- a/src/map_object.c +++ b/src/map_object.c @@ -49,41 +49,39 @@ typedef struct MapObjectMan { FieldSystem *fieldSystem; } MapObjectManager; -typedef struct UnkStruct_02061AB4_t { - u32 unk_00; +typedef struct MapObject { + u32 status; u32 unk_04; - u32 unk_08; + u32 localID; u32 unk_0C; - u32 unk_10; - u32 unk_14; - u32 eventType; - u32 unk_1C; - u32 unk_20; - int unk_24; - int unk_28; - int unk_2C; - int unk_30; - int unk_34; - int unk_38; - int unk_3C; - int unk_40; - int unk_44; - int unk_48; - int xInit; - int yInit; - int zInit; + u32 graphicsID; + u32 movementType; + u32 trainerType; + u32 flag; + u32 script; + int initialDir; + int facingDir; + int movingDir; + int prevFacingDir; + int prevMovingDir; + int data[3]; + int movementRangeX; + int movementRangeZ; + int xInitial; + int yInitial; + int zInitial; int xPrev; int yPrev; int zPrev; int x; int y; int z; - VecFx32 posVec; + VecFx32 pos; VecFx32 unk_7C; VecFx32 unk_88; VecFx32 unk_94; u32 unk_A0; - int animationCode; + int movementAction; int unk_A8; u16 unk_AC; u16 unk_AE; @@ -189,7 +187,7 @@ void sub_0206184C(MapObjectManager *mapObjMan, int param1, int param2, int param switch (v0) { case 0: if (sub_02062918(mapObj) != param2) { - if (MapObject_GetStateFlag(mapObj, (1 << 10)) == 0) { + if (!MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_10)) { MapObject_Delete(mapObj); } } @@ -236,7 +234,7 @@ MapObject *MapObjectMan_AddMapObjectFromHeader(const MapObjectManager *mapObjMan ObjectEvent v1 = *param1; ObjectEvent *v2 = &v1; - int v3 = sub_020630F4(v2); + int v3 = ObjectEvent_GetLocalID(v2); if (sub_020631D8(v2) == 0) { mapObj = sub_02062154(mapObjMan, v3, param2); @@ -273,26 +271,26 @@ MapObject *MapObjectMan_AddMapObjectFromHeader(const MapObjectManager *mapObjMan return mapObj; } -MapObject *MapObjectMan_AddMapObject(const MapObjectManager *mapObjMan, int x, int z, int param3, int param4, int param5, int param6) +MapObject *MapObjectMan_AddMapObject(const MapObjectManager *mapObjMan, int x, int z, int initialDir, int graphicsID, int movementType, int param6) { ObjectEvent objectEvent; MapObject *mapObj; - sub_020630F0(&objectEvent, 0); - sub_020630F8(&objectEvent, param4); - sub_02063100(&objectEvent, param5); - sub_02063108(&objectEvent, 0); - sub_02063110(&objectEvent, 0); - sub_02063118(&objectEvent, 0); - sub_02063120(&objectEvent, param3); - sub_0206312C(&objectEvent, 0, 0); - sub_0206312C(&objectEvent, 0, 1); - sub_0206312C(&objectEvent, 0, 2); - sub_02063174(&objectEvent, 0); - sub_02063180(&objectEvent, 0); - ObjectEvent_SetXPos(&objectEvent, x); - ObjectEvent_SetZPos(&objectEvent, z); - sub_02063194(&objectEvent, 0); + ObjectEvent_SetLocalID(&objectEvent, 0); + ObjectEvent_SetGraphicsID(&objectEvent, graphicsID); + ObjectEvent_SetMovementType(&objectEvent, movementType); + ObjectEvent_SetTrainerType(&objectEvent, 0); + ObjectEvent_SetFlag(&objectEvent, 0); + ObjectEvent_SetScript(&objectEvent, 0); + ObjectEvent_SetInitialDir(&objectEvent, initialDir); + ObjectEvent_SetDataAt(&objectEvent, 0, 0); + ObjectEvent_SetDataAt(&objectEvent, 0, 1); + ObjectEvent_SetDataAt(&objectEvent, 0, 2); + ObjectEvent_SetMovementRangeX(&objectEvent, 0); + ObjectEvent_SetMovementRangeZ(&objectEvent, 0); + ObjectEvent_SetX(&objectEvent, x); + ObjectEvent_SetZ(&objectEvent, z); + ObjectEvent_SetY(&objectEvent, 0); mapObj = MapObjectMan_AddMapObjectFromHeader(mapObjMan, &objectEvent, param6); @@ -305,10 +303,10 @@ MapObject *sub_02061A74(const MapObjectManager *mapObjMan, int param1, int param const ObjectEvent *v1 = sub_020631A4(param1, param2, param4); if (v1 != NULL) { - int v2 = sub_02063114(v1); + int flag = ObjectEvent_GetFlag(v1); FieldSystem *fieldSystem = MapObjectMan_FieldSystem(mapObjMan); - if (FieldSystem_CheckFlag(fieldSystem, v2) == 0) { + if (!FieldSystem_CheckFlag(fieldSystem, flag)) { mapObj = MapObjectMan_AddMapObjectFromHeader(mapObjMan, v1, param3); } } @@ -316,11 +314,11 @@ MapObject *sub_02061A74(const MapObjectManager *mapObjMan, int param1, int param return mapObj; } -void sub_02061AB4(MapObject *mapObj, int param1) +void sub_02061AB4(MapObject *mapObj, int graphicsID) { - sub_0206291C(mapObj, param1); + MapObject_SetGraphicsID(mapObj, graphicsID); sub_02062604(mapObj); - MapObject_SetStatusFlagOff(mapObj, (1 << 14)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_14); sub_02062670(mapObj); } @@ -351,7 +349,7 @@ void MapObject_Delete(MapObject *mapObj) void sub_02061B28(MapObject *mapObj) { - int v0 = sub_02062958(mapObj); + int v0 = MapObject_GetFlag(mapObj); FieldSystem_SetFlag(MapObject_FieldSystem(mapObj), v0); MapObject_Delete(mapObj); } @@ -368,7 +366,7 @@ void sub_02061B48(MapObject *mapObj) MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_14); } - sub_0206291C(mapObj, 0xffff); + MapObject_SetGraphicsID(mapObj, 0xffff); sub_02062B4C(mapObj, sub_020633F0); sub_02062B60(mapObj, sub_020633F4); sub_02062B74(mapObj, sub_020633F4); @@ -386,7 +384,7 @@ void MapObjectMan_DeleteAll(MapObjectManager *mapObjMan) mapObj = sub_02062878(mapObjMan); do { - if (MapObject_CheckStatus(mapObj, (1 << 0))) { + if (MapObject_CheckStatus(mapObj, MAP_OBJ_STATUS_0)) { MapObject_Delete(mapObj); } @@ -407,8 +405,8 @@ void sub_02061BF0(MapObjectManager *mapObjMan) mapObj = sub_02062878(mapObjMan); do { - if (MapObject_CheckStatus(mapObj, (1 << 0))) { - if (MapObject_CheckStatus(mapObj, (1 << 14))) { + if (MapObject_CheckStatus(mapObj, MAP_OBJ_STATUS_0)) { + if (MapObject_CheckStatus(mapObj, MAP_OBJ_STATUS_14)) { sub_02062B90(mapObj); sub_02062628(mapObj); } @@ -449,7 +447,7 @@ void MapObjectMan_SaveAll(FieldSystem *fieldSystem, const MapObjectManager *para int v0 = 0; MapObject *mapObj; - while (sub_020625B0(param1, &mapObj, &v0, (1 << 0))) { + while (sub_020625B0(param1, &mapObj, &v0, MAP_OBJ_STATUS_0)) { MapObject_Save(fieldSystem, mapObj, mapObjSave); mapObjSave++; param3--; @@ -467,7 +465,7 @@ void MapObjectMan_LoadAllObjects(const MapObjectManager *mapObjMan, MapObjectSav MapObject *mapObj; while (size) { - if (mapObjSave->unk_00 & (1 << 0)) { + if (mapObjSave->unk_00 & MAP_OBJ_STATUS_0) { mapObj = sub_02062120(mapObjMan); GF_ASSERT(mapObj != NULL); @@ -482,44 +480,44 @@ void MapObjectMan_LoadAllObjects(const MapObjectManager *mapObjMan, MapObjectSav static void MapObject_Save(FieldSystem *fieldSystem, MapObject *mapObj, MapObjectSave *mapObjSave) { - mapObjSave->unk_00 = sub_020628B8(mapObj); + mapObjSave->unk_00 = MapObject_GetStatus(mapObj); mapObjSave->unk_04 = sub_020628EC(mapObj); - mapObjSave->unk_08 = MapObject_Id(mapObj); + mapObjSave->unk_08 = MapObject_GetLocalID(mapObj); mapObjSave->unk_10 = sub_02062918(mapObj); - mapObjSave->unk_12 = sub_02062920(mapObj); - mapObjSave->unk_09 = MapObject_GetMoveCode(mapObj); - mapObjSave->unk_14 = MapObject_GetEventType(mapObj); - mapObjSave->unk_16 = sub_02062958(mapObj); - mapObjSave->unk_18 = MapObject_GetEventID(mapObj); - mapObjSave->unk_0C = sub_02062968(mapObj); - mapObjSave->unk_0D = MapObject_Dir(mapObj); - mapObjSave->unk_0E = MapObject_GetMoveDir(mapObj); - mapObjSave->unk_1A = sub_020629D8(mapObj, 0); - mapObjSave->unk_1C = sub_020629D8(mapObj, 1); - mapObjSave->unk_1E = sub_020629D8(mapObj, 2); - mapObjSave->unk_0A = MapObject_MaxXOffset(mapObj); - mapObjSave->unk_0B = MapObject_MaxZOffset(mapObj); - mapObjSave->unk_20 = MapObject_XInitial(mapObj); - mapObjSave->unk_22 = MapObject_YInitial(mapObj); - mapObjSave->unk_24 = MapObject_ZInitial(mapObj); - mapObjSave->unk_26 = MapObject_GetXPos(mapObj); - mapObjSave->unk_28 = MapObject_GetYPos(mapObj); - mapObjSave->unk_2A = MapObject_GetZPos(mapObj); + mapObjSave->unk_12 = MapObject_GetGraphicsID(mapObj); + mapObjSave->unk_09 = MapObject_GetMovementType(mapObj); + mapObjSave->unk_14 = MapObject_GetTrainerType(mapObj); + mapObjSave->unk_16 = MapObject_GetFlag(mapObj); + mapObjSave->unk_18 = MapObject_GetScript(mapObj); + mapObjSave->unk_0C = MapObject_GetInitialDir(mapObj); + mapObjSave->unk_0D = MapObject_GetFacingDir(mapObj); + mapObjSave->unk_0E = MapObject_GetMovingDir(mapObj); + mapObjSave->unk_1A = MapObject_GetDataAt(mapObj, 0); + mapObjSave->unk_1C = MapObject_GetDataAt(mapObj, 1); + mapObjSave->unk_1E = MapObject_GetDataAt(mapObj, 2); + mapObjSave->unk_0A = MapObject_GetMovementRangeX(mapObj); + mapObjSave->unk_0B = MapObject_GetMovementRangeZ(mapObj); + mapObjSave->unk_20 = MapObject_GetXInitial(mapObj); + mapObjSave->unk_22 = MapObject_GetYInitial(mapObj); + mapObjSave->unk_24 = MapObject_GetZInitial(mapObj); + mapObjSave->unk_26 = MapObject_GetX(mapObj); + mapObjSave->unk_28 = MapObject_GetY(mapObj); + mapObjSave->unk_2A = MapObject_GetZ(mapObj); VecFx32 v0; int v1, v2; sub_02064450(mapObjSave->unk_26, mapObjSave->unk_2A, &v0); - v0.y = sub_02063074(mapObj); + v0.y = MapObject_GetPosY(mapObj); v2 = sub_02062FAC(mapObj); v1 = sub_020644D0(fieldSystem, &v0, v2); if (v1 == 0) { - mapObjSave->unk_2C = sub_02063074(mapObj); + mapObjSave->unk_2C = MapObject_GetPosY(mapObj); } else { if (sub_02062E44(mapObj) == 1) { - v0.y = sub_02063074(mapObj); + v0.y = MapObject_GetPosY(mapObj); } mapObjSave->unk_2C = v0.y; @@ -531,23 +529,23 @@ static void MapObject_Save(FieldSystem *fieldSystem, MapObject *mapObj, MapObjec static void MapObject_LoadSave(MapObject *mapObj, MapObjectSave *mapObjSave) { - sub_020628B4(mapObj, mapObjSave->unk_00); + MapObject_SetStatus(mapObj, mapObjSave->unk_00); sub_020628E8(mapObj, mapObjSave->unk_04); - MapObject_SetId(mapObj, mapObjSave->unk_08); + MapObject_SetLocalID(mapObj, mapObjSave->unk_08); sub_02062914(mapObj, mapObjSave->unk_10); - sub_0206291C(mapObj, mapObjSave->unk_12); - sub_02062944(mapObj, mapObjSave->unk_09); - sub_0206294C(mapObj, mapObjSave->unk_14); - sub_02062954(mapObj, mapObjSave->unk_16); - sub_0206295C(mapObj, mapObjSave->unk_18); - sub_02062964(mapObj, mapObjSave->unk_0C); - sub_0206296C(mapObj, mapObjSave->unk_0D); - sub_02062994(mapObj, mapObjSave->unk_0E); - sub_020629B4(mapObj, mapObjSave->unk_1A, 0); - sub_020629B4(mapObj, mapObjSave->unk_1C, 1); - sub_020629B4(mapObj, mapObjSave->unk_1E, 2); - sub_020629FC(mapObj, mapObjSave->unk_0A); - sub_02062A04(mapObj, mapObjSave->unk_0B); + MapObject_SetGraphicsID(mapObj, mapObjSave->unk_12); + MapObject_SetMovementType(mapObj, mapObjSave->unk_09); + MapObject_SetTrainerType(mapObj, mapObjSave->unk_14); + MapObject_SetFlag(mapObj, mapObjSave->unk_16); + MapObject_SetScript(mapObj, mapObjSave->unk_18); + MapObject_SetInitialDir(mapObj, mapObjSave->unk_0C); + MapObject_Face(mapObj, mapObjSave->unk_0D); + MapObject_Turn(mapObj, mapObjSave->unk_0E); + MapObject_SetDataAt(mapObj, mapObjSave->unk_1A, 0); + MapObject_SetDataAt(mapObj, mapObjSave->unk_1C, 1); + MapObject_SetDataAt(mapObj, mapObjSave->unk_1E, 2); + MapObject_SetMovementRangeX(mapObj, mapObjSave->unk_0A); + MapObject_SetMovementRangeZ(mapObj, mapObjSave->unk_0B); MapObject_SetXInitial(mapObj, mapObjSave->unk_20); MapObject_SetYInitial(mapObj, mapObjSave->unk_22); MapObject_SetZInitial(mapObj, mapObjSave->unk_24); @@ -558,7 +556,7 @@ static void MapObject_LoadSave(MapObject *mapObj, MapObjectSave *mapObjSave) VecFx32 v0 = { 0, 0, 0 }; v0.y = mapObjSave->unk_2C; - MapObject_SetPosVec(mapObj, &v0); + MapObject_SetPos(mapObj, &v0); memcpy(sub_02062A78(mapObj), mapObjSave->unk_30, 16); memcpy(sub_02062AA0(mapObj), mapObjSave->unk_40, 16); @@ -589,20 +587,20 @@ static void sub_02062010(MapObject *mapObj) int v0; VecFx32 v1; - MapObject_PosVectorOut(mapObj, &v1); + MapObject_GetPosPtr(mapObj, &v1); - v0 = MapObject_GetXPos(mapObj); + v0 = MapObject_GetX(mapObj); v1.x = (((v0) << 4) * FX32_ONE) + ((16 * FX32_ONE) >> 1); - MapObject_SetXPosPrev(mapObj, v0); - v0 = MapObject_GetYPos(mapObj); - MapObject_SetYPosPrev(mapObj, v0); + MapObject_SetXPrev(mapObj, v0); + v0 = MapObject_GetY(mapObj); + MapObject_SetYPrev(mapObj, v0); - v0 = MapObject_GetZPos(mapObj); + v0 = MapObject_GetZ(mapObj); v1.z = (((v0) << 4) * FX32_ONE) + ((16 * FX32_ONE) >> 1); - MapObject_SetZPosPrev(mapObj, v0); - MapObject_SetPosVec(mapObj, &v1); + MapObject_SetZPrev(mapObj, v0); + MapObject_SetPos(mapObj, &v1); } void sub_02062068(const MapObjectManager *mapObjMan, int param1, int param2, const ObjectEvent *param3) @@ -664,7 +662,7 @@ static MapObject *sub_02062120(const MapObjectManager *mapObjMan) mapObj = sub_02062878(mapObjMan); do { - if (MapObject_CheckStatus(mapObj, (1 << 0)) == 0) { + if (!MapObject_CheckStatus(mapObj, MAP_OBJ_STATUS_0)) { return mapObj; } @@ -680,13 +678,11 @@ static MapObject *sub_02062154(const MapObjectManager *mapObjMan, int param1, in int v0 = 0; MapObject *v1; - while (sub_020625B0(mapObjMan, &v1, &v0, (1 << 0)) == 1) { - if (sub_02062E94(v1) == 1) { - if (MapObject_Id(v1) == param1) { - if (sub_02062C18(v1) == param2) { - return v1; - } - } + while (sub_020625B0(mapObjMan, &v1, &v0, MAP_OBJ_STATUS_0) == 1) { + if (sub_02062E94(v1) == 1 + && MapObject_GetLocalID(v1) == param1 + && sub_02062C18(v1) == param2) { + return v1; } } @@ -695,13 +691,13 @@ static MapObject *sub_02062154(const MapObjectManager *mapObjMan, int param1, in static void MapObjectMan_AddMoveTask(const MapObjectManager *mapObjMan, MapObject *mapObj) { - int v0, code; + int v0, movementType; SysTask *task; v0 = sub_02062858(mapObjMan); - code = MapObject_GetMoveCode(mapObj); + movementType = MapObject_GetMovementType(mapObj); - if ((code == 0x30) || (code == 0x32)) { + if (movementType == 48 || movementType == 50) { v0 += 2; } @@ -713,18 +709,18 @@ static void MapObjectMan_AddMoveTask(const MapObjectManager *mapObjMan, MapObjec static void sub_020621E8(MapObject *mapObj, const ObjectEvent *objectEvent, FieldSystem *fieldSystem) { - MapObject_SetId(mapObj, sub_020630F4(objectEvent)); - sub_0206291C(mapObj, sub_0206262C(fieldSystem, sub_020630FC(objectEvent))); - sub_02062944(mapObj, sub_02063104(objectEvent)); - sub_0206294C(mapObj, sub_0206310C(objectEvent)); - sub_02062954(mapObj, sub_02063114(objectEvent)); - sub_0206295C(mapObj, sub_0206311C(objectEvent)); - sub_02062964(mapObj, sub_02063124(objectEvent)); - sub_020629B4(mapObj, sub_02063150(objectEvent, 0), 0); - sub_020629B4(mapObj, sub_02063150(objectEvent, 1), 1); - sub_020629B4(mapObj, sub_02063150(objectEvent, 2), 2); - sub_020629FC(mapObj, sub_02063178(objectEvent)); - sub_02062A04(mapObj, sub_02063184(objectEvent)); + MapObject_SetLocalID(mapObj, ObjectEvent_GetLocalID(objectEvent)); + MapObject_SetGraphicsID(mapObj, sub_0206262C(fieldSystem, ObjectEvent_GetGraphicsID(objectEvent))); + MapObject_SetMovementType(mapObj, ObjectEvent_GetMovementType(objectEvent)); + MapObject_SetTrainerType(mapObj, ObjectEvent_GetTrainerType(objectEvent)); + MapObject_SetFlag(mapObj, ObjectEvent_GetFlag(objectEvent)); + MapObject_SetScript(mapObj, ObjectEvent_GetScript(objectEvent)); + MapObject_SetInitialDir(mapObj, ObjectEvent_GetInitialDir(objectEvent)); + MapObject_SetDataAt(mapObj, ObjectEvent_GetDataAt(objectEvent, 0), 0); + MapObject_SetDataAt(mapObj, ObjectEvent_GetDataAt(objectEvent, 1), 1); + MapObject_SetDataAt(mapObj, ObjectEvent_GetDataAt(objectEvent, 2), 2); + MapObject_SetMovementRangeX(mapObj, ObjectEvent_GetMovementRangeX(objectEvent)); + MapObject_SetMovementRangeZ(mapObj, ObjectEvent_GetMovementRangeZ(objectEvent)); sub_020622B8(mapObj, objectEvent); } @@ -733,28 +729,28 @@ static void sub_020622B8(MapObject *mapObj, const ObjectEvent *objectEvent) int v0; VecFx32 v1; - v0 = sub_02063190(objectEvent); + v0 = ObjectEvent_GetX(objectEvent); v1.x = (((v0) << 4) * FX32_ONE) + ((16 * FX32_ONE) >> 1); MapObject_SetXInitial(mapObj, v0); - MapObject_SetXPosPrev(mapObj, v0); + MapObject_SetXPrev(mapObj, v0); MapObject_SetX(mapObj, v0); - v0 = sub_02063198(objectEvent); + v0 = ObjectEvent_GetY(objectEvent); v1.y = (fx32)v0; v0 = (((v0) >> 3) / FX32_ONE); MapObject_SetYInitial(mapObj, v0); - MapObject_SetYPosPrev(mapObj, v0); + MapObject_SetYPrev(mapObj, v0); MapObject_SetY(mapObj, v0); - v0 = sub_020631A0(objectEvent); + v0 = ObjectEvent_GetZ(objectEvent); v1.z = (((v0) << 4) * FX32_ONE) + ((16 * FX32_ONE) >> 1); MapObject_SetZInitial(mapObj, v0); - MapObject_SetZPosPrev(mapObj, v0); + MapObject_SetZPrev(mapObj, v0); MapObject_SetZ(mapObj, v0); - MapObject_SetPosVec(mapObj, &v1); + MapObject_SetPos(mapObj, &v1); } static void sub_0206234C(MapObject *mapObj, const MapObjectManager *param1) @@ -766,8 +762,8 @@ static void sub_0206234C(MapObject *mapObj, const MapObjectManager *param1) } MapObject_SetMapObjectManager(mapObj, param1); - sub_0206296C(mapObj, sub_02062968(mapObj)); - sub_02062994(mapObj, sub_02062968(mapObj)); + MapObject_Face(mapObj, MapObject_GetInitialDir(mapObj)); + MapObject_Turn(mapObj, MapObject_GetInitialDir(mapObj)); sub_020656DC(mapObj); } @@ -775,7 +771,7 @@ static void sub_0206239C(MapObject *mapObj) { const UnkStruct_020EDF0C *v0; - v0 = sub_0206320C(MapObject_GetMoveCode(mapObj)); + v0 = sub_0206320C(MapObject_GetMovementType(mapObj)); sub_02062AF8(mapObj, sub_02063224(v0)); sub_02062B0C(mapObj, sub_02063228(v0)); @@ -785,7 +781,7 @@ static void sub_0206239C(MapObject *mapObj) static void sub_020623D4(MapObject *mapObj) { const UnkStruct_ov5_021FB0F0 *v0; - u32 v1 = sub_02062920(mapObj); + u32 v1 = MapObject_GetGraphicsID(mapObj); if (v1 == 0x2000) { v0 = &Unk_ov5_021FB470; @@ -811,9 +807,9 @@ static int sub_0206244C(const MapObject *mapObj, int param1, int param2, const O int v1; while (param2) { - v0 = sub_020630F4(param3); + v0 = ObjectEvent_GetLocalID(param3); - if (MapObject_Id(mapObj) == v0) { + if (MapObject_GetLocalID(mapObj) == v0) { if (sub_020631D8(param3) == 1) { v1 = sub_020631F4(param3); @@ -845,8 +841,8 @@ static MapObject *sub_020624CC(const MapObjectManager *mapObjMan, int param1, in int v0 = 0; MapObject *v1; - while (sub_020625B0(mapObjMan, &v1, &v0, (1 << 0)) == 1) { - if ((MapObject_Id(v1) == param1) && (sub_02062918(v1) == param2)) { + while (sub_020625B0(mapObjMan, &v1, &v0, MAP_OBJ_STATUS_0) == 1) { + if ((MapObject_GetLocalID(v1) == param1) && (sub_02062918(v1) == param2)) { return v1; } } @@ -865,9 +861,9 @@ MapObject *MapObjMan_LocalMapObjByIndex(const MapObjectManager *mapObjMan, int p v1 = sub_02062870(mapObjMan); do { - if (MapObject_GetStateFlag(v1, (1 << 0)) == 1) { + if (MapObject_CheckStatusFlag(v1, MAP_OBJ_STATUS_0) == 1) { if (sub_02062E94(v1) == 0) { - if (MapObject_Id(v1) == param1) { + if (MapObject_GetLocalID(v1) == param1) { return v1; } } @@ -889,8 +885,8 @@ MapObject *sub_02062570(const MapObjectManager *mapObjMan, int param1) v1 = sub_02062870(mapObjMan); do { - if (MapObject_GetStateFlag(v1, (1 << 0)) == 1) { - if (MapObject_GetMoveCode(v1) == param1) { + if (MapObject_CheckStatusFlag(v1, MAP_OBJ_STATUS_0) == 1) { + if (MapObject_GetMovementType(v1) == param1) { return v1; } } @@ -938,7 +934,7 @@ static void sub_02062604(MapObject *mapObj) static void sub_02062618(MapObject *mapObj) { - MapObject_SetStatusFlagOff(mapObj, (1 << 15) | (1 << 20) | (1 << 26) | (1 << 24)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_15 | MAP_OBJ_STATUS_HIDE_SHADOW | MAP_OBJ_STATUS_26 | MAP_OBJ_STATUS_24); } static void sub_02062628(MapObject *mapObj) @@ -958,7 +954,7 @@ static int sub_0206262C(FieldSystem *fieldSystem, int param1) static void sub_02062648(MapObject *mapObj) { - if (MapObject_CheckStatus(mapObj, (1 << 12))) { + if (MapObject_CheckStatus(mapObj, MAP_OBJ_STATUS_12)) { sub_020642F8(mapObj); } } @@ -990,7 +986,7 @@ static void sub_02062670(MapObject *mapObj) int sub_020626B4(const MapObject *mapObj) { - u16 v0 = (u16)MapObject_GetEventID(mapObj); + u16 v0 = (u16)MapObject_GetScript(mapObj); if (v0 == 0xffff) { return 1; @@ -1005,8 +1001,8 @@ static void sub_020626D0(MapObject *mapObj, const ObjectEvent *param1, int param sub_02062E78(mapObj, 0); sub_02062914(mapObj, param2); - sub_0206295C(mapObj, sub_0206311C(param1)); - sub_02062954(mapObj, sub_02063114(param1)); + MapObject_SetScript(mapObj, ObjectEvent_GetScript(param1)); + MapObject_SetFlag(mapObj, ObjectEvent_GetFlag(param1)); } static void sub_02062714(MapObject *mapObj, int param1, const ObjectEvent *param2) @@ -1014,8 +1010,8 @@ static void sub_02062714(MapObject *mapObj, int param1, const ObjectEvent *param GF_ASSERT(sub_020631D8(param2) == 1); sub_02062E78(mapObj, 1); - sub_0206295C(mapObj, sub_0206311C(param2)); - sub_02062954(mapObj, sub_020631F4(param2)); + MapObject_SetScript(mapObj, ObjectEvent_GetScript(param2)); + MapObject_SetFlag(mapObj, sub_020631F4(param2)); sub_02062914(mapObj, param1); } @@ -1031,11 +1027,11 @@ int sub_02062758(const MapObject *mapObj, int param1) int sub_02062764(const MapObject *mapObj, int param1, int param2) { - if (MapObject_GetStateFlag(mapObj, (1 << 0)) == 0) { + if (!MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_0)) { return 0; } - if (MapObject_Id(mapObj) != param1) { + if (MapObject_GetLocalID(mapObj) != param1) { return 0; } @@ -1054,7 +1050,7 @@ int sub_02062764(const MapObject *mapObj, int param1, int param2) int sub_020627B4(const MapObject *mapObj, int param1, int param2, int param3) { - if (MapObject_GetStateFlag(mapObj, (1 << 0)) == 0) { + if (!MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_0)) { return 0; } @@ -1192,38 +1188,36 @@ NARC *sub_020628A0(const MapObjectManager *mapObjMan) return ((MapObjectManager *)mapObjMan)->unk_14; } -void sub_020628B4(MapObject *mapObj, u32 param1) +void MapObject_SetStatus(MapObject *mapObj, u32 status) { - mapObj->unk_00 = param1; + mapObj->status = status; } -u32 sub_020628B8(const MapObject *mapObj) +u32 MapObject_GetStatus(const MapObject *mapObj) { - return mapObj->unk_00; + return mapObj->status; } -void MapObject_SetStatusFlagOn(MapObject *mapObj, u32 param1) +void MapObject_SetStatusFlagOn(MapObject *mapObj, u32 flag) { - mapObj->unk_00 |= param1; + mapObj->status |= flag; } -void MapObject_SetStatusFlagOff(MapObject *mapObj, u32 param1) +void MapObject_SetStatusFlagOff(MapObject *mapObj, u32 flag) { - mapObj->unk_00 &= ~param1; + mapObj->status &= ~flag; } -u32 MapObject_CheckStatus(const MapObject *mapObj, u32 param1) +u32 MapObject_CheckStatus(const MapObject *mapObj, u32 flag) { - return mapObj->unk_00 & param1; + return mapObj->status & flag; } -u32 MapObject_GetStateFlag(const MapObject *mapObj, u32 param1) +BOOL MapObject_CheckStatusFlag(const MapObject *mapObj, u32 flag) { - if (mapObj->unk_00 & param1) { - return 1; - } - - return 0; + return mapObj->status & flag + ? TRUE + : FALSE; } void sub_020628E8(MapObject *mapObj, u32 param1) @@ -1251,14 +1245,14 @@ u32 sub_02062904(const MapObject *mapObj, u32 param1) return mapObj->unk_04 & param1; } -void MapObject_SetId(MapObject *mapObj, u32 param1) +void MapObject_SetLocalID(MapObject *mapObj, u32 localID) { - mapObj->unk_08 = param1; + mapObj->localID = localID; } -u32 MapObject_Id(const MapObject *mapObj) +u32 MapObject_GetLocalID(const MapObject *mapObj) { - return mapObj->unk_08; + return mapObj->localID; } void sub_02062914(MapObject *mapObj, int param1) @@ -1271,19 +1265,19 @@ int sub_02062918(const MapObject *mapObj) return mapObj->unk_0C; } -void sub_0206291C(MapObject *mapObj, u32 param1) +void MapObject_SetGraphicsID(MapObject *mapObj, u32 graphicsID) { - mapObj->unk_10 = param1; + mapObj->graphicsID = graphicsID; } -u32 sub_02062920(const MapObject *mapObj) +u32 MapObject_GetGraphicsID(const MapObject *mapObj) { - return mapObj->unk_10; + return mapObj->graphicsID; } u32 sub_02062924(const MapObject *mapObj) { - u32 v0 = sub_02062920(mapObj); + u32 v0 = MapObject_GetGraphicsID(mapObj); if (sub_020677F4(v0) == 1) { v0 = sub_02067800(mapObj); @@ -1292,147 +1286,147 @@ u32 sub_02062924(const MapObject *mapObj) return v0; } -void sub_02062944(MapObject *mapObj, u32 param1) +void MapObject_SetMovementType(MapObject *mapObj, u32 movementType) { - mapObj->unk_14 = param1; + mapObj->movementType = movementType; } -u32 MapObject_GetMoveCode(const MapObject *mapObj) +u32 MapObject_GetMovementType(const MapObject *mapObj) { - return mapObj->unk_14; + return mapObj->movementType; } -void sub_0206294C(MapObject *mapObj, u32 param1) +void MapObject_SetTrainerType(MapObject *mapObj, u32 trainerType) { - mapObj->eventType = param1; + mapObj->trainerType = trainerType; } -u32 MapObject_GetEventType(const MapObject *mapObj) +u32 MapObject_GetTrainerType(const MapObject *mapObj) { - return mapObj->eventType; + return mapObj->trainerType; } -void sub_02062954(MapObject *mapObj, u32 param1) +void MapObject_SetFlag(MapObject *mapObj, u32 flag) { - mapObj->unk_1C = param1; + mapObj->flag = flag; } -u32 sub_02062958(const MapObject *mapObj) +u32 MapObject_GetFlag(const MapObject *mapObj) { - return mapObj->unk_1C; + return mapObj->flag; } -void sub_0206295C(MapObject *mapObj, u32 param1) +void MapObject_SetScript(MapObject *mapObj, u32 script) { - mapObj->unk_20 = param1; + mapObj->script = script; } -u32 MapObject_GetEventID(const MapObject *mapObj) +u32 MapObject_GetScript(const MapObject *mapObj) { - return mapObj->unk_20; + return mapObj->script; } -void sub_02062964(MapObject *mapObj, int param1) +void MapObject_SetInitialDir(MapObject *mapObj, int initialDir) { - mapObj->unk_24 = param1; + mapObj->initialDir = initialDir; } -u32 sub_02062968(const MapObject *mapObj) +u32 MapObject_GetInitialDir(const MapObject *mapObj) { - return mapObj->unk_24; + return mapObj->initialDir; } -void sub_0206296C(MapObject *mapObj, int param1) +void MapObject_Face(MapObject *mapObj, int dir) { - mapObj->unk_30 = mapObj->unk_28; - mapObj->unk_28 = param1; + mapObj->prevFacingDir = mapObj->facingDir; + mapObj->facingDir = dir; } -void MapObject_SetDir(MapObject *mapObj, int param1) +void MapObject_TryFace(MapObject *mapObj, int dir) { - if (MapObject_CheckStatus(mapObj, (1 << 7)) == 0) { - mapObj->unk_30 = mapObj->unk_28; - mapObj->unk_28 = param1; + if (!MapObject_CheckStatus(mapObj, MAP_OBJ_STATUS_LOCK_DIR)) { + mapObj->prevFacingDir = mapObj->facingDir; + mapObj->facingDir = dir; } } -int MapObject_Dir(const MapObject *mapObj) +int MapObject_GetFacingDir(const MapObject *mapObj) { - return mapObj->unk_28; + return mapObj->facingDir; } -int sub_02062990(const MapObject *mapObj) +int MapObject_GetPrevFacingDir(const MapObject *mapObj) { - return mapObj->unk_30; + return mapObj->prevFacingDir; } -void sub_02062994(MapObject *mapObj, int param1) +void MapObject_Turn(MapObject *mapObj, int dir) { - mapObj->unk_34 = mapObj->unk_2C; - mapObj->unk_2C = param1; + mapObj->prevMovingDir = mapObj->movingDir; + mapObj->movingDir = dir; } -int MapObject_GetMoveDir(const MapObject *mapObj) +int MapObject_GetMovingDir(const MapObject *mapObj) { - return mapObj->unk_2C; + return mapObj->movingDir; } -void sub_020629A0(MapObject *mapObj, int param1) +void MapObject_TryFaceAndTurn(MapObject *mapObj, int dir) { - MapObject_SetDir(mapObj, param1); - sub_02062994(mapObj, param1); + MapObject_TryFace(mapObj, dir); + MapObject_Turn(mapObj, dir); } -void sub_020629B4(MapObject *mapObj, int param1, int param2) +void MapObject_SetDataAt(MapObject *mapObj, int value, int index) { - switch (param2) { + switch (index) { case 0: - mapObj->unk_38 = param1; + mapObj->data[0] = value; break; case 1: - mapObj->unk_3C = param1; + mapObj->data[1] = value; break; case 2: - mapObj->unk_40 = param1; + mapObj->data[2] = value; break; default: GF_ASSERT(FALSE); } } -int sub_020629D8(const MapObject *mapObj, int param1) +int MapObject_GetDataAt(const MapObject *mapObj, int index) { - switch (param1) { + switch (index) { case 0: - return mapObj->unk_38; + return mapObj->data[0]; case 1: - return mapObj->unk_3C; + return mapObj->data[1]; case 2: - return mapObj->unk_40; + return mapObj->data[2]; } GF_ASSERT(FALSE); return 0; } -void sub_020629FC(MapObject *mapObj, int param1) +void MapObject_SetMovementRangeX(MapObject *mapObj, int movementRangeX) { - mapObj->unk_44 = param1; + mapObj->movementRangeX = movementRangeX; } -int MapObject_MaxXOffset(const MapObject *mapObj) +int MapObject_GetMovementRangeX(const MapObject *mapObj) { - return mapObj->unk_44; + return mapObj->movementRangeX; } -void sub_02062A04(MapObject *mapObj, int param1) +void MapObject_SetMovementRangeZ(MapObject *mapObj, int movementRangeZ) { - mapObj->unk_48 = param1; + mapObj->movementRangeZ = movementRangeZ; } -int MapObject_MaxZOffset(const MapObject *mapObj) +int MapObject_GetMovementRangeZ(const MapObject *mapObj) { - return mapObj->unk_48; + return mapObj->movementRangeZ; } void sub_02062A0C(MapObject *mapObj, u32 param1) @@ -1575,7 +1569,7 @@ void sub_02062B28(MapObject *mapObj) void sub_02062B34(MapObject *mapObj) { - const UnkStruct_020EDF0C *v0 = sub_0206320C(MapObject_GetMoveCode(mapObj)); + const UnkStruct_020EDF0C *v0 = sub_0206320C(MapObject_GetMovementType(mapObj)); v0->unk_10(mapObj); } @@ -1629,14 +1623,14 @@ void sub_02062BA4(MapObject *mapObj) mapObj->unk_D4(mapObj); } -void MapObject_SetAnimationCode(MapObject *mapObj, int param1) +void MapObject_SetMovementAction(MapObject *mapObj, int movementAction) { - mapObj->animationCode = param1; + mapObj->movementAction = movementAction; } -int MapObject_AnimationCode(const MapObject *mapObj) +int MapObject_GetMovementAction(const MapObject *mapObj) { - return mapObj->animationCode; + return mapObj->movementAction; } void sub_02062BC0(MapObject *mapObj, int param1) @@ -1690,17 +1684,17 @@ int sub_02062C0C(const MapObject *mapObj) int sub_02062C18(const MapObject *mapObj) { GF_ASSERT(sub_02062E94(mapObj) == 1); - return sub_02062958(mapObj); + return MapObject_GetFlag(mapObj); } void MapObjectMan_StopAllMovement(MapObjectManager *mapObjMan) { - sub_02062838(mapObjMan, (1 << 1) | (1 << 2)); + sub_02062838(mapObjMan, MAP_OBJ_STATUS_1 | MAP_OBJ_STATUS_START_MOVEMENT); } void sub_02062C3C(MapObjectManager *mapObjMan) { - sub_02062840(mapObjMan, (1 << 1) | (1 << 2)); + sub_02062840(mapObjMan, MAP_OBJ_STATUS_1 | MAP_OBJ_STATUS_START_MOVEMENT); } void MapObjectMan_PauseAllMovement(MapObjectManager *mapObjMan) @@ -1735,7 +1729,7 @@ void MapObjectMan_UnpauseAllMovement(MapObjectManager *mapObjMan) int MapObjectMan_IsDrawInitialized(const MapObjectManager *mapObjMan) { - if (sub_0206284C(mapObjMan, (1 << 0))) { + if (sub_0206284C(mapObjMan, MAP_OBJ_STATUS_0)) { return 1; } @@ -1752,15 +1746,15 @@ u32 sub_02062CBC(const MapObject *mapObj, u32 param1) void sub_02062CCC(MapObjectManager *mapObjMan, int param1) { if (param1 == 0) { - sub_02062838(mapObjMan, (1 << 3)); + sub_02062838(mapObjMan, MAP_OBJ_STATUS_END_MOVEMENT); } else { - sub_02062840(mapObjMan, (1 << 3)); + sub_02062840(mapObjMan, MAP_OBJ_STATUS_END_MOVEMENT); } } int sub_02062CE4(const MapObjectManager *mapObjMan) { - if (sub_0206284C(mapObjMan, (1 << 3))) { + if (sub_0206284C(mapObjMan, MAP_OBJ_STATUS_END_MOVEMENT)) { return 0; } @@ -1769,47 +1763,47 @@ int sub_02062CE4(const MapObjectManager *mapObjMan) int sub_02062CF8(const MapObject *mapObj) { - return MapObject_GetStateFlag(mapObj, (1 << 0)); + return MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_0); } void sub_02062D04(MapObject *mapObj) { - MapObject_SetStatusFlagOn(mapObj, (1 << 1)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_1); } void sub_02062D10(MapObject *mapObj) { - MapObject_SetStatusFlagOff(mapObj, (1 << 1)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_1); } int MapObject_IsMoving(const MapObject *mapObj) { - return MapObject_GetStateFlag(mapObj, (1 << 1)); + return MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_1); } void sub_02062D28(MapObject *mapObj) { - MapObject_SetStatusFlagOn(mapObj, (1 << 2)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_START_MOVEMENT); } void sub_02062D34(MapObject *mapObj) { - MapObject_SetStatusFlagOff(mapObj, (1 << 3)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_END_MOVEMENT); } void sub_02062D40(MapObject *mapObj) { - MapObject_SetStatusFlagOn(mapObj, (1 << 14)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_14); } int sub_02062D4C(const MapObject *mapObj) { - return MapObject_GetStateFlag(mapObj, (1 << 14)); + return MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_14); } int sub_02062D58(const MapObject *mapObj) { - return MapObject_GetStateFlag(mapObj, (1 << 9)); + return MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_HIDE); } void MapObject_SetHidden(MapObject *mapObj, int param1) @@ -1824,15 +1818,15 @@ void MapObject_SetHidden(MapObject *mapObj, int param1) void sub_02062D80(MapObject *mapObj, int param1) { if (param1 == 1) { - MapObject_SetStatusFlagOff(mapObj, (1 << 18)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_18); } else { - MapObject_SetStatusFlagOn(mapObj, (1 << 18)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_18); } } int sub_02062D9C(MapObject *mapObj) { - if (MapObject_GetStateFlag(mapObj, (1 << 19)) == 1) { + if (MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_19) == 1) { return 0; } @@ -1842,25 +1836,25 @@ int sub_02062D9C(MapObject *mapObj) void sub_02062DB4(MapObject *mapObj, int param1) { if (param1 == 1) { - MapObject_SetStatusFlagOn(mapObj, (1 << 19)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_19); } else { - MapObject_SetStatusFlagOff(mapObj, (1 << 19)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_19); } } void sub_02062DD0(MapObject *mapObj) { - MapObject_SetStatusFlagOn(mapObj, (1 << 6)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_PAUSE_MOVEMENT); } void sub_02062DDC(MapObject *mapObj) { - MapObject_SetStatusFlagOff(mapObj, (1 << 6)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_PAUSE_MOVEMENT); } int MapObject_IsMovementPaused(const MapObject *mapObj) { - if (MapObject_GetStateFlag(mapObj, (1 << 6)) == 1) { + if (MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_PAUSE_MOVEMENT) == 1) { return 1; } @@ -1877,7 +1871,7 @@ int sub_02062DFC(const MapObject *mapObj) return 0; } - if (MapObject_CheckStatus(mapObj, (1 << 14)) == 0) { + if (!MapObject_CheckStatus(mapObj, MAP_OBJ_STATUS_14)) { return 0; } @@ -1887,15 +1881,15 @@ int sub_02062DFC(const MapObject *mapObj) void sub_02062E28(MapObject *mapObj, int param1) { if (param1 == 1) { - MapObject_SetStatusFlagOn(mapObj, (1 << 23)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_23); } else { - MapObject_SetStatusFlagOff(mapObj, (1 << 23)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_23); } } int sub_02062E44(const MapObject *mapObj) { - if (MapObject_CheckStatus(mapObj, (1 << 23))) { + if (MapObject_CheckStatus(mapObj, MAP_OBJ_STATUS_23)) { return 1; } @@ -1905,24 +1899,24 @@ int sub_02062E44(const MapObject *mapObj) void sub_02062E5C(MapObject *mapObj, int param1) { if (param1 == 1) { - MapObject_SetStatusFlagOn(mapObj, (1 << 10)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_10); } else { - MapObject_SetStatusFlagOff(mapObj, (1 << 10)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_10); } } void sub_02062E78(MapObject *mapObj, int param1) { if (param1 == 1) { - MapObject_SetStatusFlagOn(mapObj, (1 << 25)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_25); } else { - MapObject_SetStatusFlagOff(mapObj, (1 << 25)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_25); } } int sub_02062E94(const MapObject *mapObj) { - if (MapObject_CheckStatus(mapObj, (1 << 25))) { + if (MapObject_CheckStatus(mapObj, MAP_OBJ_STATUS_25)) { return 1; } @@ -1932,15 +1926,15 @@ int sub_02062E94(const MapObject *mapObj) void sub_02062EAC(MapObject *mapObj, int param1) { if (param1 == 1) { - MapObject_SetStatusFlagOn(mapObj, (1 << 26)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_26); } else { - MapObject_SetStatusFlagOff(mapObj, (1 << 26)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_26); } } int sub_02062EC8(const MapObject *mapObj) { - if (MapObject_CheckStatus(mapObj, (1 << 26))) { + if (MapObject_CheckStatus(mapObj, MAP_OBJ_STATUS_26)) { return 1; } @@ -1950,15 +1944,15 @@ int sub_02062EC8(const MapObject *mapObj) void sub_02062EE0(MapObject *mapObj, int param1) { if (param1 == 1) { - MapObject_SetStatusFlagOn(mapObj, (1 << 27)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_27); } else { - MapObject_SetStatusFlagOff(mapObj, (1 << 27)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_27); } } int sub_02062EFC(const MapObject *mapObj) { - if (MapObject_CheckStatus(mapObj, (1 << 27))) { + if (MapObject_CheckStatus(mapObj, MAP_OBJ_STATUS_27)) { return 1; } @@ -1968,15 +1962,15 @@ int sub_02062EFC(const MapObject *mapObj) void sub_02062F14(MapObject *mapObj, int param1) { if (param1 == 1) { - MapObject_SetStatusFlagOn(mapObj, (1 << 28)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_28); } else { - MapObject_SetStatusFlagOff(mapObj, (1 << 28)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_28); } } int sub_02062F30(const MapObject *mapObj) { - if (MapObject_CheckStatus(mapObj, (1 << 28))) { + if (MapObject_CheckStatus(mapObj, MAP_OBJ_STATUS_28)) { return 1; } @@ -1986,15 +1980,15 @@ int sub_02062F30(const MapObject *mapObj) void sub_02062F48(MapObject *mapObj, int param1) { if (param1 == 1) { - MapObject_SetStatusFlagOn(mapObj, (1 << 24)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_24); } else { - MapObject_SetStatusFlagOff(mapObj, (1 << 24)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_24); } } int sub_02062F64(const MapObject *mapObj) { - if (MapObject_CheckStatus(mapObj, (1 << 24))) { + if (MapObject_CheckStatus(mapObj, MAP_OBJ_STATUS_24)) { return 1; } @@ -2003,7 +1997,7 @@ int sub_02062F64(const MapObject *mapObj) int sub_02062F7C(const MapObject *mapObj) { - if (MapObject_CheckStatus(mapObj, (1 << 4))) { + if (MapObject_CheckStatus(mapObj, MAP_OBJ_STATUS_4)) { return 1; } @@ -2013,15 +2007,15 @@ int sub_02062F7C(const MapObject *mapObj) void sub_02062F90(MapObject *mapObj, int param1) { if (param1 == 1) { - MapObject_SetStatusFlagOn(mapObj, (1 << 29)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_29); } else { - MapObject_SetStatusFlagOff(mapObj, (1 << 29)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_29); } } int sub_02062FAC(const MapObject *mapObj) { - if (MapObject_CheckStatus(mapObj, (1 << 29))) { + if (MapObject_CheckStatus(mapObj, MAP_OBJ_STATUS_29)) { return 1; } @@ -2046,67 +2040,67 @@ int sub_02062FDC(const MapObject *mapObj) return 0; } -int MapObject_XInitial(const MapObject *mapObj) +int MapObject_GetXInitial(const MapObject *mapObj) { - return mapObj->xInit; + return mapObj->xInitial; } void MapObject_SetXInitial(MapObject *mapObj, int x) { - mapObj->xInit = x; + mapObj->xInitial = x; } -int MapObject_YInitial(const MapObject *mapObj) +int MapObject_GetYInitial(const MapObject *mapObj) { - return mapObj->yInit; + return mapObj->yInitial; } void MapObject_SetYInitial(MapObject *mapObj, int y) { - mapObj->yInit = y; + mapObj->yInitial = y; } -int MapObject_ZInitial(const MapObject *mapObj) +int MapObject_GetZInitial(const MapObject *mapObj) { - return mapObj->zInit; + return mapObj->zInitial; } void MapObject_SetZInitial(MapObject *mapObj, int z) { - mapObj->zInit = z; + mapObj->zInitial = z; } -int MapObject_XPosPrev(const MapObject *mapObj) +int MapObject_GetXPrev(const MapObject *mapObj) { return mapObj->xPrev; } -void MapObject_SetXPosPrev(MapObject *mapObj, int x) +void MapObject_SetXPrev(MapObject *mapObj, int x) { mapObj->xPrev = x; } -int MapObject_YPosPrev(const MapObject *mapObj) +int MapObject_GetYPrev(const MapObject *mapObj) { return mapObj->yPrev; } -void MapObject_SetYPosPrev(MapObject *mapObj, int y) +void MapObject_SetYPrev(MapObject *mapObj, int y) { mapObj->yPrev = y; } -int MapObject_ZPosPrev(const MapObject *mapObj) +int MapObject_GetZPrev(const MapObject *mapObj) { return mapObj->zPrev; } -void MapObject_SetZPosPrev(MapObject *mapObj, int z) +void MapObject_SetZPrev(MapObject *mapObj, int z) { mapObj->zPrev = z; } -int MapObject_GetXPos(const MapObject *mapObj) +int MapObject_GetX(const MapObject *mapObj) { return mapObj->x; } @@ -2121,7 +2115,7 @@ void MapObject_AddX(MapObject *mapObj, int dx) mapObj->x += dx; } -int MapObject_GetYPos(const MapObject *mapObj) +int MapObject_GetY(const MapObject *mapObj) { return mapObj->y; } @@ -2136,7 +2130,7 @@ void MapObject_AddY(MapObject *mapObj, int dy) mapObj->y += dy; } -int MapObject_GetZPos(const MapObject *mapObj) +int MapObject_GetZ(const MapObject *mapObj) { return mapObj->z; } @@ -2151,24 +2145,24 @@ void MapObject_AddZ(MapObject *mapObj, int dz) mapObj->z += dz; } -void MapObject_PosVectorOut(const MapObject *mapObj, VecFx32 *vec) +void MapObject_GetPosPtr(const MapObject *mapObj, VecFx32 *pos) { - *vec = mapObj->posVec; + *pos = mapObj->pos; } -void MapObject_SetPosVec(MapObject *mapObj, const VecFx32 *vec) +void MapObject_SetPos(MapObject *mapObj, const VecFx32 *pos) { - mapObj->posVec = *vec; + mapObj->pos = *pos; } -const VecFx32 *MapObject_PosVector(const MapObject *mapObj) +const VecFx32 *MapObject_GetPos(const MapObject *mapObj) { - return &mapObj->posVec; + return &mapObj->pos; } -fx32 sub_02063074(const MapObject *mapObj) +fx32 MapObject_GetPosY(const MapObject *mapObj) { - return mapObj->posVec.y; + return mapObj->pos.y; } void sub_02063078(const MapObject *mapObj, VecFx32 *vec) @@ -2208,102 +2202,102 @@ void sub_020630CC(MapObject *mapObj, const VecFx32 *vec) int sub_020630DC(const MapObject *mapObj) { - fx32 v0 = sub_02063074(mapObj); + fx32 v0 = MapObject_GetPosY(mapObj); int v1 = (((v0) >> 3) / FX32_ONE); return v1; } -void sub_020630F0(ObjectEvent *objectEvent, int param1) +void ObjectEvent_SetLocalID(ObjectEvent *objectEvent, int localID) { - objectEvent->localID = param1; + objectEvent->localID = localID; } -int sub_020630F4(const ObjectEvent *objectEvent) +int ObjectEvent_GetLocalID(const ObjectEvent *objectEvent) { return objectEvent->localID; } -void sub_020630F8(ObjectEvent *objectEvent, int param1) +void ObjectEvent_SetGraphicsID(ObjectEvent *objectEvent, int graphicsID) { - objectEvent->graphicsID = param1; + objectEvent->graphicsID = graphicsID; } -int sub_020630FC(const ObjectEvent *objectEvent) +int ObjectEvent_GetGraphicsID(const ObjectEvent *objectEvent) { return objectEvent->graphicsID; } -void sub_02063100(ObjectEvent *objectEvent, int param1) +void ObjectEvent_SetMovementType(ObjectEvent *objectEvent, int movementType) { - objectEvent->movementType = param1; + objectEvent->movementType = movementType; } -int sub_02063104(const ObjectEvent *objectEvent) +int ObjectEvent_GetMovementType(const ObjectEvent *objectEvent) { return objectEvent->movementType; } -void sub_02063108(ObjectEvent *objectEvent, int param1) +void ObjectEvent_SetTrainerType(ObjectEvent *objectEvent, int trainerType) { - objectEvent->trainerType = param1; + objectEvent->trainerType = trainerType; } -int sub_0206310C(const ObjectEvent *objectEvent) +int ObjectEvent_GetTrainerType(const ObjectEvent *objectEvent) { return objectEvent->trainerType; } -void sub_02063110(ObjectEvent *objectEvent, int param1) +void ObjectEvent_SetFlag(ObjectEvent *objectEvent, int flag) { - objectEvent->flag = param1; + objectEvent->flag = flag; } -int sub_02063114(const ObjectEvent *objectEvent) +int ObjectEvent_GetFlag(const ObjectEvent *objectEvent) { return objectEvent->flag; } -void sub_02063118(ObjectEvent *objectEvent, int param1) +void ObjectEvent_SetScript(ObjectEvent *objectEvent, int script) { - objectEvent->script = param1; + objectEvent->script = script; } -int sub_0206311C(const ObjectEvent *objectEvent) +int ObjectEvent_GetScript(const ObjectEvent *objectEvent) { return objectEvent->script; } -void sub_02063120(ObjectEvent *objectEvent, int param1) +void ObjectEvent_SetInitialDir(ObjectEvent *objectEvent, int initialDir) { - objectEvent->dir = param1; + objectEvent->dir = initialDir; } -int sub_02063124(const ObjectEvent *objectEvent) +int ObjectEvent_GetInitialDir(const ObjectEvent *objectEvent) { return objectEvent->dir; } -void sub_0206312C(ObjectEvent *objectEvent, int param1, int param2) +void ObjectEvent_SetDataAt(ObjectEvent *objectEvent, int value, int index) { - switch (param2) { + switch (index) { case 0: - objectEvent->data[0] = param1; + objectEvent->data[0] = value; break; case 1: - objectEvent->data[1] = param1; + objectEvent->data[1] = value; break; case 2: - objectEvent->data[2] = param1; + objectEvent->data[2] = value; break; default: GF_ASSERT(FALSE); } } -int sub_02063150(const ObjectEvent *objectEvent, int param1) +int ObjectEvent_GetDataAt(const ObjectEvent *objectEvent, int index) { - switch (param1) { + switch (index) { case 0: return objectEvent->data[0]; case 1: @@ -2316,52 +2310,52 @@ int sub_02063150(const ObjectEvent *objectEvent, int param1) return 0; } -void sub_02063174(ObjectEvent *objectEvent, int param1) +void ObjectEvent_SetMovementRangeX(ObjectEvent *objectEvent, int movementRangeX) { - objectEvent->movementRangeX = param1; + objectEvent->movementRangeX = movementRangeX; } -int sub_02063178(const ObjectEvent *objectEvent) +int ObjectEvent_GetMovementRangeX(const ObjectEvent *objectEvent) { return objectEvent->movementRangeX; } -void sub_02063180(ObjectEvent *objectEvent, int param1) +void ObjectEvent_SetMovementRangeZ(ObjectEvent *objectEvent, int movementRangeZ) { - objectEvent->movementRangeZ = param1; + objectEvent->movementRangeZ = movementRangeZ; } -int sub_02063184(const ObjectEvent *objectEvent) +int ObjectEvent_GetMovementRangeZ(const ObjectEvent *objectEvent) { return objectEvent->movementRangeZ; } -void ObjectEvent_SetXPos(ObjectEvent *objectEvent, int param1) +void ObjectEvent_SetX(ObjectEvent *objectEvent, int x) { - objectEvent->x = param1; + objectEvent->x = x; } -int sub_02063190(const ObjectEvent *objectEvent) +int ObjectEvent_GetX(const ObjectEvent *objectEvent) { return objectEvent->x; } -void sub_02063194(ObjectEvent *objectEvent, int param1) +void ObjectEvent_SetY(ObjectEvent *objectEvent, int y) { - objectEvent->y = param1; + objectEvent->y = y; } -int sub_02063198(const ObjectEvent *objectEvent) +int ObjectEvent_GetY(const ObjectEvent *objectEvent) { return objectEvent->y; } -void ObjectEvent_SetZPos(ObjectEvent *objectEvent, int param1) +void ObjectEvent_SetZ(ObjectEvent *objectEvent, int z) { - objectEvent->z = param1; + objectEvent->z = z; } -int sub_020631A0(const ObjectEvent *objectEvent) +int ObjectEvent_GetZ(const ObjectEvent *objectEvent) { return objectEvent->z; } @@ -2372,7 +2366,7 @@ static const ObjectEvent *sub_020631A4(int param0, int param1, const ObjectEvent do { if (sub_020631D8(¶m2[v0]) == 0) { - if (sub_020630F4(¶m2[v0]) == param0) { + if (ObjectEvent_GetLocalID(¶m2[v0]) == param0) { return ¶m2[v0]; } } @@ -2385,7 +2379,7 @@ static const ObjectEvent *sub_020631A4(int param0, int param1, const ObjectEvent static int sub_020631D8(const ObjectEvent *objectEvent) { - u16 v0 = (u16)sub_0206311C(objectEvent); + u16 v0 = (u16)ObjectEvent_GetScript(objectEvent); if (v0 == 0xffff) { return 1; @@ -2397,7 +2391,7 @@ static int sub_020631D8(const ObjectEvent *objectEvent) static int sub_020631F4(const ObjectEvent *objectEvent) { GF_ASSERT(sub_020631D8(objectEvent) == 1); - return sub_02063114(objectEvent); + return ObjectEvent_GetFlag(objectEvent); } static const UnkStruct_020EDF0C *sub_0206320C(u32 param0) @@ -2471,14 +2465,14 @@ MapObject *sub_0206326C(const MapObjectManager *param0, int param1, int param2, v1 = sub_02062878(param0); do { - if (MapObject_CheckStatus(v1, (1 << 0))) { + if (MapObject_CheckStatus(v1, MAP_OBJ_STATUS_0)) { if (param3) { - if ((MapObject_XPosPrev(v1) == param1) && (MapObject_ZPosPrev(v1) == param2)) { + if (MapObject_GetXPrev(v1) == param1 && MapObject_GetZPrev(v1) == param2) { return v1; } } - if ((MapObject_GetXPos(v1) == param1) && (MapObject_GetZPos(v1) == param2)) { + if (MapObject_GetX(v1) == param1 && MapObject_GetZ(v1) == param2) { return v1; } } @@ -2503,14 +2497,14 @@ void sub_020632D4(MapObject *mapObj, const VecFx32 *param1, int param2) v2 = (((param1->z) >> 4) / FX32_ONE); MapObject_SetZ(mapObj, v2); - MapObject_SetPosVec(mapObj, param1); + MapObject_SetPos(mapObj, param1); sub_02064208(mapObj); - sub_0206296C(mapObj, param2); + MapObject_Face(mapObj, param2); sub_020656DC(mapObj); - MapObject_SetStatusFlagOn(mapObj, (1 << 2)); - MapObject_SetStatusFlagOff(mapObj, (1 << 1) | (1 << 3)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_START_MOVEMENT); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_1 | MAP_OBJ_STATUS_END_MOVEMENT); } void MapObject_SetPosDir(MapObject *mapObj, int param1, int param2, int param3, int param4) @@ -2526,13 +2520,13 @@ void MapObject_SetPosDir(MapObject *mapObj, int param1, int param2, int param3, v0.z = (((param3) << 4) * FX32_ONE) + ((16 * FX32_ONE) >> 1); MapObject_SetZ(mapObj, param3); - MapObject_SetPosVec(mapObj, &v0); + MapObject_SetPos(mapObj, &v0); sub_02064208(mapObj); - sub_0206296C(mapObj, param4); + MapObject_Face(mapObj, param4); - MapObject_SetStatusFlagOn(mapObj, (1 << 2)); - MapObject_SetStatusFlagOff(mapObj, (1 << 1) | (1 << 3)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_START_MOVEMENT); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_1 | MAP_OBJ_STATUS_END_MOVEMENT); sub_020656DC(mapObj); } @@ -2540,14 +2534,14 @@ void MapObject_SetPosDir(MapObject *mapObj, int param1, int param2, int param3, void MapObject_SetMoveCode(MapObject *mapObj, u32 param1) { sub_02062B28(mapObj); - sub_02062944(mapObj, param1); + MapObject_SetMovementType(mapObj, param1); sub_0206239C(mapObj); MapObject_InitMove(mapObj); } void sub_020633C8(MapObject *mapObj, int param1) { - MapObject_SetId(mapObj, param1); + MapObject_SetLocalID(mapObj, param1); sub_02062D28(mapObj); sub_02062618(mapObj); diff --git a/src/map_object_move.c b/src/map_object_move.c index 63874fd6a8..32c020d282 100644 --- a/src/map_object_move.c +++ b/src/map_object_move.c @@ -97,11 +97,11 @@ static BOOL sub_02063478(const MapObject *mapObj) if (MapObject_CheckStatus(mapObj, MAP_OBJ_STATUS_12 | MAP_OBJ_STATUS_11) == FALSE) { return TRUE; - } else if (MapObject_GetMoveCode(mapObj) == 0x32) { + } else if (MapObject_GetMovementType(mapObj) == 0x32) { return TRUE; } - u32 v0 = sub_020628B8(mapObj); + u32 v0 = MapObject_GetStatus(mapObj); if ((v0 & (1 << 12)) && ((v0 & (1 << 23)) == 0)) { return FALSE; @@ -386,11 +386,11 @@ static void sub_02063A78(MapObject *mapObj, u8 param1, u8 param2, const UnkStruc } if ((TileBehavior_IsTallGrass(param1) == 1) || (TileBehavior_IsVeryTallGrass(param1) == 1) || (sub_0206406C(mapObj, param1) == 1) || (TileBehavior_IsPuddle(param1) == 1) || (TileBehavior_IsShallowWater(param1) == 1) || (MapObject_IsOnSnow(mapObj, param1) == 1) || (TileBehavior_IsMud(param1) == 1) || (TileBehavior_IsMudWithGrass(param1) == 1) || TileBehavior_IsReflective(param1)) { - MapObject_SetStatusFlagOn(mapObj, (1 << 20)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_HIDE_SHADOW); } else { - if (MapObject_CheckStatus(mapObj, (1 << 15)) == 0) { + if (!MapObject_CheckStatus(mapObj, MAP_OBJ_STATUS_15)) { ov5_021F1570(mapObj); - MapObject_SetStatusFlagOn(mapObj, (1 << 15)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_15); } } } @@ -408,9 +408,9 @@ static void sub_02063B20(MapObject *mapObj, u8 param1, u8 param2, const UnkStruc } if ((TileBehavior_IsTallGrass(param1) == 1) || (TileBehavior_IsVeryTallGrass(param1) == 1) || (sub_0206406C(mapObj, param1) == 1) || (TileBehavior_IsPuddle(param1) == 1) || (TileBehavior_IsShallowWater(param1) == 1) || (MapObject_IsOnSnow(mapObj, param1) == 1) || (TileBehavior_IsMud(param1) == 1) || (TileBehavior_IsMudWithGrass(param1) == 1) || TileBehavior_IsReflective(param1)) { - MapObject_SetStatusFlagOn(mapObj, (1 << 20)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_HIDE_SHADOW); } else { - MapObject_SetStatusFlagOff(mapObj, (1 << 20)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_HIDE_SHADOW); } } @@ -454,28 +454,28 @@ static void sub_02063C48(MapObject *mapObj, u8 param1, u8 param2, const UnkStruc static void sub_02063C60(MapObject *mapObj, u8 param1, u8 param2, const UnkStruct_ov5_021ECD10 *param3) { if (TileBehavior_IsPuddle(param2) == 1) { - ov5_021F2AE4(mapObj, MapObject_XPosPrev(mapObj), MapObject_YPosPrev(mapObj), MapObject_ZPosPrev(mapObj)); + ov5_021F2AE4(mapObj, MapObject_GetXPrev(mapObj), MapObject_GetYPrev(mapObj), MapObject_GetZPrev(mapObj)); } } static void sub_02063C94(MapObject *mapObj, u8 param1, u8 param2, const UnkStruct_ov5_021ECD10 *param3) { if (TileBehavior_IsPuddle(param1) == 1) { - ov5_021F2AE4(mapObj, MapObject_GetXPos(mapObj), MapObject_GetYPos(mapObj), MapObject_GetZPos(mapObj)); + ov5_021F2AE4(mapObj, MapObject_GetX(mapObj), MapObject_GetY(mapObj), MapObject_GetZ(mapObj)); } } static void sub_02063CC8(MapObject *mapObj, u8 param1, u8 param2, const UnkStruct_ov5_021ECD10 *param3) { if (TileBehavior_IsMud(param2) == 1) { - ov5_021F2C38(mapObj, MapObject_XPosPrev(mapObj), MapObject_YPosPrev(mapObj), MapObject_ZPosPrev(mapObj)); + ov5_021F2C38(mapObj, MapObject_GetXPrev(mapObj), MapObject_GetYPrev(mapObj), MapObject_GetZPrev(mapObj)); } } static void sub_02063CFC(MapObject *mapObj, u8 param1, u8 param2, const UnkStruct_ov5_021ECD10 *param3) { if (TileBehavior_IsMud(param1) == 1) { - ov5_021F2C38(mapObj, MapObject_GetXPos(mapObj), MapObject_GetYPos(mapObj), MapObject_GetZPos(mapObj)); + ov5_021F2C38(mapObj, MapObject_GetX(mapObj), MapObject_GetY(mapObj), MapObject_GetZ(mapObj)); } } @@ -581,7 +581,7 @@ u32 sub_02063E94(const MapObject *mapObj, int param1, int param2, int param3, in { VecFx32 v0; - MapObject_PosVectorOut(mapObj, &v0); + MapObject_GetPosPtr(mapObj, &v0); return sub_02063E18(mapObj, &v0, param1, param2, param3, param4); } @@ -589,9 +589,9 @@ u32 sub_02063EBC(const MapObject *mapObj, int param1) { int x, y, z; - x = MapObject_GetXPos(mapObj) + MapObject_GetDxFromDir(param1); - y = MapObject_GetYPos(mapObj); - z = MapObject_GetZPos(mapObj) + MapObject_GetDyFromDir(param1); + x = MapObject_GetX(mapObj) + MapObject_GetDxFromDir(param1); + y = MapObject_GetY(mapObj); + z = MapObject_GetZ(mapObj) + MapObject_GetDyFromDir(param1); return sub_02063E94(mapObj, x, y, z, param1); } @@ -607,40 +607,38 @@ int sub_02063F00(const MapObject *mapObj, int param1, int param2, int param3) v0 = MapObjectMan_GetMaxObjects(mapObjMan); do { - if (v4 != mapObj) { - if (MapObject_CheckStatus(v4, (1 << 0))) { - if (MapObject_CheckStatus(v4, (1 << 18)) == 0) { - v1 = MapObject_GetXPos(v4); - v2 = MapObject_GetZPos(v4); - - if ((v1 == param1) && (v2 == param3)) { - int v5 = MapObject_GetYPos(v4); - int v6 = v5 - param2; - - if (v6 < 0) { - v6 = -v6; - } - - if (v6 < (1 * 2)) { - return 1; - } - } - - v1 = MapObject_XPosPrev(v4); - v2 = MapObject_ZPosPrev(v4); - - if ((v1 == param1) && (v2 == param3)) { - int v7 = MapObject_GetYPos(v4); - int v8 = v7 - param2; - - if (v8 < 0) { - v8 = -v8; - } - - if (v8 < (1 * 2)) { - return 1; - } - } + if (v4 != mapObj + && MapObject_CheckStatus(v4, MAP_OBJ_STATUS_0) + && !MapObject_CheckStatus(v4, MAP_OBJ_STATUS_18)) { + v1 = MapObject_GetX(v4); + v2 = MapObject_GetZ(v4); + + if ((v1 == param1) && (v2 == param3)) { + int v5 = MapObject_GetY(v4); + int v6 = v5 - param2; + + if (v6 < 0) { + v6 = -v6; + } + + if (v6 < (1 * 2)) { + return 1; + } + } + + v1 = MapObject_GetXPrev(v4); + v2 = MapObject_GetZPrev(v4); + + if ((v1 == param1) && (v2 == param3)) { + int v7 = MapObject_GetY(v4); + int v8 = v7 - param2; + + if (v8 < 0) { + v8 = -v8; + } + + if (v8 < (1 * 2)) { + return 1; } } } @@ -656,8 +654,8 @@ int sub_02063FAC(const MapObject *mapObj, int param1, int param2, int param3) { int v0, v1, v2, v3; - v0 = MapObject_XInitial(mapObj); - v1 = MapObject_MaxXOffset(mapObj); + v0 = MapObject_GetXInitial(mapObj); + v1 = MapObject_GetMovementRangeX(mapObj); if (v1 != -1) { v2 = v0 - v1; @@ -668,8 +666,8 @@ int sub_02063FAC(const MapObject *mapObj, int param1, int param2, int param3) } } - v0 = MapObject_ZInitial(mapObj); - v1 = MapObject_MaxZOffset(mapObj); + v0 = MapObject_GetZInitial(mapObj); + v1 = MapObject_GetMovementRangeZ(mapObj); if (v1 != -1) { v2 = v0 - v1; @@ -834,9 +832,9 @@ int MapObject_GetDyFromDir(int param0) void sub_020641B4(MapObject *mapObj, int param1) { - MapObject_SetXPosPrev(mapObj, MapObject_GetXPos(mapObj)); - MapObject_SetYPosPrev(mapObj, MapObject_GetYPos(mapObj)); - MapObject_SetZPosPrev(mapObj, MapObject_GetZPos(mapObj)); + MapObject_SetXPrev(mapObj, MapObject_GetX(mapObj)); + MapObject_SetYPrev(mapObj, MapObject_GetY(mapObj)); + MapObject_SetZPrev(mapObj, MapObject_GetZ(mapObj)); MapObject_AddX(mapObj, MapObject_GetDxFromDir(param1)); MapObject_AddY(mapObj, 0); @@ -845,15 +843,15 @@ void sub_020641B4(MapObject *mapObj, int param1) void sub_02064208(MapObject *mapObj) { - MapObject_SetXPosPrev(mapObj, MapObject_GetXPos(mapObj)); - MapObject_SetYPosPrev(mapObj, MapObject_GetYPos(mapObj)); - MapObject_SetZPosPrev(mapObj, MapObject_GetZPos(mapObj)); + MapObject_SetXPrev(mapObj, MapObject_GetX(mapObj)); + MapObject_SetYPrev(mapObj, MapObject_GetY(mapObj)); + MapObject_SetZPrev(mapObj, MapObject_GetZ(mapObj)); } u32 sub_02064238(MapObject *mapObj, int param1) { - int v0 = MapObject_GetXPos(mapObj) + MapObject_GetDxFromDir(param1); - int v1 = MapObject_GetZPos(mapObj) + MapObject_GetDyFromDir(param1); + int v0 = MapObject_GetX(mapObj) + MapObject_GetDxFromDir(param1); + int v1 = MapObject_GetZ(mapObj) + MapObject_GetDyFromDir(param1); FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); u8 v3 = FieldSystem_GetTileBehavior(fieldSystem, v0, v1); @@ -864,13 +862,13 @@ void MapObject_AddVecToPos(MapObject *mapObj, const VecFx32 *vec) { VecFx32 pos; - MapObject_PosVectorOut(mapObj, &pos); + MapObject_GetPosPtr(mapObj, &pos); pos.x += vec->x; pos.y += vec->y; pos.z += vec->z; - MapObject_SetPosVec(mapObj, &pos); + MapObject_SetPos(mapObj, &pos); } // TODO: This could really use a better name @@ -878,7 +876,7 @@ void MapObject_StepDirection(MapObject *mapObj, int dir, fx32 param2) { VecFx32 pos; - MapObject_PosVectorOut(mapObj, &pos); + MapObject_GetPosPtr(mapObj, &pos); switch (dir) { case DIR_NORTH: @@ -895,18 +893,18 @@ void MapObject_StepDirection(MapObject *mapObj, int dir, fx32 param2) break; } - MapObject_SetPosVec(mapObj, &pos); + MapObject_SetPos(mapObj, &pos); } int sub_020642F8(MapObject *mapObj) { VecFx32 pos, v1; - MapObject_PosVectorOut(mapObj, &pos); + MapObject_GetPosPtr(mapObj, &pos); v1 = pos; if (sub_02062E44(mapObj) == 1) { - MapObject_SetStatusFlagOff(mapObj, (1 << 12)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_12); return 0; } @@ -916,12 +914,12 @@ int sub_020642F8(MapObject *mapObj) if (v4 == 1) { pos.y = v1.y; - MapObject_SetPosVec(mapObj, &pos); - MapObject_SetYPosPrev(mapObj, MapObject_GetYPos(mapObj)); + MapObject_SetPos(mapObj, &pos); + MapObject_SetYPrev(mapObj, MapObject_GetY(mapObj)); MapObject_SetY(mapObj, (((pos.y) >> 3) / FX32_ONE)); - MapObject_SetStatusFlagOff(mapObj, (1 << 12)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_12); } else { - MapObject_SetStatusFlagOn(mapObj, (1 << 12)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_12); } return v4; @@ -933,13 +931,13 @@ int sub_02064390(MapObject *mapObj) u8 v1 = v0; if (sub_02062FDC(mapObj) == 0) { - int v2 = MapObject_XPosPrev(mapObj); - int z = MapObject_ZPosPrev(mapObj); + int v2 = MapObject_GetXPrev(mapObj); + int z = MapObject_GetZPrev(mapObj); FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); v0 = FieldSystem_GetTileBehavior(fieldSystem, v2, z); - v2 = MapObject_GetXPos(mapObj); - z = MapObject_GetZPos(mapObj); + v2 = MapObject_GetX(mapObj); + z = MapObject_GetZ(mapObj); v1 = FieldSystem_GetTileBehavior(fieldSystem, v2, z); } @@ -981,7 +979,7 @@ void sub_02064450(int param0, int param1, VecFx32 *param2) void sub_02064464(MapObject *mapObj) { - int v0 = MapObject_GetMoveCode(mapObj); + int v0 = MapObject_GetMovementType(mapObj); if ((v0 == 0x33) || (v0 == 0x34) || (v0 == 0x35) || (v0 == 0x36)) { sub_02062B14(mapObj); diff --git a/src/overlay005/field_control.c b/src/overlay005/field_control.c index 5a6d7400c2..608138404e 100644 --- a/src/overlay005/field_control.c +++ b/src/overlay005/field_control.c @@ -268,8 +268,8 @@ BOOL FieldInput_Process(const FieldInput *input, FieldSystem *fieldSystem) sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetDir(fieldSystem->playerAvatar)); } - if (MapObject_GetEventType(object) != 0x9) { - ScriptManager_Set(fieldSystem, MapObject_GetEventID(object), object); + if (MapObject_GetTrainerType(object) != 0x9) { + ScriptManager_Set(fieldSystem, MapObject_GetScript(object), object); } else { ScriptManager_Set(fieldSystem, 0, object); } @@ -343,7 +343,7 @@ static BOOL Field_CheckSign(FieldSystem *fieldSystem) MapObject *object; if (sub_0203CBE0(fieldSystem, &object) == TRUE) { - ScriptManager_Set(fieldSystem, MapObject_GetEventID(object), object); + ScriptManager_Set(fieldSystem, MapObject_GetScript(object), object); return TRUE; } @@ -403,12 +403,12 @@ BOOL FieldInput_Process_Colosseum(FieldInput *input, FieldSystem *fieldSystem) if (input->interact) { MapObject *object; - if (sub_0203CA40(fieldSystem, &object) == TRUE && MapObject_GetMoveCode(object) != 0x1) { + if (sub_0203CA40(fieldSystem, &object) == TRUE && MapObject_GetMovementType(object) != 0x1) { if (sub_0205F588(fieldSystem->playerAvatar) == TRUE) { sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetDir(fieldSystem->playerAvatar)); } - ScriptManager_Set(fieldSystem, MapObject_GetEventID(object), object); + ScriptManager_Set(fieldSystem, MapObject_GetScript(object), object); return TRUE; } } @@ -464,7 +464,7 @@ BOOL FieldInput_Process_UnionRoom(const FieldInput *input, FieldSystem *fieldSys } sub_02036B84(); - ScriptManager_Set(fieldSystem, MapObject_GetEventID(object), object); + ScriptManager_Set(fieldSystem, MapObject_GetScript(object), object); return TRUE; } @@ -500,8 +500,8 @@ int FieldInput_Process_BattleTower(const FieldInput *input, FieldSystem *fieldSy sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetDir(fieldSystem->playerAvatar)); } - if (MapObject_GetEventType(object) != 0x9) { - ScriptManager_Set(fieldSystem, MapObject_GetEventID(object), object); + if (MapObject_GetTrainerType(object) != 0x9) { + ScriptManager_Set(fieldSystem, MapObject_GetScript(object), object); } else { ScriptManager_Set(fieldSystem, 0, object); } @@ -1072,9 +1072,9 @@ static BOOL Field_DistortionInteract(FieldSystem *fieldSystem, MapObject **objec sub_020617BC(fieldSystem->playerAvatar, &playerX, &playerY, &playerZ); while (sub_020625B0(fieldSystem->mapObjMan, object, &objectIndex, (1 << 0))) { - objectX = MapObject_GetXPos(*object); - objectY = MapObject_GetYPos(*object) / 2; - objectZ = MapObject_GetZPos(*object); + objectX = MapObject_GetX(*object); + objectY = MapObject_GetY(*object) / 2; + objectZ = MapObject_GetZ(*object); if (playerY == objectY && playerX == objectX && playerZ == objectZ) { return TRUE; diff --git a/src/overlay005/ov5_021DFB54.c b/src/overlay005/ov5_021DFB54.c index dad1ceafb0..1571a19731 100644 --- a/src/overlay005/ov5_021DFB54.c +++ b/src/overlay005/ov5_021DFB54.c @@ -471,7 +471,7 @@ static int ov5_021DFF1C(FieldSystem *fieldSystem, PlayerAvatar *playerAvatar, in } { - int v1 = sub_02062920(mapObj); + int v1 = MapObject_GetGraphicsID(mapObj); if (v1 != 0x54) { return 0; @@ -646,9 +646,9 @@ static BOOL ov5_021E0160(FieldTask *taskMan) int v2 = Player_GetZPos(v0->playerAvatar) + MapObject_GetDyFromDir(v0->unk_04); v0->unk_28 = ov5_021F261C(v0->unk_24, v1, v2, v0->unk_04, 0); } else { - int v3 = MapObject_GetXPos(v0->unk_24); - int v4 = (MapObject_GetYPos(v0->unk_24) / 2); - int v5 = MapObject_GetZPos(v0->unk_24); + int v3 = MapObject_GetX(v0->unk_24); + int v4 = (MapObject_GetY(v0->unk_24) / 2); + int v5 = MapObject_GetZ(v0->unk_24); enum AvatarDistortionState distortionState = PlayerAvatar_MapDistortionState(v0->playerAvatar); sub_02061674(v0->playerAvatar, v0->unk_04, &v3, &v4, &v5); @@ -943,7 +943,7 @@ static int ov5_021E06A8(FieldSystem *fieldSystem, PlayerAvatar *playerAvatar) } { - int v2 = sub_02062920(v1); + int v2 = MapObject_GetGraphicsID(v1); if (v2 != 0x76) { return 0; @@ -1089,7 +1089,7 @@ static int ov5_021E08C0(UnkStruct_ov5_021F9B54 *param0) } { - int v0 = MapObject_GetMoveDir(param0->unk_14); + int v0 = MapObject_GetMovingDir(param0->unk_14); u8 v1 = sub_02064238(param0->unk_14, v0); if (ov5_021E0760(v1, v0) == 1) { @@ -1219,8 +1219,8 @@ static int ov5_021E0A68(UnkStruct_ov5_021F9B10 *param0) int v0, v1; VecFx32 v2, v3; - v0 = MapObject_GetXPos(param0->unk_3C) + (MapObject_GetDxFromDir(0) << 1); - v1 = MapObject_GetZPos(param0->unk_3C) + (MapObject_GetDyFromDir(0) << 1); + v0 = MapObject_GetX(param0->unk_3C) + (MapObject_GetDxFromDir(0) << 1); + v1 = MapObject_GetZ(param0->unk_3C) + (MapObject_GetDyFromDir(0) << 1); sub_02064450(v0, v1, ¶m0->unk_28); sub_020644A4(param0->fieldSystem, ¶m0->unk_28); @@ -1229,7 +1229,7 @@ static int ov5_021E0A68(UnkStruct_ov5_021F9B10 *param0) param0->unk_10 = (((param0->unk_28.y) >> 3) / FX32_ONE); param0->unk_14 = v1; - MapObject_PosVectorOut(param0->unk_3C, &v2); + MapObject_GetPosPtr(param0->unk_3C, &v2); GF_ASSERT(v2.z > param0->unk_28.z); GF_ASSERT(v2.y < param0->unk_28.y); @@ -1251,7 +1251,7 @@ static int ov5_021E0B24(UnkStruct_ov5_021F9B10 *param0) { VecFx32 v0; - MapObject_PosVectorOut(param0->unk_3C, &v0); + MapObject_GetPosPtr(param0->unk_3C, &v0); v0.y += param0->unk_1C.y; @@ -1259,7 +1259,7 @@ static int ov5_021E0B24(UnkStruct_ov5_021F9B10 *param0) v0.y = param0->unk_28.y; } - MapObject_SetPosVec(param0->unk_3C, &v0); + MapObject_SetPos(param0->unk_3C, &v0); param0->unk_08++; @@ -1275,7 +1275,7 @@ static int ov5_021E0B64(UnkStruct_ov5_021F9B10 *param0) { VecFx32 v0; - MapObject_PosVectorOut(param0->unk_3C, &v0); + MapObject_GetPosPtr(param0->unk_3C, &v0); v0.y += param0->unk_1C.y; @@ -1289,7 +1289,7 @@ static int ov5_021E0B64(UnkStruct_ov5_021F9B10 *param0) v0.z = param0->unk_28.z; } - MapObject_SetPosVec(param0->unk_3C, &v0); + MapObject_SetPos(param0->unk_3C, &v0); param0->unk_08++; @@ -1344,8 +1344,8 @@ static int ov5_021E0C34(UnkStruct_ov5_021F9B10 *param0) int v0, v1; VecFx32 v2, v3; - v0 = MapObject_GetXPos(param0->unk_3C) + (MapObject_GetDxFromDir(1) << 1); - v1 = MapObject_GetZPos(param0->unk_3C) + (MapObject_GetDyFromDir(1) << 1); + v0 = MapObject_GetX(param0->unk_3C) + (MapObject_GetDxFromDir(1) << 1); + v1 = MapObject_GetZ(param0->unk_3C) + (MapObject_GetDyFromDir(1) << 1); sub_02064450(v0, v1, ¶m0->unk_28); sub_020644A4(param0->fieldSystem, ¶m0->unk_28); @@ -1355,7 +1355,7 @@ static int ov5_021E0C34(UnkStruct_ov5_021F9B10 *param0) param0->unk_10 = (((param0->unk_28.y) >> 3) / FX32_ONE); param0->unk_14 = v1; - MapObject_PosVectorOut(param0->unk_3C, &v2); + MapObject_GetPosPtr(param0->unk_3C, &v2); GF_ASSERT(v2.z < param0->unk_28.z); GF_ASSERT(v2.y > param0->unk_28.y); @@ -1377,7 +1377,7 @@ static int ov5_021E0CF4(UnkStruct_ov5_021F9B10 *param0) { VecFx32 v0; - MapObject_PosVectorOut(param0->unk_3C, &v0); + MapObject_GetPosPtr(param0->unk_3C, &v0); v0.z += param0->unk_1C.z; @@ -1387,7 +1387,7 @@ static int ov5_021E0CF4(UnkStruct_ov5_021F9B10 *param0) param0->unk_18 += param0->unk_1C.z; } - MapObject_SetPosVec(param0->unk_3C, &v0); + MapObject_SetPos(param0->unk_3C, &v0); param0->unk_08++; @@ -1403,7 +1403,7 @@ static int ov5_021E0D40(UnkStruct_ov5_021F9B10 *param0) { VecFx32 v0; - MapObject_PosVectorOut(param0->unk_3C, &v0); + MapObject_GetPosPtr(param0->unk_3C, &v0); v0.y += param0->unk_1C.y; @@ -1419,7 +1419,7 @@ static int ov5_021E0D40(UnkStruct_ov5_021F9B10 *param0) param0->unk_18 += param0->unk_1C.z; } - MapObject_SetPosVec(param0->unk_3C, &v0); + MapObject_SetPos(param0->unk_3C, &v0); param0->unk_08++; @@ -1572,7 +1572,7 @@ void ov5_021E0E94(PlayerAvatar *playerAvatar) } { - int v2 = sub_02062920(v0); + int v2 = MapObject_GetGraphicsID(v0); if ((v2 == 0xc4) || (v2 == 0xc5) || (v2 == 0x10e) || (v2 == 0x10f)) { return; @@ -1605,7 +1605,7 @@ void ov5_021E0EEC(PlayerAvatar *playerAvatar) } { - int v2 = sub_02062920(v0); + int v2 = MapObject_GetGraphicsID(v0); if ((v2 != 0xc4) && (v2 != 0xc5) && (v2 != 0x10e) && (v2 != 0x10f) && (v2 != 0x112) && (v2 != 0x113)) { return; diff --git a/src/overlay005/ov5_021E1154.c b/src/overlay005/ov5_021E1154.c index 26511e9948..b40e055f9e 100644 --- a/src/overlay005/ov5_021E1154.c +++ b/src/overlay005/ov5_021E1154.c @@ -89,7 +89,7 @@ static BOOL ov5_021E120C(FieldTask *param0) switch (v0->unk_08) { case 0: - MapObject_SetStatusFlagOn(v1, (1 << 8)); + MapObject_SetStatusFlagOn(v1, MAP_OBJ_STATUS_PAUSE_ANIMATION); v0->unk_08++; break; case 1: @@ -136,8 +136,8 @@ static BOOL ov5_021E120C(FieldTask *param0) if (v4 == 0) { v0->unk_08 = 1; } else { - MapObject_SetStatusFlagOff(v1, (1 << 7)); - MapObject_SetStatusFlagOff(v1, (1 << 8)); + MapObject_SetStatusFlagOff(v1, MAP_OBJ_STATUS_LOCK_DIR); + MapObject_SetStatusFlagOff(v1, MAP_OBJ_STATUS_PAUSE_ANIMATION); Player_SetDir(v0->playerAvatar, v0->unk_00); ov5_021E1350(v0); Sound_StopEffect(1624, 0); diff --git a/src/overlay005/ov5_021EB1A0.c b/src/overlay005/ov5_021EB1A0.c index 36dfa14bfc..cac2f83567 100644 --- a/src/overlay005/ov5_021EB1A0.c +++ b/src/overlay005/ov5_021EB1A0.c @@ -103,7 +103,7 @@ static void (*const Unk_ov5_021FF448[11])(MapObject *, UnkStruct_020216E0 *, Unk UnkStruct_020216E0 *ov5_021EB1A0(MapObject *mapObj) { - int v0 = sub_02062920(mapObj); + int v0 = MapObject_GetGraphicsID(mapObj); switch (v0) { case 0x0: @@ -213,7 +213,7 @@ void ov5_021EB328(MapObject *mapObj) } ov5_021ECFA4(mapObj, &v0->unk_04); - MapObject_SetStatusFlagOn(mapObj, (1 << 21)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_21); } void ov5_021EB354(MapObject *mapObj) @@ -235,7 +235,7 @@ void ov5_021EB354(MapObject *mapObj) ov5_021ED03C(v1->unk_04, &v1->unk_08); ov5_021EDEB4(mapObj, v1->unk_04); - MapObject_SetStatusFlagOff(mapObj, (1 << 21)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_21); } } @@ -255,7 +255,7 @@ void ov5_021EB398(MapObject *mapObj) return; } - v0 = MapObject_Dir(mapObj); + v0 = MapObject_GetFacingDir(mapObj); v1 = sub_02062A14(mapObj); GF_ASSERT(v1 < (0x8 + 1)); @@ -519,7 +519,7 @@ void ov5_021EB720(MapObject *mapObj) return; } - v0 = MapObject_Dir(mapObj); + v0 = MapObject_GetFacingDir(mapObj); v1 = sub_02062A14(mapObj); GF_ASSERT(v1 < (0x9 + 1)); @@ -605,7 +605,7 @@ void ov5_021EB848(MapObject *mapObj) } ov5_021ECFA4(mapObj, &v0->unk_04); - MapObject_SetStatusFlagOn(mapObj, (1 << 21)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_21); } void ov5_021EB874(MapObject *mapObj) @@ -626,7 +626,7 @@ void ov5_021EB874(MapObject *mapObj) if (v1->unk_04 != NULL) { ov5_021ED03C(v1->unk_04, &v1->unk_08); ov5_021EDEB4(mapObj, v1->unk_04); - MapObject_SetStatusFlagOff(mapObj, (1 << 21)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_21); } } @@ -646,7 +646,7 @@ void ov5_021EB8B8(MapObject *mapObj) return; } - v0 = MapObject_Dir(mapObj); + v0 = MapObject_GetFacingDir(mapObj); v1 = sub_02062A14(mapObj); if (v2->unk_02) { @@ -685,7 +685,7 @@ void ov5_021EB944(MapObject *mapObj) return; } - v0 = MapObject_Dir(mapObj); + v0 = MapObject_GetFacingDir(mapObj); v1 = sub_02062A14(mapObj); switch (v1) { @@ -768,7 +768,7 @@ void ov5_021EBA60(MapObject *mapObj) } ov5_021ECFA4(mapObj, &v0->unk_04); - MapObject_SetStatusFlagOn(mapObj, (1 << 21)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_21); } void ov5_021EBA8C(MapObject *mapObj) @@ -789,7 +789,7 @@ void ov5_021EBA8C(MapObject *mapObj) if (v1->unk_04 != NULL) { ov5_021ED03C(v1->unk_04, &v1->unk_08); ov5_021EDEB4(mapObj, v1->unk_04); - MapObject_SetStatusFlagOff(mapObj, (1 << 21)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_21); } } @@ -809,7 +809,7 @@ void ov5_021EBAD0(MapObject *mapObj) return; } - v0 = MapObject_Dir(mapObj); + v0 = MapObject_GetFacingDir(mapObj); v1 = sub_02062A14(mapObj); GF_ASSERT(v1 < ((0x8 + 1) + 1)); @@ -1065,7 +1065,7 @@ void ov5_021EBF50(MapObject *mapObj) return; } - v0 = MapObject_Dir(mapObj); + v0 = MapObject_GetFacingDir(mapObj); v1 = sub_02062A14(mapObj); GF_ASSERT(v1 < (((0x8 + 1) + 1) + 1)); @@ -1184,7 +1184,7 @@ void ov5_021EC15C(MapObject *mapObj) return; } - v0 = MapObject_Dir(mapObj); + v0 = MapObject_GetFacingDir(mapObj); v1 = sub_02062A14(mapObj); GF_ASSERT(v1 < (0x3 + 1)); @@ -1346,7 +1346,7 @@ void ov5_021EC3F0(MapObject *mapObj) return; } - v0 = MapObject_Dir(mapObj); + v0 = MapObject_GetFacingDir(mapObj); v1->unk_00 = v0; v1->unk_02 = sub_02062A14(mapObj); @@ -1379,7 +1379,7 @@ void ov5_021EC454(MapObject *mapObj) return; } - v0 = MapObject_Dir(mapObj); + v0 = MapObject_GetFacingDir(mapObj); v1->unk_00 = v0; v1->unk_02 = sub_02062A14(mapObj); @@ -1411,7 +1411,7 @@ void ov5_021EC4BC(MapObject *mapObj) return; } - v0 = MapObject_Dir(mapObj); + v0 = MapObject_GetFacingDir(mapObj); v1 = sub_02062A14(mapObj); switch (v1) { @@ -1455,7 +1455,7 @@ void ov5_021EC554(MapObject *mapObj) return; } - v0 = MapObject_Dir(mapObj); + v0 = MapObject_GetFacingDir(mapObj); if (v0 != v2->unk_00) { v1 = ov5_021EDF18(v0); @@ -1487,7 +1487,7 @@ void ov5_021EC5C0(MapObject *mapObj) return; } - v0 = MapObject_Dir(mapObj); + v0 = MapObject_GetFacingDir(mapObj); v1 = sub_02062A14(mapObj); if (v1 != v2->unk_02) { @@ -1554,12 +1554,12 @@ static void ov5_021EC6C0(MapObject *mapObj, UnkStruct_020216E0 *param1) { int v0 = 1; - if (MapObject_GetStateFlag(mapObj, (1 << 9)) == 1) { + if (MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_HIDE) == 1) { v0 = 0; } - if (MapObject_GetStateFlag(mapObj, (1 << 12)) == 1) { - if (MapObject_GetStateFlag(mapObj, (1 << 13)) == 0) { + if (MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_12) == 1) { + if (!MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_13)) { v0 = 0; } } @@ -1701,7 +1701,7 @@ void ov5_021EC86C(MapObject *mapObj) } ov5_021ECFA4(mapObj, &v0->unk_04); - MapObject_SetStatusFlagOn(mapObj, (1 << 21)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_21); } void ov5_021EC898(MapObject *mapObj) @@ -1722,7 +1722,7 @@ void ov5_021EC898(MapObject *mapObj) if (v1->unk_04 != NULL) { ov5_021ED03C(v1->unk_04, &v1->unk_08); ov5_021EDEB4(mapObj, v1->unk_04); - MapObject_SetStatusFlagOff(mapObj, (1 << 21)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_21); sub_02021444(v1->unk_04, ov5_021EC804, v1); } } @@ -1788,7 +1788,7 @@ void ov5_021EC970(MapObject *mapObj) } ov5_021ECFA4(mapObj, &v0->unk_08); - MapObject_SetStatusFlagOn(mapObj, (1 << 21)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_21); } void ov5_021EC9A0(MapObject *mapObj) @@ -1809,7 +1809,7 @@ void ov5_021EC9A0(MapObject *mapObj) if (v1->unk_08 != NULL) { ov5_021ED03C(v1->unk_08, &v1->unk_0C); ov5_021EDEB4(mapObj, v1->unk_08); - MapObject_SetStatusFlagOff(mapObj, (1 << 21)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_21); } } diff --git a/src/overlay005/ov5_021ECA70.c b/src/overlay005/ov5_021ECA70.c index f6f62968c1..743b69f537 100644 --- a/src/overlay005/ov5_021ECA70.c +++ b/src/overlay005/ov5_021ECA70.c @@ -69,7 +69,7 @@ void ov5_021ECAC4(MapObject *param0) } ov5_021ECFA4(param0, &v0->unk_00); - MapObject_SetStatusFlagOn(param0, (1 << 21)); + MapObject_SetStatusFlagOn(param0, MAP_OBJ_STATUS_21); } void ov5_021ECAF0(MapObject *param0) @@ -89,7 +89,7 @@ void ov5_021ECAF0(MapObject *param0) if (v0->unk_00 != NULL) { ov5_021ED03C(v0->unk_00, &v0->unk_04); ov5_021EDEB4(param0, v0->unk_00); - MapObject_SetStatusFlagOff(param0, (1 << 21)); + MapObject_SetStatusFlagOff(param0, MAP_OBJ_STATUS_21); } } @@ -161,12 +161,12 @@ static void ov5_021ECBCC(MapObject *param0, UnkStruct_020216E0 *param1) { int v0 = 1; - if (MapObject_GetStateFlag(param0, (1 << 9)) == 1) { + if (MapObject_CheckStatusFlag(param0, MAP_OBJ_STATUS_HIDE) == 1) { v0 = 0; } - if (MapObject_GetStateFlag(param0, (1 << 12)) == 1) { - if (MapObject_GetStateFlag(param0, (1 << 13)) == 0) { + if (MapObject_CheckStatusFlag(param0, MAP_OBJ_STATUS_12) == 1) { + if (!MapObject_CheckStatusFlag(param0, MAP_OBJ_STATUS_13)) { v0 = 0; } } diff --git a/src/overlay005/ov5_021ECC20.c b/src/overlay005/ov5_021ECC20.c index 244982c74f..af65cb9407 100644 --- a/src/overlay005/ov5_021ECC20.c +++ b/src/overlay005/ov5_021ECC20.c @@ -69,7 +69,7 @@ void MapObject_Draw(MapObject *param0) return; } - if (MapObject_CheckStatus(param0, (1 << 14)) == 0) { + if (!MapObject_CheckStatus(param0, MAP_OBJ_STATUS_14)) { return; } @@ -80,7 +80,7 @@ void MapObject_Draw(MapObject *param0) const UnkStruct_ov5_021ECD10 *ov5_021ECD04(const MapObject *param0) { - int v0 = sub_02062920(param0); + int v0 = MapObject_GetGraphicsID(param0); const UnkStruct_ov5_021ECD10 *v1 = ov5_021ECD10(v0); return v1; @@ -110,7 +110,7 @@ int ov5_021ECD38(const MapObject *param0) } } - if (MapObject_CheckStatus(param0, (1 << 8))) { + if (MapObject_CheckStatus(param0, MAP_OBJ_STATUS_PAUSE_ANIMATION)) { return 1; } @@ -138,7 +138,7 @@ void ov5_021ECDA0(const MapObject *param0, VecFx32 *param1) { VecFx32 v0, v1, v2, v3; - MapObject_PosVectorOut(param0, &v0); + MapObject_GetPosPtr(param0, &v0); sub_02063078(param0, &v1); sub_0206309C(param0, &v2); sub_020630BC(param0, &v3); @@ -150,7 +150,7 @@ void ov5_021ECDA0(const MapObject *param0, VecFx32 *param1) void ov5_021ECDFC(MapObject *param0, int param1) { - MapObject_SetDir(param0, param1); + MapObject_TryFace(param0, param1); if (sub_02062D4C(param0) == 1) { sub_02062B68(param0); @@ -160,7 +160,7 @@ void ov5_021ECDFC(MapObject *param0, int param1) void ov5_021ECE18(MapObject *param0) { MapObject_SetHidden(param0, 1); - MapObject_SetStatusFlagOn(param0, (1 << 20)); + MapObject_SetStatusFlagOn(param0, MAP_OBJ_STATUS_HIDE_SHADOW); } void ov5_021ECE30(MapObject *param0) diff --git a/src/overlay005/ov5_021ECE40.c b/src/overlay005/ov5_021ECE40.c index b092a2b3b3..202bd482df 100644 --- a/src/overlay005/ov5_021ECE40.c +++ b/src/overlay005/ov5_021ECE40.c @@ -222,7 +222,7 @@ int ov5_021ECEB4(MapObject *param0, UnkStruct_020216E0 **param1, int param2) int ov5_021ECF04(MapObject *param0, UnkStruct_020216E0 **param1) { - int v0 = sub_02062920(param0); + int v0 = MapObject_GetGraphicsID(param0); int v1 = ov5_021ECEB4(param0, param1, v0); return v1; @@ -271,7 +271,7 @@ void ov5_021ECFA4(const MapObject *param0, UnkStruct_020216E0 **param1) ov5_021ED094(param0); if ((*param1) != NULL) { - int v0 = sub_02062920(param0); + int v0 = MapObject_GetGraphicsID(param0); if (sub_020677F4(v0) == 1) { v0 = sub_02067800(param0); @@ -476,7 +476,7 @@ static int ov5_021ED1C8(const MapObjectManager *param0, const MapObject *param1, do { if (v2 != param1) { if (sub_02062CF8(v2) == 1) { - v1 = sub_02062920(v2); + v1 = MapObject_GetGraphicsID(v2); if (sub_020677F4(v1) == 1) { v1 = sub_02067800(v2); @@ -1102,12 +1102,12 @@ static int ov5_021EDA54(const MapObjectManager *param0, int param1, const MapObj int v0 = 0, v1; MapObject *v2 = NULL; - while (sub_020625B0(param0, &v2, &v0, (1 << 0)) == 1) { + while (sub_020625B0(param0, &v2, &v0, MAP_OBJ_STATUS_0) == 1) { if ((param2 != NULL) && (param2 == v2)) { continue; } - v1 = sub_02062920(v2); + v1 = MapObject_GetGraphicsID(v2); if (sub_020677F4(v1) == 1) { v1 = sub_02067800(v2); @@ -1126,12 +1126,12 @@ static int ov5_021EDAB4(const MapObjectManager *param0, int param1, const MapObj int v0, v1 = 0; MapObject *v2 = NULL; - while (sub_020625B0(param0, &v2, &v1, (1 << 0)) == 1) { + while (sub_020625B0(param0, &v2, &v1, MAP_OBJ_STATUS_0) == 1) { if ((param2 != NULL) && (param2 == v2)) { continue; } - v0 = sub_02062920(v2); + v0 = MapObject_GetGraphicsID(v2); if (v0 == 0xffff) { continue; @@ -1164,7 +1164,7 @@ static int ov5_021EDB3C(const MapObjectManager *param0, int param1, const MapObj int v0, v1 = 0; MapObject *v2 = NULL; - while (sub_020625B0(param0, &v2, &v1, (1 << 0)) == 1) { + while (sub_020625B0(param0, &v2, &v1, MAP_OBJ_STATUS_0) == 1) { if ((param2 != NULL) && (v2 == param2)) { continue; } @@ -1181,7 +1181,7 @@ static int ov5_021EDB3C(const MapObjectManager *param0, int param1, const MapObj } } - v0 = sub_02062920(v2); + v0 = MapObject_GetGraphicsID(v2); if (sub_020677F4(v0) == 1) { v0 = sub_02067800(v2); @@ -1404,15 +1404,15 @@ static u32 ov5_021EDD50(int param0) void ov5_021EDD78(MapObject *param0, int param1) { if (param1 == 1) { - MapObject_SetStatusFlagOn(param0, (1 << 22)); + MapObject_SetStatusFlagOn(param0, MAP_OBJ_STATUS_22); } else { - MapObject_SetStatusFlagOff(param0, (1 << 22)); + MapObject_SetStatusFlagOff(param0, MAP_OBJ_STATUS_22); } } int ov5_021EDD94(MapObject *param0) { - if (MapObject_CheckStatus(param0, (1 << 22))) { + if (MapObject_CheckStatus(param0, MAP_OBJ_STATUS_22)) { return 1; } @@ -1524,12 +1524,12 @@ void ov5_021EDED8(MapObject *param0, UnkStruct_020216E0 *param1) { int v0 = 1; - if (MapObject_GetStateFlag(param0, (1 << 9)) == 1) { + if (MapObject_CheckStatusFlag(param0, MAP_OBJ_STATUS_HIDE) == 1) { v0 = 0; } - if (MapObject_GetStateFlag(param0, (1 << 12)) == 1) { - if (MapObject_GetStateFlag(param0, (1 << 13)) == 0) { + if (MapObject_CheckStatusFlag(param0, MAP_OBJ_STATUS_12) == 1) { + if (!MapObject_CheckStatusFlag(param0, MAP_OBJ_STATUS_13)) { v0 = 0; } } @@ -1860,7 +1860,7 @@ static void ov5_021EE2D0(UnkStruct_ov5_021ED0A4 *param0, UnkStruct_ov5_021EE294 ov5_021EDD78(param1->unk_04, 0); - if (MapObject_GetStateFlag(param1->unk_04, (1 << 21)) == 1) { + if (MapObject_CheckStatusFlag(param1->unk_04, MAP_OBJ_STATUS_21) == 1) { sub_02062BA4(param1->unk_04); } else { sub_02062B68(param1->unk_04); @@ -1924,7 +1924,7 @@ static void ov5_021EE3C4(UnkStruct_ov5_021ED0A4 *param0) UnkStruct_020216E0 *ov5_021EE3FC(MapObject *param0, int param1, UnkFuncPtr_ov5_021EE454 param2, void *param3) { if ((ov5_021EDD94(param0) == 1) || (ov5_021EB1A0(param0) == NULL)) { - int v0 = sub_02062920(param0); + int v0 = MapObject_GetGraphicsID(param0); const MapObjectManager *v1 = MapObject_MapObjectManager(param0); sub_02061B48(param0); @@ -1953,7 +1953,7 @@ static UnkStruct_020216E0 *ov5_021EE454(MapObject *param0, int param1, UnkFuncPt v11->unk_00 = param1; v11->unk_50 = param0; - v2 = sub_02062920(param0); + v2 = MapObject_GetGraphicsID(param0); { v1 = 0; @@ -2044,7 +2044,7 @@ static UnkStruct_020216E0 *ov5_021EE454(MapObject *param0, int param1, UnkFuncPt v13 = 1; } - MapObject_PosVectorOut(param0, &v12); + MapObject_GetPosPtr(param0, &v12); v11->unk_54 = ov5_021F1BA4(ov5_021DF578(param0), &v11->unk_28, v11->unk_24, &v12, v13, v14); } } @@ -2097,7 +2097,7 @@ static void ov5_021EE698(SysTask *param0, void *param1) return; } - if (sub_02062920(v1) != v0->unk_00) { + if (MapObject_GetGraphicsID(v1) != v0->unk_00) { v0->unk_04++; } break; diff --git a/src/overlay005/ov5_021F10E8.c b/src/overlay005/ov5_021F10E8.c index 5f1093f4db..79ae981d8a 100644 --- a/src/overlay005/ov5_021F10E8.c +++ b/src/overlay005/ov5_021F10E8.c @@ -191,7 +191,7 @@ UnkStruct_ov101_021D5D90 *ov5_021F121C(const MapObject *param0, const VecFx32 *p UnkStruct_021F121C v2; UnkStruct_ov5_021DF47C *v3 = ov5_021DF578(param0); - v2.unk_00 = sub_02062920(param0); + v2.unk_00 = MapObject_GetGraphicsID(param0); v2.unk_04 = v3; v2.unk_08 = param0; @@ -209,7 +209,7 @@ static int ov5_021F1258(UnkStruct_ov101_021D5D90 *param0, void *param1) v1 = sub_020715BC(param0); v0->unk_1C = *v1; - v0->unk_04 = MapObject_Id(v0->unk_1C.unk_08); + v0->unk_04 = MapObject_GetLocalID(v0->unk_1C.unk_08); v0->unk_18 = ov5_021F11FC(v0->unk_1C.unk_04, v0->unk_1C.unk_00); if (sub_02062E94(v0->unk_1C.unk_08) == 1) { @@ -240,7 +240,7 @@ static void ov5_021F12AC(UnkStruct_ov101_021D5D90 *param0, void *param1) { VecFx32 v2, v3; - MapObject_PosVectorOut(v1, &v2); + MapObject_GetPosPtr(v1, &v2); sub_02063078(v1, &v3); v2.x += v3.x + v0->unk_0C.x; diff --git a/src/overlay005/ov5_021F134C.c b/src/overlay005/ov5_021F134C.c index 3b788859ab..d57142d568 100644 --- a/src/overlay005/ov5_021F134C.c +++ b/src/overlay005/ov5_021F134C.c @@ -210,7 +210,7 @@ void ov5_021F1570(MapObject *param0) v2.unk_04 = ov5_021DF55C(v3, 0); v2.unk_08 = param0; - MapObject_PosVectorOut(param0, &v4); + MapObject_GetPosPtr(param0, &v4); v0 = 0; v1 = sub_02062758(param0, 2); @@ -228,8 +228,8 @@ static int ov5_021F15B4(UnkStruct_ov101_021D5D90 *param0, void *param1) v0->unk_14 = *v1; v0->unk_10 = sub_020715B4(param0); - v0->unk_00 = sub_02062920(v0->unk_14.unk_08); - v0->unk_04 = MapObject_Id(v0->unk_14.unk_08); + v0->unk_00 = MapObject_GetGraphicsID(v0->unk_14.unk_08); + v0->unk_04 = MapObject_GetLocalID(v0->unk_14.unk_08); if (sub_02062E94(v0->unk_14.unk_08) == 1) { v0->unk_08 = sub_02062C18(v0->unk_14.unk_08); @@ -265,7 +265,7 @@ static void ov5_021F1604(UnkStruct_ov101_021D5D90 *param0, void *param1) v0->unk_0C = 0; - if (MapObject_GetStateFlag(v1, (1 << 9) | (1 << 20)) == 1) { + if (MapObject_CheckStatusFlag(v1, MAP_OBJ_STATUS_HIDE | MAP_OBJ_STATUS_HIDE_SHADOW) == 1) { v0->unk_0C = 1; return; } @@ -273,7 +273,7 @@ static void ov5_021F1604(UnkStruct_ov101_021D5D90 *param0, void *param1) { VecFx32 v2; - MapObject_PosVectorOut(v1, &v2); + MapObject_GetPosPtr(v1, &v2); sub_020715D4(param0, &v2); } } @@ -319,7 +319,7 @@ UnkStruct_ov101_021D5D90 *ov5_021F16D4(MapObject *param0, int param1) v1.unk_04 = ov5_021DF55C(v2, 0); v1.unk_08 = param0; - MapObject_PosVectorOut(param0, &v3); + MapObject_GetPosPtr(param0, &v3); v0 = sub_02062758(param0, 2); return ov5_021DF72C(v2, &Unk_ov5_02200298, &v3, param1, &v1, v0); @@ -340,7 +340,7 @@ static void ov5_021F1718(UnkStruct_ov101_021D5D90 *param0, void *param1) v0->unk_0C = 0; - if (MapObject_GetStateFlag(v1, (1 << 9) | (1 << 20)) == 1) { + if (MapObject_CheckStatusFlag(v1, MAP_OBJ_STATUS_HIDE | MAP_OBJ_STATUS_HIDE_SHADOW) == 1) { v0->unk_0C = 1; return; } @@ -348,7 +348,7 @@ static void ov5_021F1718(UnkStruct_ov101_021D5D90 *param0, void *param1) { VecFx32 v2; - MapObject_PosVectorOut(v1, &v2); + MapObject_GetPosPtr(v1, &v2); sub_020715D4(param0, &v2); } } diff --git a/src/overlay005/ov5_021F17B8.c b/src/overlay005/ov5_021F17B8.c index 8bdf6d5214..926675b689 100644 --- a/src/overlay005/ov5_021F17B8.c +++ b/src/overlay005/ov5_021F17B8.c @@ -110,7 +110,7 @@ void ov5_021F1800(MapObject *param0, int param1) v2.unk_08 = ov5_021DF55C(v2.unk_04, 1); v2.unk_0C = param0; - MapObject_PosVectorOut(param0, &v1); + MapObject_GetPosPtr(param0, &v1); v0 = sub_02062758(param0, 2); v3 = ov5_021DF72C(v2.unk_04, &Unk_ov5_02200338, &v1, param1, &v2, v0); @@ -127,9 +127,9 @@ static int ov5_021F184C(UnkStruct_ov101_021D5D90 *param0, void *param1) v1->unk_14 = *v2; v1->unk_10 = sub_020715B4(param0); - v1->unk_00 = MapObject_Id(v1->unk_14.unk_0C); + v1->unk_00 = MapObject_GetLocalID(v1->unk_14.unk_0C); v1->unk_04 = sub_02062918(v1->unk_14.unk_0C); - v1->unk_08 = sub_02062920(v1->unk_14.unk_0C); + v1->unk_08 = MapObject_GetGraphicsID(v1->unk_14.unk_0C); if (sub_020677F4(v1->unk_08) == 1) { v1->unk_08 = sub_02067800(v1->unk_14.unk_0C); @@ -170,7 +170,7 @@ static void ov5_021F18E0(UnkStruct_ov101_021D5D90 *param0, void *param1) v1 = param1; v2 = v1->unk_14.unk_0C; - v0 = sub_02062920(v2); + v0 = MapObject_GetGraphicsID(v2); if (sub_020677F4(v0) == 1) { v0 = sub_02067800(v1->unk_14.unk_0C); @@ -211,7 +211,7 @@ static void ov5_021F1978(UnkStruct_ov101_021D5D90 *param0, void *param1) MapObject *v1 = v0->unk_14.unk_0C; { - int v2 = sub_02062920(v1); + int v2 = MapObject_GetGraphicsID(v1); if (sub_020677F4(v2) == 1) { v2 = sub_02067800(v0->unk_14.unk_0C); @@ -273,7 +273,7 @@ static void ov5_021F1A24(UnkStruct_ov5_021F1A24 *param0, MapObject *param1, VecF v1 = param2->x; v2 = -param2->z; - MapObject_PosVectorOut(param1, param2); + MapObject_GetPosPtr(param1, param2); v0 = sub_020644A4(param0->unk_14.fieldSystem, param2); param2->x += v1; diff --git a/src/overlay005/ov5_021F1CC8.c b/src/overlay005/ov5_021F1CC8.c index 0d9242bff3..c7279d26ee 100644 --- a/src/overlay005/ov5_021F1CC8.c +++ b/src/overlay005/ov5_021F1CC8.c @@ -189,11 +189,11 @@ static UnkStruct_ov101_021D5D90 *ov5_021F1ECC(const MapObject *param0, int param VecFx32 v0; UnkStruct_ov101_021D5D90 *v1; UnkStruct_021F1FB8 v2; - int v3 = MapObject_XPosPrev(param0); - int v4 = MapObject_ZPosPrev(param0); - fx32 v5 = sub_02063074(param0); - int v6 = MapObject_Dir(param0); - int v7 = sub_02062990(param0); + int v3 = MapObject_GetXPrev(param0); + int v4 = MapObject_GetZPrev(param0); + fx32 v5 = MapObject_GetPosY(param0); + int v6 = MapObject_GetFacingDir(param0); + int v7 = MapObject_GetPrevFacingDir(param0); int v8 = sub_02062758(param0, 2); UnkStruct_ov5_021DF47C *v9 = ov5_021DF578(param0); UnkStruct_021F1CF8 *v10 = ov5_021DF55C(v9, 11); diff --git a/src/overlay005/ov5_021F204C.c b/src/overlay005/ov5_021F204C.c index a7be3ebc77..4977f1c349 100644 --- a/src/overlay005/ov5_021F204C.c +++ b/src/overlay005/ov5_021F204C.c @@ -129,7 +129,7 @@ void ov5_021F20D4(MapObject *param0) v2.unk_04 = ov5_021DF55C(v3, 12); v2.unk_08 = param0; - MapObject_PosVectorOut(param0, &v4); + MapObject_GetPosPtr(param0, &v4); v0 = 0; v1 = sub_02062C0C(param0) + 1; @@ -146,7 +146,7 @@ static int ov5_021F2118(UnkStruct_ov101_021D5D90 *param0, void *param1) v1 = sub_020715BC(param0); v0->unk_10 = *v1; - v0->unk_00 = MapObject_Id(v0->unk_10.unk_08); + v0->unk_00 = MapObject_GetLocalID(v0->unk_10.unk_08); v0->unk_04 = sub_02062918(v0->unk_10.unk_08); return 1; @@ -172,7 +172,7 @@ static void ov5_021F2148(UnkStruct_ov101_021D5D90 *param0, void *param1) v0->unk_08 = 0; - if ((MapObject_GetStateFlag(v1, (1 << 9)) == 1) || (sub_02055F00(MapObject_FieldSystem(v1), v1) == 0)) { + if ((MapObject_CheckStatusFlag(v1, MAP_OBJ_STATUS_HIDE) == 1) || (!sub_02055F00(MapObject_FieldSystem(v1), v1))) { v0->unk_08 = 1; return; } @@ -184,7 +184,7 @@ static void ov5_021F2148(UnkStruct_ov101_021D5D90 *param0, void *param1) { VecFx32 v2; - MapObject_PosVectorOut(v1, &v2); + MapObject_GetPosPtr(v1, &v2); sub_020715D4(param0, &v2); } } diff --git a/src/overlay005/ov5_021F23D0.c b/src/overlay005/ov5_021F23D0.c index b86e08a9b6..562f427cbe 100644 --- a/src/overlay005/ov5_021F23D0.c +++ b/src/overlay005/ov5_021F23D0.c @@ -119,14 +119,14 @@ static int ov5_021F2488(UnkStruct_ov101_021D5D90 *param0, void *param1) ov5_021DFB40(v0->unk_10.unk_00, &v0->unk_1C, &v0->unk_10.unk_04->unk_04, &v0->unk_10.unk_04->unk_18, 0); sub_02073B90(&v0->unk_40, &v0->unk_10.unk_04->unk_04, &v0->unk_1C); - v0->unk_04 = MapObject_Id(v0->unk_10.unk_08); + v0->unk_04 = MapObject_GetLocalID(v0->unk_10.unk_08); v0->unk_08 = sub_02062918(v0->unk_10.unk_08); { VecFx32 v2, v3; MapObject *v4 = v0->unk_10.unk_08; - MapObject_PosVectorOut(v4, &v2); + MapObject_GetPosPtr(v4, &v2); sub_02063078(v4, &v3); v2.x += v3.x + 0; @@ -167,7 +167,7 @@ static void ov5_021F251C(UnkStruct_ov101_021D5D90 *param0, void *param1) if (v0->unk_0C == 0) { VecFx32 v2, v3; - MapObject_PosVectorOut(v1, &v2); + MapObject_GetPosPtr(v1, &v2); sub_02063078(v1, &v3); v2.x += v3.x + 0; diff --git a/src/overlay005/ov5_021F25C0.c b/src/overlay005/ov5_021F25C0.c index 7f0b257432..1a77c857e8 100644 --- a/src/overlay005/ov5_021F25C0.c +++ b/src/overlay005/ov5_021F25C0.c @@ -99,7 +99,7 @@ UnkStruct_ov101_021D5D90 *ov5_021F261C(MapObject *param0, int param1, int param2 } else { VecFx32 v3 = { 0, (FX32_ONE * 7), (FX32_ONE * 4) }; - MapObject_PosVectorOut(param0, &v1); + MapObject_GetPosPtr(param0, &v1); sub_020630AC(param0, &v3); } @@ -116,7 +116,7 @@ static int ov5_021F26A8(UnkStruct_ov101_021D5D90 *param0, void *param1) MapObject *v2 = v1->unk_0C; v0->unk_24 = *v1; - v0->unk_0C = MapObject_Id(v2); + v0->unk_0C = MapObject_GetLocalID(v2); v0->unk_10 = sub_02062918(v2); v0->unk_08 = v1->unk_00; v0->unk_18 = sub_020715B4(param0); @@ -146,7 +146,7 @@ static void ov5_021F2708(UnkStruct_ov101_021D5D90 *param0, void *param1) } v0->unk_00 = 0; - v0->unk_04 = MapObject_Dir(v1); + v0->unk_04 = MapObject_GetFacingDir(v1); if (v0->unk_04 == -1) { v0->unk_00 = 1; @@ -184,7 +184,7 @@ static void ov5_021F2708(UnkStruct_ov101_021D5D90 *param0, void *param1) { VecFx32 v3; - MapObject_PosVectorOut(v1, &v3); + MapObject_GetPosPtr(v1, &v3); v3.y += v0->unk_1C - FX32_ONE; sub_020715D4(param0, &v3); } diff --git a/src/overlay005/ov5_021F2850.c b/src/overlay005/ov5_021F2850.c index 4b85b30c40..2a38b8128c 100644 --- a/src/overlay005/ov5_021F2850.c +++ b/src/overlay005/ov5_021F2850.c @@ -135,7 +135,7 @@ UnkStruct_ov101_021D5D90 *ov5_021F28F4(MapObject *param0, int param1, int param2 v3.z = (((param2) << 4) * FX32_ONE) + ((16 * FX32_ONE) >> 1); sub_020644A4(v2.fieldSystem, &v3); } else { - MapObject_PosVectorOut(param0, &v3); + MapObject_GetPosPtr(param0, &v3); } v0 = sub_02062758(param0, 2); @@ -190,7 +190,7 @@ static void ov5_021F29D0(UnkStruct_ov101_021D5D90 *param0, void *param1) { VecFx32 v3; - MapObject_PosVectorOut(v1, &v3); + MapObject_GetPosPtr(v1, &v3); v3.y += 0; sub_020715D4(param0, &v3); } diff --git a/src/overlay005/ov5_021F2A7C.c b/src/overlay005/ov5_021F2A7C.c index e5145476a1..52b443eba4 100644 --- a/src/overlay005/ov5_021F2A7C.c +++ b/src/overlay005/ov5_021F2A7C.c @@ -83,7 +83,7 @@ void ov5_021F2AE4(MapObject *param0, int param1, int param2, int param3) sub_02064450(param1, param3, &v3); v3.z += ((param2) << 3) + (FX32_ONE * 1); - v3.y = (((MapObject_YPosPrev(param0)) << 3) * FX32_ONE) + (-FX32_ONE * 8); + v3.y = (((MapObject_GetYPrev(param0)) << 3) * FX32_ONE) + (-FX32_ONE * 8); v1 = 0; v0 = sub_02062758(param0, 2); diff --git a/src/overlay005/ov5_021F2BD0.c b/src/overlay005/ov5_021F2BD0.c index 3b33b057c8..5e978947f3 100644 --- a/src/overlay005/ov5_021F2BD0.c +++ b/src/overlay005/ov5_021F2BD0.c @@ -83,7 +83,7 @@ void ov5_021F2C38(MapObject *param0, int param1, int param2, int param3) sub_02064450(param1, param3, &v3); v3.z += ((param2) << 3) + (FX32_ONE * 0); - v3.y = (((MapObject_YPosPrev(param0)) << 3) * FX32_ONE) + (-FX32_ONE * 8); + v3.y = (((MapObject_GetYPrev(param0)) << 3) * FX32_ONE) + (-FX32_ONE * 8); v1 = 0; v0 = sub_02062758(param0, 2); diff --git a/src/overlay005/ov5_021F2D20.c b/src/overlay005/ov5_021F2D20.c index 3e5c5c160d..224dfb4850 100644 --- a/src/overlay005/ov5_021F2D20.c +++ b/src/overlay005/ov5_021F2D20.c @@ -158,15 +158,15 @@ void ov5_021F2EA4(MapObject *param0, int param1) v3 = ov5_021DF578(param0); - v2.unk_00 = MapObject_GetXPos(param0); - v2.unk_04 = MapObject_GetYPos(param0); - v2.unk_08 = MapObject_GetZPos(param0); + v2.unk_00 = MapObject_GetX(param0); + v2.unk_04 = MapObject_GetY(param0); + v2.unk_08 = MapObject_GetZ(param0); v2.unk_10 = v3; v2.fieldSystem = ov5_021DF574(v3); v2.unk_14 = ov5_021DF55C(v3, 19); v2.unk_18 = param0; - MapObject_PosVectorOut(param0, &v1); + MapObject_GetPosPtr(param0, &v1); v0 = sub_02062758(param0, 2); v4 = ov5_021DF72C(v3, &Unk_ov5_022004EC, &v1, param1, &v2, v0); @@ -184,12 +184,12 @@ static int ov5_021F2F0C(UnkStruct_ov101_021D5D90 *param0, void *param1) v3->unk_18 = *v4; v3->unk_04 = sub_02062924(v3->unk_18.unk_18); - v3->unk_08 = MapObject_Id(v3->unk_18.unk_18); + v3->unk_08 = MapObject_GetLocalID(v3->unk_18.unk_18); v3->unk_0C = sub_02062918(v3->unk_18.unk_18); v2.x = (((v3->unk_18.unk_00) << 4) * FX32_ONE); v2.z = (((v3->unk_18.unk_08) << 4) * FX32_ONE); - v2.y = sub_02063074(v3->unk_18.unk_18); + v2.y = MapObject_GetPosY(v3->unk_18.unk_18); v3->unk_14 = sub_020644A4(v3->unk_18.fieldSystem, &v2); v2.x += ((16 * FX32_ONE) >> 1); @@ -266,8 +266,8 @@ static void ov5_021F2FAC(UnkStruct_ov101_021D5D90 *param0, void *param1) { int v5, v6; - v5 = MapObject_GetXPos(v2); - v6 = MapObject_GetZPos(v2); + v5 = MapObject_GetX(v2); + v6 = MapObject_GetZ(v2); if ((v1->unk_18.unk_00 != v5) || (v1->unk_18.unk_08 != v6)) { ov5_021DF74C(param0); diff --git a/src/overlay005/ov5_021F3284.c b/src/overlay005/ov5_021F3284.c index da63ca222c..21501ad182 100644 --- a/src/overlay005/ov5_021F3284.c +++ b/src/overlay005/ov5_021F3284.c @@ -111,7 +111,7 @@ static int ov5_021F336C(UnkStruct_ov101_021D5D90 *param0, void *param1) v1->unk_14 = *v2; v1->unk_04 = sub_02062924(v1->unk_14.unk_0C); - v1->unk_08 = MapObject_Id(v1->unk_14.unk_0C); + v1->unk_08 = MapObject_GetLocalID(v1->unk_14.unk_0C); v1->unk_0C = sub_02062918(v1->unk_14.unk_0C); sub_020715D4(param0, &v0); @@ -182,7 +182,7 @@ static void ov5_021F3448(UnkStruct_ov101_021D5D90 *param0, void *param1) return; } - MapObject_PosVectorOut(v2, &v0); + MapObject_GetPosPtr(v2, &v0); v0.z += FX32_ONE * 8; sub_020212A8(v1->unk_24, &v0); diff --git a/src/overlay005/ov5_021F348C.c b/src/overlay005/ov5_021F348C.c index c081135079..82f8afb027 100644 --- a/src/overlay005/ov5_021F348C.c +++ b/src/overlay005/ov5_021F348C.c @@ -120,8 +120,8 @@ static void ov5_021F35E8(UnkStruct_ov5_021DF47C *param0, MapObject *param1, UnkS param2->unk_08 = ov5_021DF55C(param0, 23); param2->unk_0C = param1; - MapObject_PosVectorOut(param1, param3); - sub_02064450(MapObject_GetXPos(param1), MapObject_GetZPos(param1), param3); + MapObject_GetPosPtr(param1, param3); + sub_02064450(MapObject_GetX(param1), MapObject_GetZ(param1), param3); *param4 = sub_02062758(param1, 2); } @@ -193,7 +193,7 @@ static int ov5_021F36F4(UnkStruct_ov101_021D5D90 *param0, void *param1) v3 = sub_020715BC(param0); v2->unk_10 = *v3; - v2->unk_04 = MapObject_Id(v2->unk_10.unk_0C); + v2->unk_04 = MapObject_GetLocalID(v2->unk_10.unk_0C); v2->unk_08 = sub_02062918(v2->unk_10.unk_0C); sub_020715E4(param0, &v1); diff --git a/src/overlay005/ov5_021F37A8.c b/src/overlay005/ov5_021F37A8.c index 2f89362a1d..aee816ccc7 100644 --- a/src/overlay005/ov5_021F37A8.c +++ b/src/overlay005/ov5_021F37A8.c @@ -94,15 +94,15 @@ void ov5_021F3844(MapObject *param0, int param1) v3 = ov5_021DF578(param0); - v2.unk_00 = MapObject_GetXPos(param0); - v2.unk_04 = MapObject_GetYPos(param0); - v2.unk_08 = MapObject_GetZPos(param0); + v2.unk_00 = MapObject_GetX(param0); + v2.unk_04 = MapObject_GetY(param0); + v2.unk_08 = MapObject_GetZ(param0); v2.unk_10 = v3; v2.fieldSystem = ov5_021DF574(v3); v2.unk_14 = ov5_021DF55C(v3, 24); v2.unk_18 = param0; - MapObject_PosVectorOut(param0, &v1); + MapObject_GetPosPtr(param0, &v1); v0 = sub_02062758(param0, 2); v4 = ov5_021DF72C(v3, &Unk_ov5_02200620, &v1, param1, &v2, v0); @@ -120,12 +120,12 @@ static int ov5_021F38AC(UnkStruct_ov101_021D5D90 *param0, void *param1) v3->unk_18 = *v4; v3->unk_04 = sub_02062924(v3->unk_18.unk_18); - v3->unk_08 = MapObject_Id(v3->unk_18.unk_18); + v3->unk_08 = MapObject_GetLocalID(v3->unk_18.unk_18); v3->unk_0C = sub_02062918(v3->unk_18.unk_18); v2.x = (((v3->unk_18.unk_00) << 4) * FX32_ONE); v2.z = (((v3->unk_18.unk_08) << 4) * FX32_ONE); - v2.y = sub_02063074(v3->unk_18.unk_18); + v2.y = MapObject_GetPosY(v3->unk_18.unk_18); v3->unk_14 = sub_020644A4(v3->unk_18.fieldSystem, &v2); @@ -195,8 +195,8 @@ static void ov5_021F394C(UnkStruct_ov101_021D5D90 *param0, void *param1) sub_02021368(v1->unk_34, 0); v1->unk_00 = 2; case 2: { - int v5 = MapObject_GetXPos(v2); - int v6 = MapObject_GetZPos(v2); + int v5 = MapObject_GetX(v2); + int v6 = MapObject_GetZ(v2); if ((v1->unk_18.unk_00 != v5) || (v1->unk_18.unk_08 != v6)) { ov5_021DF74C(param0); diff --git a/src/overlay005/ov5_021F3A50.c b/src/overlay005/ov5_021F3A50.c index 906c829ca4..be0d3b4ae3 100644 --- a/src/overlay005/ov5_021F3A50.c +++ b/src/overlay005/ov5_021F3A50.c @@ -94,15 +94,15 @@ void ov5_021F3AEC(MapObject *param0, int param1) v3 = ov5_021DF578(param0); - v2.unk_00 = MapObject_GetXPos(param0); - v2.unk_04 = MapObject_GetYPos(param0); - v2.unk_08 = MapObject_GetZPos(param0); + v2.unk_00 = MapObject_GetX(param0); + v2.unk_04 = MapObject_GetY(param0); + v2.unk_08 = MapObject_GetZ(param0); v2.unk_10 = v3; v2.fieldSystem = ov5_021DF574(v3); v2.unk_14 = ov5_021DF55C(v3, 25); v2.unk_18 = param0; - MapObject_PosVectorOut(param0, &v1); + MapObject_GetPosPtr(param0, &v1); v0 = sub_02062758(param0, 2); v4 = ov5_021DF72C(v3, &Unk_ov5_0220064C, &v1, param1, &v2, v0); @@ -120,12 +120,12 @@ static int ov5_021F3B54(UnkStruct_ov101_021D5D90 *param0, void *param1) v3->unk_18 = *v4; v3->unk_04 = sub_02062924(v3->unk_18.unk_18); - v3->unk_08 = MapObject_Id(v3->unk_18.unk_18); + v3->unk_08 = MapObject_GetLocalID(v3->unk_18.unk_18); v3->unk_0C = sub_02062918(v3->unk_18.unk_18); v2.x = (((v3->unk_18.unk_00) << 4) * FX32_ONE); v2.z = (((v3->unk_18.unk_08) << 4) * FX32_ONE); - v2.y = sub_02063074(v3->unk_18.unk_18); + v2.y = MapObject_GetPosY(v3->unk_18.unk_18); v3->unk_14 = sub_020644A4(v3->unk_18.fieldSystem, &v2); v2.x += (((16 * FX32_ONE) >> 1) - (FX32_ONE / 2)); @@ -196,8 +196,8 @@ static void ov5_021F3C00(UnkStruct_ov101_021D5D90 *param0, void *param1) sub_02021368(v1->unk_34, 0); v1->unk_00 = 2; case 2: { - int v5 = MapObject_GetXPos(v2); - int v6 = MapObject_GetZPos(v2); + int v5 = MapObject_GetX(v2); + int v6 = MapObject_GetZ(v2); if ((v1->unk_18.unk_00 != v5) || (v1->unk_18.unk_08 != v6)) { ov5_021DF74C(param0); diff --git a/src/overlay005/ov5_021F3D00.c b/src/overlay005/ov5_021F3D00.c index 6a815f4b23..2f60a3bca1 100644 --- a/src/overlay005/ov5_021F3D00.c +++ b/src/overlay005/ov5_021F3D00.c @@ -102,8 +102,8 @@ UnkStruct_ov101_021D5D90 *ov5_021F3D90(MapObject *param0, int param1) { FieldSystem *fieldSystem = ov5_021DF574(v3); - int v5 = MapObject_GetXPos(param0); - int v6 = MapObject_GetZPos(param0); + int v5 = MapObject_GetX(param0); + int v6 = MapObject_GetZ(param0); sub_02064450(v5, v6, &v0); sub_020644A4(fieldSystem, &v0); @@ -132,7 +132,7 @@ static int ov5_021F3E00(UnkStruct_ov101_021D5D90 *param0, void *param1) MapObject *v2 = v1->unk_0C; v0->unk_10 = *v1; - v0->unk_08 = MapObject_Id(v2); + v0->unk_08 = MapObject_GetLocalID(v2); v0->unk_0C = sub_02062918(v2); return 1; diff --git a/src/overlay005/ov5_021F3E74.c b/src/overlay005/ov5_021F3E74.c index ec40275777..955d8b18a7 100644 --- a/src/overlay005/ov5_021F3E74.c +++ b/src/overlay005/ov5_021F3E74.c @@ -95,8 +95,8 @@ void ov5_021F3F10(MapObject *param0) v0.unk_08 = ov5_021DF55C(v1, 27); v0.unk_0C = param0; - MapObject_PosVectorOut(param0, &v3); - sub_02064450(MapObject_GetXPos(param0), MapObject_GetZPos(param0), &v3); + MapObject_GetPosPtr(param0, &v3); + sub_02064450(MapObject_GetX(param0), MapObject_GetZ(param0), &v3); v4 = sub_02062758(param0, 2); v2 = ov5_021DF72C(v1, &Unk_ov5_0220069C, &v3, 0, &v0, v4); @@ -112,7 +112,7 @@ static int ov5_021F3F74(UnkStruct_ov101_021D5D90 *param0, void *param1) v2 = sub_020715BC(param0); v1->unk_10 = *v2; - v1->unk_04 = MapObject_Id(v1->unk_10.unk_0C); + v1->unk_04 = MapObject_GetLocalID(v1->unk_10.unk_0C); v1->unk_08 = sub_02062918(v1->unk_10.unk_0C); sub_020715E4(param0, &v0); diff --git a/src/overlay005/ov5_021F47B0.c b/src/overlay005/ov5_021F47B0.c index b391b032d6..2d8d44fd0b 100644 --- a/src/overlay005/ov5_021F47B0.c +++ b/src/overlay005/ov5_021F47B0.c @@ -139,7 +139,7 @@ static int ov5_021F487C(UnkStruct_ov101_021D5D90 *param0, void *param1) const UnkStruct_ov5_021F4840 *v1 = sub_020715BC(param0); v0->unk_24 = *v1; - v0->unk_00 = MapObject_Dir(v1->unk_0C); + v0->unk_00 = MapObject_GetFacingDir(v1->unk_0C); v0->unk_88 = ov5_021DF528(v1->unk_04, sizeof(UnkStruct_02073974), 0); sub_02073B70(&v0->unk_34, &v0->unk_24.unk_08->unk_04[0]); @@ -165,9 +165,9 @@ static void ov5_021F4908(UnkStruct_ov101_021D5D90 *param0, void *param1) const VecFx32 *v3; UnkStruct_021F487C *v4 = param1; const MapObject *v5 = v4->unk_24.unk_0C; - int v6 = MapObject_Dir(v5); + int v6 = MapObject_GetFacingDir(v5); - MapObject_PosVectorOut(v5, &v2); + MapObject_GetPosPtr(v5, &v2); v0 = ov5_021F4AB4(v5, v4->unk_24.unk_00, &v1); @@ -222,7 +222,7 @@ static void ov5_021F49D0(UnkStruct_ov101_021D5D90 *param0, UnkStruct_021F487C *p const MapObject *v1 = param1->unk_24.unk_0C; param1->unk_1C = Unk_ov5_0220077C[param1->unk_00]; - MapObject_PosVectorOut(param1->unk_24.unk_0C, &v0); + MapObject_GetPosPtr(param1->unk_24.unk_0C, &v0); v0.x += param1->unk_04.x; v0.y += param1->unk_04.y; @@ -263,12 +263,12 @@ static int ov5_021F4AB4(const MapObject *param0, int param1, VecFx32 *param2) GF_ASSERT(param1); - v4 = MapObject_GetXPos(param0); - v5 = MapObject_GetYPos(param0); - v6 = MapObject_GetZPos(param0); - v3 = MapObject_Dir(param0); + v4 = MapObject_GetX(param0); + v5 = MapObject_GetY(param0); + v6 = MapObject_GetZ(param0); + v3 = MapObject_GetFacingDir(param0); - MapObject_PosVectorOut(param0, &v1); + MapObject_GetPosPtr(param0, &v1); for (v2 = 0; v2 < param1; v2++) { v4 += MapObject_GetDxFromDir(v3); @@ -282,7 +282,7 @@ static int ov5_021F4AB4(const MapObject *param0, int param1, VecFx32 *param2) v7 = sub_0206326C(MapObject_MapObjectManager(param0), v4, v6, 1); GF_ASSERT(v7 != NULL); - MapObject_PosVectorOut(v7, param2); + MapObject_GetPosPtr(v7, param2); } else { sub_02064450(v4, v6, param2); } diff --git a/src/overlay005/ov5_021F50BC.c b/src/overlay005/ov5_021F50BC.c index 2942b637db..72593ab075 100644 --- a/src/overlay005/ov5_021F50BC.c +++ b/src/overlay005/ov5_021F50BC.c @@ -93,7 +93,7 @@ UnkStruct_ov101_021D5D90 *ov5_021F511C(MapObject *param0) v2.unk_04 = ov5_021DF55C(v3, 5); v2.unk_08 = param0; - MapObject_PosVectorOut(param0, &v4); + MapObject_GetPosPtr(param0, &v4); v0 = 0; v5 = ov5_021DF72C(v3, &Unk_ov5_02200A50, &v4, v0, &v2, 0xff); @@ -111,11 +111,11 @@ static int ov5_021F5158(UnkStruct_ov101_021D5D90 *param0, void *param1) v1 = sub_020715BC(param0); v0->unk_30 = *v1; - v0->unk_08 = MapObject_Id(v0->unk_30.unk_08); + v0->unk_08 = MapObject_GetLocalID(v0->unk_30.unk_08); v0->unk_0C = sub_02062918(v0->unk_30.unk_08); v0->unk_24.y = (FX32_ONE * 6); - MapObject_PosVectorOut(v0->unk_30.unk_08, &v2); + MapObject_GetPosPtr(v0->unk_30.unk_08, &v2); sub_020715D4(param0, &v2); return 1; @@ -139,7 +139,7 @@ static void ov5_021F51A4(UnkStruct_ov101_021D5D90 *param0, void *param1) switch (v0->unk_00) { case 0: - MapObject_PosVectorOut(v1, &v2); + MapObject_GetPosPtr(v1, &v2); v2.z += (FX32_ONE * -10); sub_020715D4(param0, &v2); break; diff --git a/src/overlay005/ov5_021F5284.c b/src/overlay005/ov5_021F5284.c index 4d674099fe..8120f0f034 100644 --- a/src/overlay005/ov5_021F5284.c +++ b/src/overlay005/ov5_021F5284.c @@ -95,7 +95,7 @@ UnkStruct_ov101_021D5D90 *ov5_021F52E4(MapObject *param0) v2.unk_04 = ov5_021DF55C(v3, 6); v2.unk_08 = param0; - MapObject_PosVectorOut(param0, &v4); + MapObject_GetPosPtr(param0, &v4); v0 = 0; v5 = ov5_021DF72C(v3, &Unk_ov5_02200A94, &v4, v0, &v2, 0xff); @@ -113,11 +113,11 @@ static int ov5_021F5320(UnkStruct_ov101_021D5D90 *param0, void *param1) v1 = sub_020715BC(param0); v0->unk_30 = *v1; - v0->unk_08 = MapObject_Id(v0->unk_30.unk_08); + v0->unk_08 = MapObject_GetLocalID(v0->unk_30.unk_08); v0->unk_0C = sub_02062918(v0->unk_30.unk_08); v0->unk_24.y = (FX32_ONE * 6); - MapObject_PosVectorOut(v0->unk_30.unk_08, &v2); + MapObject_GetPosPtr(v0->unk_30.unk_08, &v2); sub_020715D4(param0, &v2); return 1; @@ -139,7 +139,7 @@ static void ov5_021F536C(UnkStruct_ov101_021D5D90 *param0, void *param1) GF_ASSERT(sub_02062764(v1, v0->unk_08, v0->unk_0C) != 0); - MapObject_PosVectorOut(v1, &v2); + MapObject_GetPosPtr(v1, &v2); v2.z += (FX32_ONE * -10); sub_020715D4(param0, &v2); } diff --git a/src/overlay005/ov5_021F5428.c b/src/overlay005/ov5_021F5428.c index dbe0f22a93..ab4faadf17 100644 --- a/src/overlay005/ov5_021F5428.c +++ b/src/overlay005/ov5_021F5428.c @@ -95,7 +95,7 @@ UnkStruct_ov101_021D5D90 *ov5_021F5488(MapObject *param0) v2.unk_04 = ov5_021DF55C(v3, 7); v2.unk_08 = param0; - MapObject_PosVectorOut(param0, &v4); + MapObject_GetPosPtr(param0, &v4); v0 = 0; v5 = ov5_021DF72C(v3, &Unk_ov5_02200AD8, &v4, v0, &v2, 0xff); @@ -113,11 +113,11 @@ static int ov5_021F54C4(UnkStruct_ov101_021D5D90 *param0, void *param1) v1 = sub_020715BC(param0); v0->unk_34 = *v1; - v0->unk_08 = MapObject_Id(v0->unk_34.unk_08); + v0->unk_08 = MapObject_GetLocalID(v0->unk_34.unk_08); v0->unk_0C = sub_02062918(v0->unk_34.unk_08); v0->unk_24.y = (FX32_ONE * 6); - MapObject_PosVectorOut(v0->unk_34.unk_08, &v2); + MapObject_GetPosPtr(v0->unk_34.unk_08, &v2); sub_020715D4(param0, &v2); v0->unk_30 = 60; @@ -146,7 +146,7 @@ static void ov5_021F5514(UnkStruct_ov101_021D5D90 *param0, void *param1) } v1 = v0->unk_34.unk_08; - MapObject_PosVectorOut(v1, &v2); + MapObject_GetPosPtr(v1, &v2); v2.z += (FX32_ONE * -10); sub_020715D4(param0, &v2); diff --git a/src/overlay005/ov5_021F5894.c b/src/overlay005/ov5_021F5894.c index a950ab3ab1..2a44f4211b 100644 --- a/src/overlay005/ov5_021F5894.c +++ b/src/overlay005/ov5_021F5894.c @@ -79,9 +79,9 @@ void ov5_021F58FC(MapObject *param0, int param1, int param2, int param3) v3.unk_00 = ov5_021DF578(param0); v3.unk_04 = ov5_021DF55C(v3.unk_00, 10); - MapObject_PosVectorOut(param0, &v4); + MapObject_GetPosPtr(param0, &v4); - v2 = MapObject_Dir(param0); + v2 = MapObject_GetFacingDir(param0); switch (v2) { case 0: diff --git a/src/overlay005/ov5_021F5A10.c b/src/overlay005/ov5_021F5A10.c index 7620ff6453..c3616af168 100644 --- a/src/overlay005/ov5_021F5A10.c +++ b/src/overlay005/ov5_021F5A10.c @@ -370,7 +370,7 @@ UnkStruct_ov101_021D5D90 *ov5_021F5D8C(MapObject *param0, int param1, int param2 v1.unk_08 = ov5_021DF55C(v2, 20); v1.unk_0C = param0; - MapObject_PosVectorOut(param0, &v3); + MapObject_GetPosPtr(param0, &v3); v0 = sub_02062C0C(param0) + 1; if (param3 == 1) { @@ -393,7 +393,7 @@ static int ov5_021F5DE4(UnkStruct_ov101_021D5D90 *param0, void *param1) v2 = sub_020715BC(param0); v1->unk_30 = *v2; - v1->unk_08 = MapObject_Id(v1->unk_30.unk_0C); + v1->unk_08 = MapObject_GetLocalID(v1->unk_30.unk_0C); v1->unk_0C = sub_02062918(v1->unk_30.unk_0C); v1->unk_24.y = (FX32_ONE * 6); @@ -462,7 +462,7 @@ static int ov5_021F5EE0(UnkStruct_ov101_021D5D90 *param0, void *param1) v2 = sub_020715BC(param0); v1->unk_30 = *v2; - v1->unk_08 = MapObject_Id(v1->unk_30.unk_0C); + v1->unk_08 = MapObject_GetLocalID(v1->unk_30.unk_0C); v1->unk_0C = sub_02062918(v1->unk_30.unk_0C); v1->unk_24.y = (FX32_ONE * 6); v1->unk_10 = 1; diff --git a/src/overlay005/ov5_021F600C.c b/src/overlay005/ov5_021F600C.c index 82235535e7..463664e3f9 100644 --- a/src/overlay005/ov5_021F600C.c +++ b/src/overlay005/ov5_021F600C.c @@ -109,7 +109,7 @@ static int ov5_021F60E4(UnkStruct_ov101_021D5D90 *param0, void *param1) v2 = sub_020715BC(param0); v1->unk_10 = *v2; - v1->unk_04 = MapObject_Id(v1->unk_10.unk_0C); + v1->unk_04 = MapObject_GetLocalID(v1->unk_10.unk_0C); v1->unk_08 = sub_02062918(v1->unk_10.unk_0C); sub_020715D4(param0, &v0); @@ -154,7 +154,7 @@ static void ov5_021F615C(UnkStruct_ov101_021D5D90 *param0, void *param1) return; } - MapObject_PosVectorOut(v3, &v0); + MapObject_GetPosPtr(v3, &v0); sub_02063078(v3, &v1); v0.x += v1.x; diff --git a/src/overlay005/ov5_021F61BC.c b/src/overlay005/ov5_021F61BC.c index 92393b2ce4..dc6f55e21b 100644 --- a/src/overlay005/ov5_021F61BC.c +++ b/src/overlay005/ov5_021F61BC.c @@ -115,7 +115,7 @@ static int ov5_021F6264(UnkStruct_ov101_021D5D90 *param0, void *param1) v1 = Player_MapObject(v2->playerAvatar); v0->unk_04 = -1; - v0->unk_14 = MapObject_Id(v1); + v0->unk_14 = MapObject_GetLocalID(v1); v0->unk_18 = sub_02062918(v1); return 1; @@ -158,11 +158,11 @@ static void ov5_021F62A0(UnkStruct_ov101_021D5D90 *param0, void *param1) { VecFx32 v4, v5; - int v6 = MapObject_GetXPos(v3) + MapObject_GetDxFromDir(v1->unk_04); - int v7 = MapObject_GetZPos(v3) + MapObject_GetDyFromDir(v1->unk_04); + int v6 = MapObject_GetX(v3) + MapObject_GetDxFromDir(v1->unk_04); + int v7 = MapObject_GetZ(v3) + MapObject_GetDyFromDir(v1->unk_04); sub_02064450(v6, v7, &v5); - MapObject_PosVectorOut(v3, &v4); + MapObject_GetPosPtr(v3, &v4); v5.y = v4.y; sub_020715D4(param0, &v5); } diff --git a/src/overlay005/ov5_021F6454.c b/src/overlay005/ov5_021F6454.c index e13f8b97e7..048e945ae7 100644 --- a/src/overlay005/ov5_021F6454.c +++ b/src/overlay005/ov5_021F6454.c @@ -985,23 +985,23 @@ BOOL ScrCmd_32D(ScriptContext *ctx) MapObject *v6 = Player_MapObject(fieldSystem->playerAvatar); MapObject *v7; - MapObject_PosVectorOut(v6, &v1); + MapObject_GetPosPtr(v6, &v1); v0 = v1.y; - while (sub_020625B0(mapObjMan, &v7, &v3, (1 << 0)) == 1) { + while (sub_020625B0(mapObjMan, &v7, &v3, MAP_OBJ_STATUS_0) == 1) { if (v7 != v6) { - MapObject_SetStatusFlagOn(v7, (1 << 13)); + MapObject_SetStatusFlagOn(v7, MAP_OBJ_STATUS_13); - if (MapObject_GetStateFlag(v7, (1 << 12)) == 1) { - MapObject_PosVectorOut(v7, &v1); + if (MapObject_CheckStatusFlag(v7, MAP_OBJ_STATUS_12) == 1) { + MapObject_GetPosPtr(v7, &v1); v1.y = v0; - MapObject_SetPosVec(v7, &v1); + MapObject_SetPos(v7, &v1); MapObject_SetY(v7, (((v0) >> 3) / FX32_ONE)); } v2 = ov5_021EB1A0(v7); - if ((v2 == NULL) && sub_020677F4(sub_02062920(v7))) { + if ((v2 == NULL) && sub_020677F4(MapObject_GetGraphicsID(v7))) { if (sub_02062D4C(v7)) { sub_02062B68(v7); v2 = sub_02067A58(v7); @@ -1026,9 +1026,9 @@ BOOL ScrCmd_32E(ScriptContext *ctx) MapObject *v3 = Player_MapObject(fieldSystem->playerAvatar); MapObject *v4; - while (sub_020625B0(mapObjMan, &v4, &v0, (1 << 0)) == 1) { + while (sub_020625B0(mapObjMan, &v4, &v0, MAP_OBJ_STATUS_0) == 1) { if (v4 != v3) { - MapObject_SetStatusFlagOff(v4, (1 << 13)); + MapObject_SetStatusFlagOff(v4, MAP_OBJ_STATUS_13); } } @@ -1040,12 +1040,12 @@ static void ov5_021F7654(MapObject *param0, int param1) VecFx32 v0; UnkStruct_020216E0 *v1; - MapObject_SetStatusFlagOn(param0, (1 << 13)); - MapObject_PosVectorOut(param0, &v0); + MapObject_SetStatusFlagOn(param0, MAP_OBJ_STATUS_13); + MapObject_GetPosPtr(param0, &v0); v0.y = (((param1) << 4) * FX32_ONE); - MapObject_SetPosVec(param0, &v0); + MapObject_SetPos(param0, &v0); MapObject_SetY(param0, ((param1) * 2)); v1 = ov5_021EB1A0(param0); @@ -1085,13 +1085,13 @@ BOOL ScrCmd_332(ScriptContext *ctx) v0 = MapObjMan_LocalMapObjByIndex(v1, 32); if (v0 != NULL) { - MapObject_SetStatusFlagOff(v0, (1 << 13)); + MapObject_SetStatusFlagOff(v0, MAP_OBJ_STATUS_13); } v0 = MapObjMan_LocalMapObjByIndex(v1, 2); if (v0 != NULL) { - MapObject_SetStatusFlagOff(v0, (1 << 13)); + MapObject_SetStatusFlagOff(v0, MAP_OBJ_STATUS_13); } return 0; @@ -1102,7 +1102,7 @@ BOOL ScrCmd_338(ScriptContext *ctx) int v0; MapObject *v1 = MapObjMan_LocalMapObjByIndex(ctx->fieldSystem->mapObjMan, 15); if (v1 != NULL) { - switch (MapObject_GetXPos(v1)) { + switch (MapObject_GetX(v1)) { case 28: v0 = 6; break; diff --git a/src/overlay005/ov5_021F8560.c b/src/overlay005/ov5_021F8560.c index 83e97f58f8..d1ac6d17ae 100644 --- a/src/overlay005/ov5_021F8560.c +++ b/src/overlay005/ov5_021F8560.c @@ -119,7 +119,7 @@ UnkStruct_ov101_021D5D90 *ov5_021F85BC(PlayerAvatar *playerAvatar, int param1, i v3.z = (((param3) << 4) * FX32_ONE) + v2->z; } else { v2 = &Unk_ov5_02201C10[param6]; - MapObject_PosVectorOut(v5, &v3); + MapObject_GetPosPtr(v5, &v3); sub_020630AC(v5, v2); } @@ -170,7 +170,7 @@ static void ov5_021F86E4(UnkStruct_ov101_021D5D90 *param0, void *param1) return; } - v0->unk_04 = MapObject_GetMoveDir(v1); + v0->unk_04 = MapObject_GetMovingDir(v1); v0->unk_34 = PlayerAvatar_MapDistortionState(playerAvatar); GF_ASSERT(v0->unk_04 != -1); @@ -209,7 +209,7 @@ static void ov5_021F86E4(UnkStruct_ov101_021D5D90 *param0, void *param1) } sub_020630AC(v1, &v3); - MapObject_PosVectorOut(v1, &v3); + MapObject_GetPosPtr(v1, &v3); { const VecFx32 *v4; diff --git a/src/overlay005/vs_seeker.c b/src/overlay005/vs_seeker.c index e51d05b154..0606370a78 100644 --- a/src/overlay005/vs_seeker.c +++ b/src/overlay005/vs_seeker.c @@ -530,9 +530,7 @@ static void VsSeekerSystem_CollectViableNpcs(VsSeekerSystem *vsSeeker) continue; } - u32 eventType = MapObject_GetEventType(mapObj); - - switch (eventType) { + switch (MapObject_GetTrainerType(mapObj)) { case 0x1: case 0x2: case 0x4: @@ -540,12 +538,12 @@ static void VsSeekerSystem_CollectViableNpcs(VsSeekerSystem *vsSeeker) case 0x6: case 0x7: case 0x8: - trainerX = MapObject_GetXPos(mapObj); - trainerZ = MapObject_GetZPos(mapObj); + trainerX = MapObject_GetX(mapObj); + trainerZ = MapObject_GetZ(mapObj); if (trainerX >= xMin && trainerX <= xMax && trainerZ >= zMin && trainerZ <= zMax - && VsSeeker_IsMoveCodeHidden(MapObject_GetMoveCode(mapObj)) == FALSE) { + && VsSeeker_IsMoveCodeHidden(MapObject_GetMovementType(mapObj)) == FALSE) { vsSeeker->trainers[numVisibleTrainers] = mapObj; numVisibleTrainers++; } @@ -607,7 +605,7 @@ static void VsSeeker_ClearRematchMoveCode(FieldSystem *fieldSystem) continue; } - if (MapObject_GetMoveCode(mapObj) == 0x31) { + if (MapObject_GetMovementType(mapObj) == 0x31) { VsSeeker_SetTrainerMoveCode(mapObj, 0x2); } } @@ -691,8 +689,7 @@ static BOOL VsSeekerSystem_PickRematchTrainers(VsSeekerSystem *vsSeeker) static u16 VsSeeker_GetTrainerIDFromMapObject(MapObject *trainerObj) { - u32 eventID = MapObject_GetEventID(trainerObj); - return Script_GetTrainerID(eventID); + return Script_GetTrainerID(MapObject_GetScript(trainerObj)); } u16 VsSeeker_GetRematchTrainerID(FieldSystem *fieldSystem, MapObject *trainerObj, u16 trainerID) @@ -775,7 +772,7 @@ static u16 VsSeeker_GetTrainerIDForRematchLevel(u16 rematchDataIndex, u16 level) static BOOL VsSeeker_IsTrainerDoingRematchAnimation(MapObject *trainerObj) { - return MapObject_GetMoveCode(trainerObj) == 0x31; + return MapObject_GetMovementType(trainerObj) == 0x31; } static void VsSeeker_SetTrainerMoveCode(MapObject *trainerObj, u16 moveCode) @@ -789,7 +786,7 @@ void VsSeeker_SetMoveCodeForFacingDirection(FieldSystem *fieldSystem, MapObject return; } - int dir = MapObject_Dir(trainerObj); + int dir = MapObject_GetFacingDir(trainerObj); u32 moveCode; if (dir == 0) { @@ -835,10 +832,10 @@ static BOOL VsSeeker_WaitForNpcsToPause(FieldSystem *fieldSystem) static MapObject *VsSeeker_GetSecondDoubleBattleTrainer(FieldSystem *fieldSystem, MapObject *trainerObj, enum VsSeeker2v2TrainerSearchMode mode) { - u32 secondTrainerEventID, secondTrainerID; + u32 secondScriptID, secondTrainerID; u32 objEventCount = MapHeaderData_GetNumObjectEvents(fieldSystem); - u16 eventID = MapObject_GetEventID(trainerObj); - u16 trainerID = Script_GetTrainerID(eventID); + u16 scriptID = MapObject_GetScript(trainerObj); + u16 trainerID = Script_GetTrainerID(scriptID); if (Script_IsTrainerDoubleBattle(trainerID) == FALSE) { return NULL; @@ -852,13 +849,11 @@ static MapObject *VsSeeker_GetSecondDoubleBattleTrainer(FieldSystem *fieldSystem } if (mode == VS_SEEKER_2V2_TRAINER_SEARCH_MODE_REMATCH_ANIM_CHECK - && MapObject_GetMoveCode(mapObj) == 0x31) { + && MapObject_GetMovementType(mapObj) == 0x31) { continue; } - u32 eventType = MapObject_GetEventType(mapObj); - - switch (eventType) { + switch (MapObject_GetTrainerType(mapObj)) { case 0x1: case 0x2: case 0x4: @@ -866,10 +861,10 @@ static MapObject *VsSeeker_GetSecondDoubleBattleTrainer(FieldSystem *fieldSystem case 0x6: case 0x7: case 0x8: - secondTrainerEventID = MapObject_GetEventID(mapObj); - secondTrainerID = Script_GetTrainerID(secondTrainerEventID); + secondScriptID = MapObject_GetScript(mapObj); + secondTrainerID = Script_GetTrainerID(secondScriptID); - if (eventID != secondTrainerEventID && trainerID == secondTrainerID) { + if (scriptID != secondScriptID && trainerID == secondTrainerID) { return mapObj; } } diff --git a/src/overlay006/ov6_0223E140.c b/src/overlay006/ov6_0223E140.c index 7fd55c26fb..eda9daecac 100644 --- a/src/overlay006/ov6_0223E140.c +++ b/src/overlay006/ov6_0223E140.c @@ -492,9 +492,9 @@ static void ov6_0223E318(FieldSystem *fieldSystem, u32 param1, BOOL param2) v0 = MapObjMan_LocalMapObjByIndex(fieldSystem->mapObjMan, param1); if (param2 == 1) { - MapObject_SetStatusFlagOn(v0, (1 << 20)); + MapObject_SetStatusFlagOn(v0, MAP_OBJ_STATUS_HIDE_SHADOW); } else { - MapObject_SetStatusFlagOff(v0, (1 << 20)); + MapObject_SetStatusFlagOff(v0, MAP_OBJ_STATUS_HIDE_SHADOW); } } @@ -829,9 +829,9 @@ static void ov6_0223E7B4(UnkStruct_ov5_021D1BEC *param0, FieldSystem *fieldSyste v1 = MapObjMan_LocalMapObjByIndex(fieldSystem->mapObjMan, 0); GF_ASSERT(v1); - v2 = MapObject_GetXPos(v1); + v2 = MapObject_GetX(v1); v3 = 0; - v4 = MapObject_GetZPos(v1); + v4 = MapObject_GetZ(v1); v0->unk_00 = ov6_02240768(4); ov6_0224077C(v0->unk_00, v2, v3, v4); @@ -1261,7 +1261,7 @@ static BOOL ov6_0223EE5C(UnkStruct_ov6_0223EA98 *param0) break; case 8: param0->unk_D0 = 0; - sub_0206296C(param0->unk_10C, 2); + MapObject_Face(param0->unk_10C, 2); LocalMapObj_SetAnimationCode(param0->unk_110, 0x2); Easy3DObject_GetPosition(¶m0->unk_24, &v1, &v2, ¶m0->unk_D8); param0->unk_18++; @@ -1424,17 +1424,17 @@ static BOOL ov6_0223EE5C(UnkStruct_ov6_0223EA98 *param0) if (param0->unk_1C != 0) { if (param0->unk_1C == 20) { - sub_0206296C(param0->unk_10C, 1); + MapObject_Face(param0->unk_10C, 1); LocalMapObj_SetAnimationCode(param0->unk_110, 0x1); } if (param0->unk_1C == 40) { - sub_0206296C(param0->unk_10C, 2); + MapObject_Face(param0->unk_10C, 2); LocalMapObj_SetAnimationCode(param0->unk_110, 0x3); } if (param0->unk_1C == 50) { - sub_0206296C(param0->unk_10C, 0); + MapObject_Face(param0->unk_10C, 0); LocalMapObj_SetAnimationCode(param0->unk_110, 0x0); } @@ -2084,10 +2084,10 @@ void ov6_022401D0(UnkStruct_ov6_022401B8 *param0, u32 param1) VecFx32 v0; ov6_02240240(¶m0->unk_08, param0->fieldSystem, 1); - MapObject_PosVectorOut(param0->unk_08.unk_00, &v0); + MapObject_GetPosPtr(param0->unk_08.unk_00, &v0); ov6_022402E4(¶m0->unk_34, v0.x, v0.y, v0.z); ov6_02240240(¶m0->unk_08, param0->fieldSystem, param1); - MapObject_PosVectorOut(param0->unk_08.unk_00, &v0); + MapObject_GetPosPtr(param0->unk_08.unk_00, &v0); param0->unk_00 = 1; } @@ -2811,7 +2811,7 @@ void ov6_02240C44(UnkStruct_ov6_02240C44 *param0, u32 param1) v1 = MapObjMan_LocalMapObjByIndex(param0->fieldSystem->mapObjMan, param1); - MapObject_PosVectorOut(v1, &v0); + MapObject_GetPosPtr(v1, &v0); ov6_0223FDCC(¶m0->unk_00, v0.x, v0.y, v0.z); ov6_0223FDC4(¶m0->unk_00, 1); diff --git a/src/overlay006/ov6_02248050.c b/src/overlay006/ov6_02248050.c index 9d53416771..bedb8f4829 100644 --- a/src/overlay006/ov6_02248050.c +++ b/src/overlay006/ov6_02248050.c @@ -74,11 +74,11 @@ static void ov6_02248050(MapObjectManager *param0, u32 param1, Easy3DObject *par v4 = MapObjMan_LocalMapObjByIndex(param0, param1); - MapObject_PosVectorOut(v4, &v3); + MapObject_GetPosPtr(v4, &v3); - v1 = MapObject_GetXPos(v4); - v2 = MapObject_GetZPos(v4); - v0 = MapObject_Dir(v4); + v1 = MapObject_GetX(v4); + v2 = MapObject_GetZ(v4); + v0 = MapObject_GetFacingDir(v4); switch (v0) { case 0: diff --git a/src/overlay008/ov8_02249960.c b/src/overlay008/ov8_02249960.c index f42560b060..5d17bdcc99 100644 --- a/src/overlay008/ov8_02249960.c +++ b/src/overlay008/ov8_02249960.c @@ -2566,7 +2566,7 @@ static void ov8_0224B18C(FieldSystem *fieldSystem, UnkStruct_ov8_0224B28C *param sub_02062D80(param1->unk_20, 0); sub_02062E28(param1->unk_20, 1); - v4 = MapObject_PosVector(param1->unk_20); + v4 = MapObject_GetPos(param1->unk_20); ov5_021E931C(v4, fieldSystem->unk_28); Camera_TrackTarget(v4, fieldSystem->camera); @@ -2644,8 +2644,8 @@ static BOOL ov8_0224B2E8(UnkStruct_ov8_0224B28C *param0) if (LocalMapObj_IsAnimationSet(param0->unk_20) == 1) { int v1 = 0x9a; - int v2 = MapObject_GetXPos(v0); - int v3 = MapObject_GetZPos(v0); + int v2 = MapObject_GetX(v0); + int v3 = MapObject_GetZ(v0); if ((v2 == param0->unk_08) && (v3 == param0->unk_0C)) { return 1; @@ -3015,8 +3015,8 @@ static MapObject *ov8_0224B7D8(FieldSystem *fieldSystem, int param1, int param2, v0 = MapObjectMan_AddMapObject(fieldSystem->mapObjMan, param1, param2, 0, 0x2000, 0x0, fieldSystem->location->mapId); - MapObject_SetId(v0, 0xfd); - sub_020629B4(v0, param3, 0); + MapObject_SetLocalID(v0, 0xfd); + MapObject_SetDataAt(v0, param3, 0); return v0; } @@ -3024,10 +3024,10 @@ static MapObject *ov8_0224B7D8(FieldSystem *fieldSystem, int param1, int param2, static void ov8_0224B80C(UnkStruct_ov8_0224B80C *param0, MapObject *param1, FieldSystem *fieldSystem) { param0->unk_08 = param1; - param0->unk_00 = MapObject_GetXPos(param1); - param0->unk_04 = MapObject_GetZPos(param1); + param0->unk_00 = MapObject_GetX(param1); + param0->unk_04 = MapObject_GetZ(param1); - if (sub_020629D8(param1, 0) == 0) { + if (MapObject_GetDataAt(param1, 0) == 0) { param0->unk_0C = ov5_021F4474(fieldSystem, param0->unk_00, param0->unk_04, 0); } else { param0->unk_0C = ov5_021F4668(fieldSystem, param0->unk_00, param0->unk_04, 0); @@ -3117,8 +3117,8 @@ static void ov8_0224B958(UnkStruct_ov8_0224B8D0 *param0) UnkStruct_ov8_0224BCA8 *v6 = param0->unk_10C; while (sub_020625B0(mapObjMan, &v2, &v0, (1 << 0)) == 1) { - if (MapObject_Id(v2) == 0xfd) { - if (sub_020629D8(v2, 0) == 0) { + if (MapObject_GetLocalID(v2) == 0xfd) { + if (MapObject_GetDataAt(v2, 0) == 0) { ov8_0224B80C(&v5->unk_08, v2, fieldSystem); v5->unk_00 = 1; v5++; @@ -3589,7 +3589,7 @@ static void ov8_0224BFCC(FieldSystem *fieldSystem, UnkStruct_ov8_0224C098 *param sub_02062D80(v3->unk_30, 0); sub_02062E28(v3->unk_30, 1); - v2 = MapObject_PosVector(v3->unk_30); + v2 = MapObject_GetPos(v3->unk_30); ov5_021E931C(v2, fieldSystem->unk_28); Camera_TrackTarget(v2, fieldSystem->camera); @@ -3876,12 +3876,12 @@ static void ov8_0224C444(UnkStruct_ov8_0224C444 *param0) v3 = sub_02062858(mapObjMan) + 2; while (sub_020625B0(mapObjMan, &v5, &v0, (1 << 0))) { - v4 = MapObject_Id(v5); - v6->unk_08 = sub_020629D8(v5, 0); + v4 = MapObject_GetLocalID(v5); + v6->unk_08 = MapObject_GetDataAt(v5, 0); - if ((v4 == 0xff) || ((MapObject_GetEventType(v5) == 0x1) && v6->unk_08)) { + if ((v4 == 0xff) || ((MapObject_GetTrainerType(v5) == 0x1) && v6->unk_08)) { v6->unk_00 = 1; - v6->unk_04 = MapObject_Dir(v5); + v6->unk_04 = MapObject_GetFacingDir(v5); v6->unk_14 = v5; v6->unk_18 = param0; @@ -3939,14 +3939,14 @@ BOOL ov8_0224C51C(FieldSystem *fieldSystem) playerAvatar = fieldSystem->playerAvatar; v8 = Player_MapObject(playerAvatar); v2 = 2; - v1 = Direction_GetOpposite(MapObject_Dir(v8)); + v1 = Direction_GetOpposite(MapObject_GetFacingDir(v8)); while (sub_020625B0(mapObjMan, &v7, &v0, (1 << 0))) { if ((v7 != v8) && (sub_02067F88(fieldSystem, v7) == 1)) { v3 = sub_02067D58(v7, playerAvatar, v1, v2); if (v3 != -1) { - int v9 = MapObject_GetEventID(v7); + int v9 = MapObject_GetScript(v7); ScriptManager_Set(fieldSystem, 3928, v7); ScriptManager_SetApproachingTrainer(fieldSystem, v7, v3, v1, v9, Script_GetTrainerID(v9), 0, 0); @@ -3971,10 +3971,10 @@ BOOL ov8_0224C5DC(FieldSystem *fieldSystem, void *param1) { MapObject *v1 = param1; - MapObject_SetXInitial(v1, MapObject_GetXPos(v1)); - MapObject_SetZInitial(v1, MapObject_GetZPos(v1)); - sub_020629FC(v1, 2); - sub_02062A04(v1, 2); + MapObject_SetXInitial(v1, MapObject_GetX(v1)); + MapObject_SetZInitial(v1, MapObject_GetZ(v1)); + MapObject_SetMovementRangeX(v1, 2); + MapObject_SetMovementRangeZ(v1, 2); MapObject_SetMoveCode(v1, 0x3); return 1; diff --git a/src/overlay009/ov9_02249960.c b/src/overlay009/ov9_02249960.c index 0d27e45f3b..00225c0ea7 100644 --- a/src/overlay009/ov9_02249960.c +++ b/src/overlay009/ov9_02249960.c @@ -1760,7 +1760,7 @@ static void ov9_0224A228(UnkStruct_ov9_0224A228 *param0, UnkStruct_ov9_0224A294 sub_02021444(param2, ov9_0224A4C8, param1); if (param1->unk_18 != NULL) { - param1->unk_14 = sub_02062920(param1->unk_18); + param1->unk_14 = MapObject_GetGraphicsID(param1->unk_18); } } @@ -1800,12 +1800,12 @@ static int ov9_0224A2E4(UnkStruct_ov9_0224A294 *param0) return 1; } - if (MapObject_Id(param0->unk_18) != param0->unk_16) { + if (MapObject_GetLocalID(param0->unk_18) != param0->unk_16) { return 1; } if (param0->unk_10 != NULL) { - if (param0->unk_14 != sub_02062920(param0->unk_18)) { + if (param0->unk_14 != MapObject_GetGraphicsID(param0->unk_18)) { return 2; } } @@ -1843,7 +1843,7 @@ static void ov9_0224A374(UnkStruct_ov9_0224A294 *param0, MapObject *param1, int if (param1 != NULL) { param0->unk_18 = param1; - param0->unk_16 = MapObject_Id(param1); + param0->unk_16 = MapObject_GetLocalID(param1); } } @@ -2247,7 +2247,7 @@ static void ov9_0224A8C0(UnkStruct_ov9_02249B04 *param0) PlayerAvatar_SetDistortionState(playerAvatar, v0); v5 = 0x0; - v1 = sub_02062920(v8); + v1 = MapObject_GetGraphicsID(v8); switch (v1) { case 0x0: @@ -2390,7 +2390,7 @@ static BOOL ov9_0224AAD4(FieldTask *param0) v6 = sub_02065838(v5, 0x0); LocalMapObj_SetAnimationCode(v4, v6); - MapObject_SetDir(v4, v5); + MapObject_TryFace(v4, v5); ov9_0224A4D0(v1, v4, v2->unk_34.unk_1A, v2->unk_34.unk_1C); v2->unk_00++; @@ -2457,13 +2457,13 @@ static BOOL ov9_0224AC58(UnkStruct_ov9_0224AC58 *param0, MapObject *param1) { VecFx32 v1; - MapObject_PosVectorOut(param1, &v1); + MapObject_GetPosPtr(param1, &v1); v1.x += param0->unk_08.x; v1.y += param0->unk_08.y; v1.z += param0->unk_08.z; - MapObject_SetPosVec(param1, &v1); + MapObject_SetPos(param1, &v1); } { @@ -2474,7 +2474,7 @@ static BOOL ov9_0224AC58(UnkStruct_ov9_0224AC58 *param0, MapObject *param1) if (param0->unk_1C.x >= (16 * FX32_ONE)) { param0->unk_1C.x -= (16 * FX32_ONE); - v2 = MapObject_GetXPos(param1); + v2 = MapObject_GetX(param1); if (v0->unk_14 > 0) { v2++; @@ -2490,7 +2490,7 @@ static BOOL ov9_0224AC58(UnkStruct_ov9_0224AC58 *param0, MapObject *param1) if (param0->unk_1C.y >= (8 * FX32_ONE)) { param0->unk_1C.y -= (8 * FX32_ONE); - v2 = MapObject_GetYPos(param1); + v2 = MapObject_GetY(param1); if (v0->unk_16 > 0) { v2++; @@ -2506,7 +2506,7 @@ static BOOL ov9_0224AC58(UnkStruct_ov9_0224AC58 *param0, MapObject *param1) if (param0->unk_1C.z >= (16 * FX32_ONE)) { param0->unk_1C.z -= (16 * FX32_ONE); - v2 = MapObject_GetZPos(param1); + v2 = MapObject_GetZ(param1); if (v0->unk_18 > 0) { v2++; @@ -2554,7 +2554,7 @@ static BOOL ov9_0224AC58(UnkStruct_ov9_0224AC58 *param0, MapObject *param1) *v4 = 0; sub_02064208(param1); sub_02062B68(param1); - MapObject_SetDir(param1, v0->unk_22); + MapObject_TryFace(param1, v0->unk_22); sub_02062A0C(param1, 0x0); return 1; } @@ -3338,9 +3338,9 @@ static void ov9_0224BA6C(UnkStruct_ov101_021D5D90 *param0, void *param1) while (sub_020625B0( v8, &v9, &v6, (1 << 0)) == 1) { - if (MapObject_GetYPos(v9) == v7) { - if (MapObject_GetZPos(v9) == v2->unk_08.unk_0A) { - if (MapObject_GetXPos(v9) == v2->unk_08.unk_06) { + if (MapObject_GetY(v9) == v7) { + if (MapObject_GetZ(v9) == v2->unk_08.unk_0A) { + if (MapObject_GetX(v9) == v2->unk_08.unk_06) { v4 = 1; break; } @@ -4408,13 +4408,13 @@ static void ov9_0224C8E8(UnkStruct_ov9_02249B04 *param0) VecFx32 v12, v13; MapObject *v14 = Player_MapObject(fieldSystem->playerAvatar); - MapObject_PosVectorOut(v14, &v13); + MapObject_GetPosPtr(v14, &v13); ov5_021EA6BC(fieldSystem->unk_28, &v12); v13.y = v12.y + ((1 << 4) * FX32_ONE); - MapObject_SetPosVec(v14, &v13); - MapObject_SetYPosPrev(v14, MapObject_GetYPos(v14)); + MapObject_SetPos(v14, &v13); + MapObject_SetYPrev(v14, MapObject_GetY(v14)); MapObject_SetY(v14, (((v13.y) >> 3) / FX32_ONE)); } } @@ -4978,17 +4978,17 @@ static int ov9_0224D0C8(UnkStruct_ov9_02249B04 *param0, UnkStruct_ov9_0224D078 * v3 = ov9_0224DE70(param1->unk_02); v1 = Player_MapObject(param0->fieldSystem->playerAvatar); - MapObject_PosVectorOut(v1, ¶m1->unk_14); + MapObject_GetPosPtr(v1, ¶m1->unk_14); sub_02062E28(v1, 1); param1->unk_44.x = 0; param1->unk_44.y = 0; param1->unk_44.z = 0; - param1->unk_0A = MapObject_GetXPos(v1); + param1->unk_0A = MapObject_GetX(v1); param1->unk_0A += v3->unk_04; - param1->unk_0C = MapObject_GetYPos(v1); + param1->unk_0C = MapObject_GetY(v1); param1->unk_0C += ((v3->unk_06) * 2); - param1->unk_0E = MapObject_GetZPos(v1); + param1->unk_0E = MapObject_GetZ(v1); param1->unk_0E += v3->unk_08; param1->unk_2C.x = (((v3->unk_04) << 4) * FX32_ONE); param1->unk_2C.y = (((v3->unk_06) << 4) * FX32_ONE); @@ -5049,7 +5049,7 @@ static int ov9_0224D288(UnkStruct_ov9_02249B04 *param0, UnkStruct_ov9_0224D078 * v0.y = param1->unk_54 + param1->unk_5C; sub_020630AC(param1->unk_68, &v0); - MapObject_PosVectorOut(param1->unk_68, &v4); + MapObject_GetPosPtr(param1->unk_68, &v4); v4.y = param1->unk_14.y; ov9_022511F4(param1->unk_68, &v4); } @@ -5119,7 +5119,7 @@ static int ov9_0224D374(UnkStruct_ov9_02249B04 *param0, UnkStruct_ov9_0224D078 * if (param1->unk_68 != NULL) { VecFx32 v4; - MapObject_PosVectorOut(param1->unk_68, &v4); + MapObject_GetPosPtr(param1->unk_68, &v4); v4.y = param1->unk_14.y; ov9_022511F4(param1->unk_68, &v4); } @@ -5150,10 +5150,10 @@ static int ov9_0224D430(UnkStruct_ov9_02249B04 *param0, UnkStruct_ov9_0224D078 * if (param1->unk_68 != NULL) { if (param1->unk_06 == 574) { - MapObject_SetId(param1->unk_68, (0x80 + 0)); + MapObject_SetLocalID(param1->unk_68, (0x80 + 0)); } else { - MapObject_SetId(param1->unk_68, (0x80 + 0)); - sub_0206295C(param1->unk_68, 6); + MapObject_SetLocalID(param1->unk_68, (0x80 + 0)); + MapObject_SetScript(param1->unk_68, 6); } sub_02062914(param1->unk_68, param1->unk_06); @@ -5201,7 +5201,7 @@ static int ov9_0224D4C4(UnkStruct_ov9_02249B04 *param0, UnkStruct_ov9_0224D078 * if (param1->unk_68 != NULL) { VecFx32 v4; - MapObject_PosVectorOut(param1->unk_68, &v4); + MapObject_GetPosPtr(param1->unk_68, &v4); v4.y = param1->unk_14.y; ov9_022511F4(param1->unk_68, &v4); } @@ -5227,7 +5227,7 @@ static int ov9_0224D4C4(UnkStruct_ov9_02249B04 *param0, UnkStruct_ov9_0224D078 * UnkStruct_ov9_0224E0DC *v6 = param1->unk_64; v6->unk_04.unk_08 = param1->unk_08; - sub_020629B4(v6->unk_1C, v6->unk_04.unk_08, 2); + MapObject_SetDataAt(v6->unk_1C, v6->unk_04.unk_08, 2); } param1->unk_04 = 0; @@ -5311,7 +5311,7 @@ static int ov9_0224D69C(UnkStruct_ov9_02249B04 *param0, UnkStruct_ov9_0224D078 * v1 = MapObjMan_LocalMapObjByIndex(param0->fieldSystem->mapObjMan, (0x80 + 6)); GF_ASSERT(v1 != NULL); - v0 = MapObject_GetXPos(v1); + v0 = MapObject_GetX(v1); GF_ASSERT((u32)(v0 - 88) < 3); v2 = Unk_ov9_02251384[v0 - 88]; @@ -5697,7 +5697,7 @@ static void ov9_0224DCA8(UnkStruct_ov9_02249B04 *param0) MapObjectManager *v3 = param0->fieldSystem->mapObjMan; while (sub_020625B0(v3, &v2, &v0, (1 << 0)) == 1) { - if (MapObject_Id(v2) == 0xfd) { + if (MapObject_GetLocalID(v2) == 0xfd) { v1 = ov9_0224DDDC(param0); ov9_0224DF10(param0, v1, v2); } @@ -5843,10 +5843,10 @@ static MapObject *ov9_0224DE94(UnkStruct_ov9_02249B04 *param0, int param1, int p v0 = MapObjectMan_AddMapObject(param0->fieldSystem->mapObjMan, param1, param3, 0, 0x2000, 0x0, ov9_022510D0(param0)); MapObject_SetY(v0, param2); - MapObject_SetId(v0, 0xfd); - sub_020629B4(v0, param4, 0); - sub_020629B4(v0, param6, 1); - sub_020629B4(v0, param5, 2); + MapObject_SetLocalID(v0, 0xfd); + MapObject_SetDataAt(v0, param4, 0); + MapObject_SetDataAt(v0, param6, 1); + MapObject_SetDataAt(v0, param5, 2); sub_02062E5C(v0, 1); sub_02062D80(v0, 0); sub_02062E28(v0, 1); @@ -5860,17 +5860,17 @@ static void ov9_0224DF10(UnkStruct_ov9_02249B04 *param0, UnkStruct_ov9_0224E0DC u32 v0, v1, v2, v3; const UnkStruct_ov9_0224DF10 *v4; - v0 = sub_020629D8(param2, 0); - v1 = sub_020629D8(param2, 1); - v3 = sub_020629D8(param2, 2); + v0 = MapObject_GetDataAt(param2, 0); + v1 = MapObject_GetDataAt(param2, 1); + v3 = MapObject_GetDataAt(param2, 2); v4 = ov9_0224DE60(v1, v0); param1->unk_00 = 1; param1->unk_02 = v1; param1->unk_04 = *v4; - param1->unk_04.unk_02 = MapObject_GetXPos(param2); - param1->unk_04.unk_04 = MapObject_GetYPos(param2); - param1->unk_04.unk_06 = MapObject_GetZPos(param2); + param1->unk_04.unk_02 = MapObject_GetX(param2); + param1->unk_04.unk_04 = MapObject_GetY(param2); + param1->unk_04.unk_06 = MapObject_GetZ(param2); param1->unk_04.unk_08 = v3; param1->unk_1C = param2; param1->unk_20 = ov9_0224DFA0(param0, param1); @@ -5945,9 +5945,9 @@ static void ov9_0224E07C(UnkStruct_ov9_02249B04 *param0, UnkStruct_ov9_0224E0DC MapObject_SetX(v1, param1->unk_04.unk_02); MapObject_SetY(v1, param1->unk_04.unk_04); MapObject_SetZ(v1, param1->unk_04.unk_06); - sub_020629B4(v1, param1->unk_04.unk_00, 0); - sub_020629B4(v1, param2, 1); - sub_020629B4(v1, param1->unk_04.unk_08, 2); + MapObject_SetDataAt(v1, param1->unk_04.unk_00, 0); + MapObject_SetDataAt(v1, param2, 1); + MapObject_SetDataAt(v1, param1->unk_04.unk_08, 2); } } @@ -6398,7 +6398,7 @@ static int ov9_0224E5EC(UnkStruct_ov9_02249B04 *param0, FieldTask *param1, u16 * v4.y = v2->unk_28 + v2->unk_30; sub_020630AC(v0, &v4); - MapObject_PosVectorOut(v0, &v4); + MapObject_GetPosPtr(v0, &v4); ov9_022511F4(v0, &v4); } @@ -6425,7 +6425,7 @@ static int ov9_0224E5EC(UnkStruct_ov9_02249B04 *param0, FieldTask *param1, u16 * v5.y = v2->unk_28; sub_020630AC(v0, &v5); - MapObject_PosVectorOut(v0, &v5); + MapObject_GetPosPtr(v0, &v5); ov9_022511F4(v0, &v5); } @@ -6474,7 +6474,7 @@ static int ov9_0224E6B0(UnkStruct_ov9_02249B04 *param0, FieldTask *param1, u16 * VecFx32 v4; MapObject *v5 = Player_MapObject(param0->fieldSystem->playerAvatar); - MapObject_PosVectorOut(v5, &v4); + MapObject_GetPosPtr(v5, &v4); v4.x += v0.x; v4.y += v0.y; @@ -6496,9 +6496,9 @@ static int ov9_0224E798(UnkStruct_ov9_02249B04 *param0, FieldTask *param1, u16 * if (v0->unk_02 == 1) { MapObject *v1 = Player_MapObject(param0->fieldSystem->playerAvatar); - int v2 = MapObject_GetXPos(v1) + v0->unk_06; - int v3 = MapObject_GetYPos(v1) + ((v0->unk_08) * 2); - int v4 = MapObject_GetZPos(v1) + v0->unk_0A; + int v2 = MapObject_GetX(v1) + v0->unk_06; + int v3 = MapObject_GetY(v1) + ((v0->unk_08) * 2); + int v4 = MapObject_GetZ(v1) + v0->unk_0A; MapObject_SetX(v1, v2); MapObject_SetY(v1, v3); @@ -7129,8 +7129,8 @@ static MapObject *ov9_0224EECC(UnkStruct_ov9_02249B04 *param0, const ObjectEvent while (sub_020625B0(v2, &v1, &v0, (1 << 0))) { if (sub_02062918(v1) == param2) { - if (MapObject_Id(v1) == param1->localID) { - GF_ASSERT(param1->graphicsID == sub_02062920(v1)); + if (MapObject_GetLocalID(v1) == param1->localID) { + GF_ASSERT(param1->graphicsID == MapObject_GetGraphicsID(v1)); return v1; } } @@ -7186,7 +7186,7 @@ static BOOL ov9_0224EF64(UnkStruct_ov9_02249B04 *param0, MapObject **param1, con sub_02062FC4(*param1, 1); sub_02062E5C(*param1, 1); sub_02062E28(*param1, 1); - MapObject_SetStatusFlagOn(*param1, (1 << 13)); + MapObject_SetStatusFlagOn(*param1, MAP_OBJ_STATUS_13); if (v0 == NULL) { UnkStruct_020216E0 *v1; @@ -7306,7 +7306,7 @@ void ov9_0224F16C(FieldSystem *fieldSystem, u16 param1) while (sub_020625B0( v3, &v1, &v0, (1 << 0)) == 1) { - if ((MapObject_Id(v1) == param1) && (sub_02062918(v1) == v2)) { + if ((MapObject_GetLocalID(v1) == param1) && (sub_02062918(v1) == v2)) { ov9_0224EE70(v4, v1); return; } @@ -7377,8 +7377,8 @@ BOOL ov9_0224F240(const MapObject *param0, int param1) fieldSystem = MapObject_FieldSystem(param0); v3 = fieldSystem->location->mapId; - v0 = MapObject_GetXPos(param0); - v1 = MapObject_GetZPos(param0); + v0 = MapObject_GetX(param0); + v1 = MapObject_GetZ(param0); v0 += MapObject_GetDxFromDir(param1); v1 += MapObject_GetDyFromDir(param1); @@ -7393,8 +7393,8 @@ static BOOL ov9_0224F284(const MapObject *param0, u32 *param1) fieldSystem = MapObject_FieldSystem(param0); v2 = fieldSystem->location->mapId; - v0 = MapObject_GetXPos(param0); - v1 = MapObject_GetZPos(param0); + v0 = MapObject_GetX(param0); + v1 = MapObject_GetZ(param0); return ov9_0224F1F8(v2, v0, v1, param1); } @@ -7445,9 +7445,9 @@ static BOOL ov9_0224F324(UnkStruct_ov9_0224F6EC *param0) VecFx32 v1; MapObject *v2 = param0->unk_0C; - MapObject_PosVectorOut(v2, &v1); + MapObject_GetPosPtr(v2, &v1); v1.y -= FX32_ONE * 8; - MapObject_SetPosVec(v2, &v1); + MapObject_SetPos(v2, &v1); if (v1.y > ((115 << 4) * FX32_ONE)) { return 0; @@ -7455,13 +7455,13 @@ static BOOL ov9_0224F324(UnkStruct_ov9_0224F6EC *param0) Sound_PlayEffect(1571); v1.y = ((115 << 4) * FX32_ONE); - sub_020632D4(v2, &v1, MapObject_Dir(v2)); + sub_020632D4(v2, &v1, MapObject_GetFacingDir(v2)); sub_02062914(v2, 580); { u32 v3, v4; - switch (MapObject_Id(v2)) { + switch (MapObject_GetLocalID(v2)) { case (0x80 + 0): v3 = 3; v4 = 0; @@ -7490,10 +7490,10 @@ static BOOL ov9_0224F3BC(UnkStruct_ov9_0224F6EC *param0) VecFx32 v0; MapObject *v1 = param0->unk_0C; - MapObject_PosVectorOut(v1, &v0); + MapObject_GetPosPtr(v1, &v0); v0.y -= FX32_ONE * 2; - MapObject_SetPosVec(v1, &v0); - MapObject_StepDirection(v1, MapObject_GetMoveDir(v1), (FX32_ONE * 2)); + MapObject_SetPos(v1, &v0); + MapObject_StepDirection(v1, MapObject_GetMovingDir(v1), (FX32_ONE * 2)); } param0->unk_18++; @@ -7509,9 +7509,9 @@ static BOOL ov9_0224F3BC(UnkStruct_ov9_0224F6EC *param0) VecFx32 v2; MapObject *v3 = param0->unk_0C; - MapObject_PosVectorOut(v3, &v2); + MapObject_GetPosPtr(v3, &v2); v2.y -= FX32_ONE * 4; - MapObject_SetPosVec(v3, &v2); + MapObject_SetPos(v3, &v2); } param0->unk_18++; @@ -7528,7 +7528,7 @@ static BOOL ov9_0224F3BC(UnkStruct_ov9_0224F6EC *param0) ov9_02249DC8(param0->unk_00, param0->unk_14); - switch (MapObject_Id(v6)) { + switch (MapObject_GetLocalID(v6)) { case (0x80 + 0): v4 = (0x80 + 16); v5 = 3; @@ -7546,13 +7546,13 @@ static BOOL ov9_0224F3BC(UnkStruct_ov9_0224F6EC *param0) } ov9_02249DE4(param0->unk_00, v5); - MapObject_SetId(v6, v4); + MapObject_SetLocalID(v6, v4); { - int v7 = MapObject_GetMoveDir(v6); - int v8 = MapObject_GetXPos(v6); - int v9 = MapObject_GetYPos(v6); - int v10 = MapObject_GetZPos(v6); + int v7 = MapObject_GetMovingDir(v6); + int v8 = MapObject_GetX(v6); + int v9 = MapObject_GetY(v6); + int v10 = MapObject_GetZ(v6); v8 += MapObject_GetDxFromDir(v7); v9 -= (2 * 2); @@ -7655,10 +7655,10 @@ static BOOL ov9_0224F5D8(UnkStruct_ov9_0224F6EC *param0) VecFx32 v0; MapObject *v1 = param0->unk_0C; - MapObject_PosVectorOut(v1, &v0); + MapObject_GetPosPtr(v1, &v0); v0.y -= FX32_ONE * 2; - MapObject_SetPosVec(v1, &v0); - MapObject_StepDirection(v1, MapObject_GetMoveDir(v1), (FX32_ONE * 2)); + MapObject_SetPos(v1, &v0); + MapObject_StepDirection(v1, MapObject_GetMovingDir(v1), (FX32_ONE * 2)); } param0->unk_18++; @@ -7674,9 +7674,9 @@ static BOOL ov9_0224F5D8(UnkStruct_ov9_0224F6EC *param0) VecFx32 v2; MapObject *v3 = param0->unk_0C; - MapObject_PosVectorOut(v3, &v2); + MapObject_GetPosPtr(v3, &v2); v2.y -= FX32_ONE * 4; - MapObject_SetPosVec(v3, &v2); + MapObject_SetPos(v3, &v2); } param0->unk_18++; @@ -7692,9 +7692,9 @@ static BOOL ov9_0224F5D8(UnkStruct_ov9_0224F6EC *param0) VecFx32 v4; MapObject *v5 = param0->unk_0C; - MapObject_PosVectorOut(v5, &v4); + MapObject_GetPosPtr(v5, &v4); v4.y -= FX32_ONE * 8; - MapObject_SetPosVec(v5, &v4); + MapObject_SetPos(v5, &v4); } param0->unk_18++; @@ -7707,7 +7707,7 @@ static BOOL ov9_0224F5D8(UnkStruct_ov9_0224F6EC *param0) u32 v6 = 0, v7 = 0, v8 = 0, v9 = 0; MapObject *v10 = param0->unk_0C; - switch (MapObject_Id(v10)) { + switch (MapObject_GetLocalID(v10)) { case (0x80 + 0): v6 = 0; v7 = 3; @@ -8008,7 +8008,7 @@ static void ov9_0224FA94(UnkStruct_ov9_02249B04 *param0, UnkStruct_ov9_0224FA94 ov9_0224A4D0(param0, v0, -32, 72); param1->unk_04++; } else if ((param1->unk_04 == 1) && (v1 == -36)) { - MapObject_SetDir(v0, 2); + MapObject_TryFace(v0, 2); ov9_0224A148(param0, &Unk_ov9_02251888); ov9_0224A4D0(param0, v0, 32, 31); param1->unk_04++; @@ -8018,7 +8018,7 @@ static void ov9_0224FA94(UnkStruct_ov9_02249B04 *param0, UnkStruct_ov9_0224FA94 param1->unk_06++; if (param1->unk_06 >= 32) { - MapObject_SetDir(v0, 0); + MapObject_TryFace(v0, 0); param1->unk_06 = -1; } } @@ -8039,8 +8039,8 @@ static int ov9_0224FB3C(UnkStruct_ov9_02249B04 *param0, FieldTask *param1, u16 * playerAvatar = param0->fieldSystem->playerAvatar; v2 = Player_MapObject(playerAvatar); - MapObject_PosVectorOut(v2, &v0); - MapObject_SetDir(v2, 2); + MapObject_GetPosPtr(v2, &v0); + MapObject_TryFace(v2, 2); ov9_0224F8C4(param0, v1, &v5->unk_00, &v0); v1->unk_04.x >>= 1; @@ -8094,7 +8094,7 @@ static int ov9_0224FC2C(UnkStruct_ov9_02249B04 *param0, FieldTask *param1, u16 * UnkStruct_ov9_0224F930 *v2 = &v1->unk_40; ov9_0224F970(param0, v2); - MapObject_SetPosVec(v0, &v2->unk_34); + MapObject_SetPos(v0, &v2->unk_34); ov9_0224FA94(param0, v1); { @@ -8167,7 +8167,7 @@ static int ov9_0224FD74(UnkStruct_ov9_02249B04 *param0, FieldTask *param1, u16 * UnkStruct_ov9_0224F930 *v4 = &v3->unk_40; v0 = ov9_0224F970(param0, v4); - MapObject_SetPosVec(v2, &v4->unk_34); + MapObject_SetPos(v2, &v4->unk_34); { VecFx32 v5 = v4->unk_40; @@ -8244,7 +8244,7 @@ static int ov9_0224FEDC(UnkStruct_ov9_02249B04 *param0, FieldTask *param1, u16 * v0 = ov9_0224F970(param0, v4); - MapObject_SetPosVec(v2, &v4->unk_34); + MapObject_SetPos(v2, &v4->unk_34); sub_02063088(v2, &v4->unk_40); ov9_0224FA94(param0, v3); @@ -8279,16 +8279,16 @@ static int ov9_0224FEDC(UnkStruct_ov9_02249B04 *param0, FieldTask *param1, u16 * const UnkStruct_ov9_0224F8C4 *v12 = &v11->unk_00; VecFx32 v13 = { 0, 0, 0 }; - v8 = MapObject_GetXPos(v2) + v12->unk_06; - v9 = MapObject_GetYPos(v2) + ((v12->unk_08) * 2); - v10 = MapObject_GetZPos(v2) + v12->unk_0A; + v8 = MapObject_GetX(v2) + v12->unk_06; + v9 = MapObject_GetY(v2) + ((v12->unk_08) * 2); + v10 = MapObject_GetZ(v2) + v12->unk_0A; MapObject_SetX(v2, v8); MapObject_SetY(v2, v9); MapObject_SetZ(v2, v10); sub_02064208(v2); - MapObject_SetDir(v2, 2); - sub_02062994(v2, 2); + MapObject_TryFace(v2, 2); + MapObject_Turn(v2, 2); sub_02063088(v2, &v13); sub_020630AC(v2, &v13); ov9_0224C378(param0, v8, ((v9) / 2), v10, 4); @@ -8383,8 +8383,8 @@ static int ov9_02250170(UnkStruct_ov9_02249B04 *param0, FieldTask *param1, u16 * playerAvatar = param0->fieldSystem->playerAvatar; v2 = Player_MapObject(playerAvatar); - MapObject_PosVectorOut(v2, &v0); - MapObject_SetDir(v2, 3); + MapObject_GetPosPtr(v2, &v0); + MapObject_TryFace(v2, 3); ov9_0224F8C4(param0, v1, &v5->unk_00, &v0); v1->unk_04.x >>= 1; @@ -8438,7 +8438,7 @@ static int ov9_02250260(UnkStruct_ov9_02249B04 *param0, FieldTask *param1, u16 * UnkStruct_ov9_0224F930 *v2 = &v1->unk_34; ov9_0224F970(param0, v2); - MapObject_SetPosVec(v0, &v2->unk_34); + MapObject_SetPos(v0, &v2->unk_34); ov9_02250138(param0, v1); { @@ -8509,7 +8509,7 @@ static int ov9_02250388(UnkStruct_ov9_02249B04 *param0, FieldTask *param1, u16 * v0 = ov9_0224F970(param0, v4); - MapObject_SetPosVec(v2, &v4->unk_34); + MapObject_SetPos(v2, &v4->unk_34); sub_02063088(v2, &v4->unk_40); ov9_02250138(param0, v3); @@ -8562,7 +8562,7 @@ static int ov9_02250468(UnkStruct_ov9_02249B04 *param0, FieldTask *param1, u16 * v0 = ov9_0224F970(param0, v4); - MapObject_SetPosVec(v2, &v4->unk_34); + MapObject_SetPos(v2, &v4->unk_34); sub_02063088(v2, &v4->unk_40); ov9_02250138(param0, v3); @@ -8597,16 +8597,16 @@ static int ov9_02250468(UnkStruct_ov9_02249B04 *param0, FieldTask *param1, u16 * const UnkStruct_ov9_0224F8C4 *v12 = &v11->unk_00; VecFx32 v13 = { 0, 0, 0 }; - v8 = MapObject_GetXPos(v2) + v12->unk_06; - v9 = MapObject_GetYPos(v2) + ((v12->unk_08) * 2); - v10 = MapObject_GetZPos(v2) + v12->unk_0A; + v8 = MapObject_GetX(v2) + v12->unk_06; + v9 = MapObject_GetY(v2) + ((v12->unk_08) * 2); + v10 = MapObject_GetZ(v2) + v12->unk_0A; MapObject_SetX(v2, v8); MapObject_SetY(v2, v9); MapObject_SetZ(v2, v10); sub_02064208(v2); - MapObject_SetDir(v2, 3); - sub_02062994(v2, 3); + MapObject_TryFace(v2, 3); + MapObject_Turn(v2, 3); sub_02063088(v2, &v13); sub_020630AC(v2, &v13); ov9_0224C378(param0, v8, ((v9) / 2), v10, 4); @@ -9475,10 +9475,10 @@ static void ov9_02250F44(UnkStruct_ov9_02249B04 *param0, int *param1, int *param { MapObject *v0 = Player_MapObject(param0->fieldSystem->playerAvatar); - *param1 = MapObject_GetXPos(v0); - *param2 = MapObject_GetYPos(v0); + *param1 = MapObject_GetX(v0); + *param2 = MapObject_GetY(v0); *param2 = ((*param2) / 2); - *param3 = MapObject_GetZPos(v0); + *param3 = MapObject_GetZ(v0); } BOOL ov9_02250F74(FieldSystem *fieldSystem) @@ -9684,7 +9684,7 @@ static void ov9_022511F4(MapObject *param0, const VecFx32 *param1) { UnkStruct_020216E0 *v0; - MapObject_SetPosVec(param0, param1); + MapObject_SetPos(param0, param1); v0 = ov5_021EB1A0(param0); if (v0 != NULL) { diff --git a/src/overlay023/ov23_022521F0.c b/src/overlay023/ov23_022521F0.c index 525f694aef..efbf1d5349 100644 --- a/src/overlay023/ov23_022521F0.c +++ b/src/overlay023/ov23_022521F0.c @@ -947,7 +947,7 @@ void ov23_022534A0(FieldSystem *fieldSystem) for (i = 0; i < objEventCount; i++) { if (objEventList[i].x == v1 && objEventList[i].z == v2) { mapObj = MapObjMan_LocalMapObjByIndex(v4->fieldSystem->mapObjMan, i); - MapObject_SetDir(mapObj, v3); + MapObject_TryFace(mapObj, v3); } } } diff --git a/src/player_avatar.c b/src/player_avatar.c index f85a39ef24..0ec6ba3f12 100644 --- a/src/player_avatar.c +++ b/src/player_avatar.c @@ -81,7 +81,7 @@ PlayerAvatar *sub_0205E820(const MapObjectManager *mapObjMan, PlayerData *param1 sub_0205E91C(playerAvatar, v0, gender, param1); mapObj = sub_0205EA64(mapObjMan); - sub_0206291C(mapObj, Player_MoveStateFromGender(v0, gender)); + MapObject_SetGraphicsID(mapObj, Player_MoveStateFromGender(v0, gender)); MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_10 | MAP_OBJ_STATUS_13); MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_LOCK_DIR | MAP_OBJ_STATUS_PAUSE_ANIMATION); sub_02062F90(mapObj, 1); @@ -155,15 +155,15 @@ static void PlayerAvatar_AddMapObject(PlayerAvatar *playerAvatar, const MapObjec MapObject *mapObj = MapObjectMan_AddMapObject(mapObjMan, x, z, dir, param2, 0x1, 1); GF_ASSERT(mapObj != NULL); - MapObject_SetId(mapObj, 0xff); - sub_0206294C(mapObj, 0); - sub_02062954(mapObj, 0); - sub_0206295C(mapObj, 0); - sub_020629B4(mapObj, 0, 0); - sub_020629B4(mapObj, 0, 1); - sub_020629B4(mapObj, 0, 2); - sub_020629FC(mapObj, -1); - sub_02062A04(mapObj, -1); + MapObject_SetLocalID(mapObj, 0xff); + MapObject_SetTrainerType(mapObj, 0); + MapObject_SetFlag(mapObj, 0); + MapObject_SetScript(mapObj, 0); + MapObject_SetDataAt(mapObj, 0, 0); + MapObject_SetDataAt(mapObj, 0, 1); + MapObject_SetDataAt(mapObj, 0, 2); + MapObject_SetMovementRangeX(mapObj, -1); + MapObject_SetMovementRangeZ(mapObj, -1); MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_10 | MAP_OBJ_STATUS_13); MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_LOCK_DIR | MAP_OBJ_STATUS_PAUSE_ANIMATION); sub_02062F90(mapObj, 1); @@ -177,7 +177,7 @@ MapObject *sub_0205EA24(const MapObjectManager *mapObjMan) MapObject *mapObj = NULL; while (sub_020625B0(mapObjMan, &mapObj, &v0, (1 << 0))) { - if (MapObject_GetMoveCode(mapObj) == 0x1) { + if (MapObject_GetMovementType(mapObj) == 0x1) { break; } } @@ -195,17 +195,17 @@ static MapObject *sub_0205EA64(const MapObjectManager *mapObjMan) int PlayerAvatar_GetDir(PlayerAvatar *const playerAvatar) { - return MapObject_Dir(Player_MapObject(playerAvatar)); + return MapObject_GetFacingDir(Player_MapObject(playerAvatar)); } void Player_SetDir(PlayerAvatar *playerAvatar, int dir) { - MapObject_SetDir(Player_MapObject(playerAvatar), dir); + MapObject_TryFace(Player_MapObject(playerAvatar), dir); } int PlayerAvatar_GetMoveDir(PlayerAvatar *const playerAvatar) { - return MapObject_GetMoveDir(Player_MapObject(playerAvatar)); + return MapObject_GetMovingDir(Player_MapObject(playerAvatar)); } int sub_0205EAA0(PlayerAvatar *const playerAvatar) @@ -219,32 +219,32 @@ int sub_0205EAA0(PlayerAvatar *const playerAvatar) int Player_GetXPos(PlayerAvatar *const playerAvatar) { - return MapObject_GetXPos(Player_MapObject(playerAvatar)); + return MapObject_GetX(Player_MapObject(playerAvatar)); } int Player_GetZPos(PlayerAvatar *const playerAvatar) { - return MapObject_GetZPos(Player_MapObject(playerAvatar)); + return MapObject_GetZ(Player_MapObject(playerAvatar)); } int PlayerAvatar_XPosPrev(PlayerAvatar *const playerAvatar) { - return MapObject_XPosPrev(Player_MapObject(playerAvatar)); + return MapObject_GetXPrev(Player_MapObject(playerAvatar)); } int PlayerAvatar_ZPosPrev(PlayerAvatar *const playerAvatar) { - return MapObject_ZPosPrev(Player_MapObject(playerAvatar)); + return MapObject_GetZPrev(Player_MapObject(playerAvatar)); } void PlayerAvatar_PosVectorOut(PlayerAvatar *const playerAvatar, VecFx32 *pos) { - MapObject_PosVectorOut(Player_MapObject(playerAvatar), pos); + MapObject_GetPosPtr(Player_MapObject(playerAvatar), pos); } const VecFx32 *PlayerAvatar_PosVector(PlayerAvatar *const playerAvatar) { - return MapObject_PosVector(PlayerAvatar_ConstMapObject(playerAvatar)); + return MapObject_GetPos(PlayerAvatar_ConstMapObject(playerAvatar)); } void sub_0205EB08(PlayerAvatar *playerAvatar, int param1) @@ -549,9 +549,9 @@ void sub_0205ED0C(PlayerAvatar *playerAvatar, fx32 param1) VecFx32 v0; MapObject *v1 = Player_MapObject(playerAvatar); - MapObject_PosVectorOut(v1, &v0); + MapObject_GetPosPtr(v1, &v0); v0.y = param1; - MapObject_SetPosVec(v1, &v0); + MapObject_SetPos(v1, &v0); } void sub_0205ED2C(PlayerAvatar *playerAvatar, int param1) diff --git a/src/scrcmd.c b/src/scrcmd.c index 56f89d9a5c..be4309fd9c 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1891,7 +1891,7 @@ static BOOL ScrCmd_017(ScriptContext *ctx) v0 = ScriptContext_ReadByte(ctx); v1 = (s32)ScriptContext_ReadWord(ctx); - if (MapObject_Id(*v2) == v0) { + if (MapObject_GetLocalID(*v2) == v0) { ScriptContext_Jump(ctx, (u8 *)(ctx->scriptPtr + v1)); } @@ -2244,7 +2244,7 @@ static BOOL ScrCmd_02E(ScriptContext *ctx) static BOOL ScrCmd_20C(ScriptContext *ctx) { MapObject **mapObj = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_TARGET_OBJECT); - u8 v1 = MapObject_GetEventType(*mapObj); + u8 v1 = MapObject_GetTrainerType(*mapObj); ov5_021DD444(ctx, ctx->loader, (u8)v1, 1, NULL); ScriptContext_Pause(ctx, sub_02040014); @@ -2471,7 +2471,7 @@ static BOOL ScrCmd_036(ScriptContext *ctx) if (v4 == 0) { MapObject **v8 = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_TARGET_OBJECT); - v4 = sub_020629D8(*v8, 0); + v4 = MapObject_GetDataAt(*v8, 0); } ov5_021E1B38(fieldSystem->unk_64, v6, v4); @@ -2973,8 +2973,8 @@ static BOOL ScrCmd_2A1(ScriptContext *ctx) } v10 = Heap_AllocFromHeap(4, sizeof(MapObjectAnimCmd) * 64); - v8 = MapObject_GetXPos(v4); - v9 = MapObject_GetZPos(v4); + v8 = MapObject_GetX(v4); + v9 = MapObject_GetZ(v4); v11 = 0; if (v8 < v6) { @@ -3311,7 +3311,7 @@ static BOOL ScrCmd_066(ScriptContext *ctx) { const VecFx32 *v3; - v3 = MapObject_PosVector(*v2); + v3 = MapObject_GetPos(*v2); ov5_021E931C(v3, ctx->fieldSystem->unk_28); Camera_TrackTarget(v3, ctx->fieldSystem->camera); } @@ -3330,7 +3330,7 @@ static BOOL ScrCmd_067(ScriptContext *ctx) const VecFx32 *v2; v1 = MapObjMan_LocalMapObjByIndex(ctx->fieldSystem->mapObjMan, 0xff); - v2 = MapObject_PosVector(v1); + v2 = MapObject_GetPos(v1); ov5_021E931C(v2, ctx->fieldSystem->unk_28); Camera_TrackTarget(v2, ctx->fieldSystem->camera); @@ -3400,8 +3400,8 @@ static BOOL ScrCmd_06A(ScriptContext *ctx) mapObj = MapObjMan_LocalMapObjByIndex(fieldSystem->mapObjMan, ScriptContext_GetVar(ctx)); v1 = ScriptContext_GetVarPointer(ctx); v2 = ScriptContext_GetVarPointer(ctx); - *v1 = MapObject_GetXPos(mapObj); - *v2 = MapObject_GetZPos(mapObj); + *v1 = MapObject_GetX(mapObj); + *v2 = MapObject_GetZ(mapObj); return 0; } @@ -3469,7 +3469,7 @@ static BOOL ScrCmd_2AD(ScriptContext *ctx) mapObj = MapObjMan_LocalMapObjByIndex(ctx->fieldSystem->mapObjMan, ScriptContext_GetVar(ctx)); if (mapObj != NULL) { - *v1 = MapObject_GetMoveCode(mapObj); + *v1 = MapObject_GetMovementType(mapObj); } return 0; @@ -5283,7 +5283,7 @@ static BOOL ScrCmd_13C(ScriptContext *ctx) u16 v5; if (v2 == 0) { - v5 = MapObject_Id(*v0); + v5 = MapObject_GetLocalID(*v0); } else { v5 = 0; } @@ -5321,7 +5321,7 @@ static BOOL ScrCmd_13F(ScriptContext *ctx) u16 *v2 = ScriptContext_GetVarPointer(ctx); StringTemplate **v3 = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_STR_TEMPLATE); - *v2 = sub_0205BCF4(ctx->fieldSystem->unk_7C, MapObject_Id(*v0), v1, *v3); + *v2 = sub_0205BCF4(ctx->fieldSystem->unk_7C, MapObject_GetLocalID(*v0), v1, *v3); return 0; } @@ -5348,7 +5348,7 @@ static BOOL ScrCmd_140(ScriptContext *ctx) MapObject **v1 = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_TARGET_OBJECT); u16 *v2 = ScriptContext_GetVarPointer(ctx); - *v2 = sub_0205B780(fieldSystem->unk_7C, MapObject_Id(*v1)); + *v2 = sub_0205B780(fieldSystem->unk_7C, MapObject_GetLocalID(*v1)); return 0; } @@ -5359,7 +5359,7 @@ static BOOL ScrCmd_146(ScriptContext *ctx) u16 v2 = ScriptContext_GetVar(ctx); u16 *v3 = ScriptContext_GetVarPointer(ctx); - *v3 = sub_0205B804(fieldSystem->unk_7C, MapObject_Id(*v1), v2); + *v3 = sub_0205B804(fieldSystem->unk_7C, MapObject_GetLocalID(*v1), v2); return 0; } @@ -5873,9 +5873,9 @@ static BOOL ScrCmd_GetPlayer3DPos(ScriptContext *ctx) MapObject *player = Player_MapObject(fieldSystem->playerAvatar); - *destVarX = MapObject_GetXPos(player); - *destVarY = MapObject_GetYPos(player) / 2; - *destVarZ = MapObject_GetZPos(player); + *destVarX = MapObject_GetX(player); + *destVarY = MapObject_GetY(player) / 2; + *destVarZ = MapObject_GetZ(player); return FALSE; } @@ -5894,7 +5894,7 @@ static BOOL ScrCmd_19E(ScriptContext *ctx) u16 v3 = ScriptContext_ReadHalfWord(ctx); ctx->data[0] = v3; - *v0 = ov23_02252C98(v2, ctx->fieldSystem, MapObject_Id(*v1)); + *v0 = ov23_02252C98(v2, ctx->fieldSystem, MapObject_GetLocalID(*v1)); ScriptContext_Pause(ctx, sub_020441C8); return 1; diff --git a/src/script_manager.c b/src/script_manager.c index e114a546f9..d76c5d0907 100644 --- a/src/script_manager.c +++ b/src/script_manager.c @@ -160,7 +160,7 @@ static void sub_0203EA68(FieldSystem *fieldSystem, ScriptManager *scriptManager, scriptManager->saveType = saveType; if (object != NULL) { - *targetID = MapObject_Id(object); + *targetID = MapObject_GetLocalID(object); } if (scriptID >= SCRIPT_ID_OFFSET_HIDDEN_ITEMS && scriptID <= SCRIPT_ID_OFFSET_SAFARI_ZONE - 1) { diff --git a/src/unk_0203C954.c b/src/unk_0203C954.c index cdb3f24b1b..9d04b35edb 100644 --- a/src/unk_0203C954.c +++ b/src/unk_0203C954.c @@ -194,7 +194,7 @@ u8 sub_0203CBE0(FieldSystem *fieldSystem, MapObject **param1) } if (sub_0203CA40(fieldSystem, param1) == 1) { - u32 v0 = sub_02062920(*param1); + u32 v0 = MapObject_GetGraphicsID(*param1); if ((v0 == 0x5b) || (v0 == 0x5c) || (v0 == 0x5d) || (v0 == 0x5e) || (v0 == 0x5f) || (v0 == 0x60)) { return 1; diff --git a/src/unk_02048614.c b/src/unk_02048614.c index 42a4d095f1..763fe96b7e 100644 --- a/src/unk_02048614.c +++ b/src/unk_02048614.c @@ -319,7 +319,7 @@ BOOL ScrCmd_0F0(ScriptContext *param0) FieldSystem *fieldSystem = param0->fieldSystem; v0 = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_TARGET_OBJECT); - Script_SetTrainerDefeated(MapObject_FieldSystem(*v0), MapObject_Id(*v0)); + Script_SetTrainerDefeated(MapObject_FieldSystem(*v0), MapObject_GetLocalID(*v0)); return 0; } @@ -333,7 +333,7 @@ BOOL ScrCmd_0F1(ScriptContext *param0) v2 = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_TARGET_OBJECT); v1 = (s32)ScriptContext_ReadWord(param0); - v0 = Script_IsTrainerDefeated(MapObject_FieldSystem(*v2), MapObject_Id(*v2)); + v0 = Script_IsTrainerDefeated(MapObject_FieldSystem(*v2), MapObject_GetLocalID(*v2)); if (v0 == 1) { ScriptContext_Jump(param0, (u8 *)(param0->scriptPtr + v1)); diff --git a/src/unk_02055C50.c b/src/unk_02055C50.c index fe3be42d41..7e03046178 100644 --- a/src/unk_02055C50.c +++ b/src/unk_02055C50.c @@ -158,9 +158,9 @@ void sub_02055D94(FieldSystem *fieldSystem) BerryPatch *v2 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData); while (sub_020625B0(fieldSystem->mapObjMan, &v1, &v0, (1 << 0)) == 1) { - if (sub_020677F4(sub_02062920(v1)) == 1) { - if (sub_02055D54(fieldSystem, MapObject_PosVector(v1))) { - int v3 = sub_020629D8(v1, 0); + if (sub_020677F4(MapObject_GetGraphicsID(v1)) == 1) { + if (sub_02055D54(fieldSystem, MapObject_GetPos(v1))) { + int v3 = MapObject_GetDataAt(v1, 0); BerryPatches_SetIsPatchGrowing(v2, v3, 1); } } @@ -172,7 +172,7 @@ BOOL sub_02055E00(FieldSystem *fieldSystem, MapObject *param1) int v0, v1, v2; BerryPatch *v3 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData); - v0 = sub_020629D8(param1, 0); + v0 = MapObject_GetDataAt(param1, 0); v2 = BerryPatches_GetPatchBerryID(v3, v0); v1 = BerryPatches_GetPatchYield(v3, v0); @@ -188,7 +188,7 @@ void sub_02055E80(FieldSystem *fieldSystem, MapObject *param1, u16 param2) int v0; BerryPatch *v1 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData); - v0 = sub_020629D8(param1, 0); + v0 = MapObject_GetDataAt(param1, 0); BerryPatches_SetPatchMulchType(v1, v0, sub_02055C80(param2)); } @@ -197,7 +197,7 @@ void sub_02055EAC(FieldSystem *fieldSystem, MapObject *param1, u16 param2) int v0; BerryPatch *v1 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData); - v0 = sub_020629D8(param1, 0); + v0 = MapObject_GetDataAt(param1, 0); BerryPatches_PlantInPatch(v1, v0, fieldSystem->unk_04->unk_18->unk_04, sub_02055C60(param2)); } @@ -206,7 +206,7 @@ void sub_02055EE0(FieldSystem *fieldSystem, MapObject *param1) int v0; BerryPatch *v1 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData); - v0 = sub_020629D8(param1, 0); + v0 = MapObject_GetDataAt(param1, 0); BerryPatches_ResetPatchMoisture(v1, v0); } @@ -215,7 +215,7 @@ int sub_02055F00(const FieldSystem *fieldSystem, const MapObject *param1) int v0; BerryPatch *v1 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData); - v0 = sub_020629D8(param1, 0); + v0 = MapObject_GetDataAt(param1, 0); return BerryPatches_GetPatchGrowthStage(v1, v0); } @@ -224,7 +224,7 @@ int sub_02055F20(const FieldSystem *fieldSystem, const MapObject *param1) int v0; BerryPatch *v1 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData); - v0 = sub_020629D8(param1, 0); + v0 = MapObject_GetDataAt(param1, 0); return BerryPatches_GetPatchBerryID(v1, v0); } @@ -233,7 +233,7 @@ u16 sub_02055F40(const FieldSystem *fieldSystem, const MapObject *param1) int v0; BerryPatch *v1 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData); - v0 = sub_020629D8(param1, 0); + v0 = MapObject_GetDataAt(param1, 0); return sub_02055C50(BerryPatches_GetPatchBerryID(v1, v0)); } @@ -242,7 +242,7 @@ u16 sub_02055F64(const FieldSystem *fieldSystem, const MapObject *param1) int v0; BerryPatch *v1 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData); - v0 = sub_020629D8(param1, 0); + v0 = MapObject_GetDataAt(param1, 0); return sub_02055C70(BerryPatches_GetPatchMulchType(v1, v0)); } @@ -251,7 +251,7 @@ int sub_02055F88(const FieldSystem *fieldSystem, const MapObject *param1) int v0; BerryPatch *v1 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData); - v0 = sub_020629D8(param1, 0); + v0 = MapObject_GetDataAt(param1, 0); return BerryPatches_GetPatchMoisture(v1, v0); } @@ -260,7 +260,7 @@ int sub_02055FA8(const FieldSystem *fieldSystem, const MapObject *param1) int v0; BerryPatch *v1 = MiscSaveBlock_GetBerryPatches(fieldSystem->saveData); - v0 = sub_020629D8(param1, 0); + v0 = MapObject_GetDataAt(param1, 0); return BerryPatches_GetPatchYield(v1, v0); } @@ -268,7 +268,7 @@ u32 sub_02055FC8(const FieldSystem *fieldSystem, const MapObject *param1) { u32 v0 = 0; - if ((param1 == NULL) || (sub_02062920(param1) != 0x64)) { + if ((param1 == NULL) || (MapObject_GetGraphicsID(param1) != 0x64)) { return 0x0; } @@ -361,7 +361,7 @@ static MapObject *sub_020560A8(FieldSystem *fieldSystem, UnkStruct_020562AC *par static BOOL sub_020560E4(MapObject *mapObj) { - return sub_02062920(mapObj) == 0x64; + return MapObject_GetGraphicsID(mapObj) == 0x64; } static void sub_020560F8(FieldSystem *fieldSystem, UnkStruct_020562AC *param1) diff --git a/src/unk_0205C22C.c b/src/unk_0205C22C.c index d20e5f9a6b..93f4f2ad8b 100644 --- a/src/unk_0205C22C.c +++ b/src/unk_0205C22C.c @@ -281,8 +281,8 @@ static void sub_0205C51C(UnkStruct_0205C22C *param0, MapObjectManager *param1) if ((param0->unk_0C[v1].unk_00 == 1) && (param0->unk_0C[v1].unk_09 == 0)) { MapObject_SetMoveCode(v0, 0x3); - sub_020629FC(v0, 1); - sub_02062A04(v0, 1); + MapObject_SetMovementRangeX(v0, 1); + MapObject_SetMovementRangeZ(v0, 1); param0->unk_0C[v1].unk_09 = 1; } @@ -360,9 +360,9 @@ static void sub_0205C6E0(UnkStruct_0205C680 *param0, MapObject *param1, int para { int v0, v1, v2; - v0 = MapObject_XInitial(param1); - v1 = MapObject_YInitial(param1); - v2 = MapObject_ZInitial(param1); + v0 = MapObject_GetXInitial(param1); + v1 = MapObject_GetYInitial(param1); + v2 = MapObject_GetZInitial(param1); if ((v0 == param2) && (v2 == param3)) { return; @@ -372,7 +372,7 @@ static void sub_0205C6E0(UnkStruct_0205C680 *param0, MapObject *param1, int para sub_02061AD4(param1, param0->unk_08); sub_0205C680(param0, 0); MapObject_SetPosDir(param1, v0, v1, v2, 1); - sub_0206296C(param1, 1); + MapObject_Face(param1, 1); LocalMapObj_SetAnimationCode(param1, 0x44); MapObject_SetHidden(param1, 0); sub_02062D80(param1, 1); @@ -461,7 +461,7 @@ void sub_0205C820(MapObjectManager *mapObjMan, UnkStruct_0205C22C *param1) } sub_02061AD4(mapObj, v1->unk_08); - sub_0206296C(mapObj, 1); + MapObject_Face(mapObj, 1); LocalMapObj_SetAnimationCode(mapObj, 0x44); MapObject_SetHidden(mapObj, 0); sub_02062D80(mapObj, 1); diff --git a/src/unk_0205F180.c b/src/unk_0205F180.c index c8c55aeb47..ec71a142d8 100644 --- a/src/unk_0205F180.c +++ b/src/unk_0205F180.c @@ -192,7 +192,7 @@ static int PlayerAvatar_CheckStartMoveInternal(PlayerAvatar *playerAvatar, int d return 0; } - v0 = MapObject_AnimationCode(mapObj); + v0 = MapObject_GetMovementAction(mapObj); if (sub_020613D8(v0) == 1) { u32 v2; @@ -202,9 +202,9 @@ static int PlayerAvatar_CheckStartMoveInternal(PlayerAvatar *playerAvatar, int d if ((v2 & (~(1 << 7))) && PlayerAvatar_MapDistortionState(playerAvatar) == AVATAR_DISTORTION_STATE_FLOOR) { FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); - int xOut, x = MapObject_GetXPos(mapObj); - int yOut, y = MapObject_GetYPos(mapObj); - int zOut, z = MapObject_GetZPos(mapObj); + int xOut, x = MapObject_GetX(mapObj); + int yOut, y = MapObject_GetY(mapObj); + int zOut, z = MapObject_GetZ(mapObj); y = y / 2; xOut = x; @@ -264,7 +264,7 @@ static void PlayerAvatar_PlayWalkSE(PlayerAvatar *playerAvatar) u8 v1, v2 = sub_02062BE8(mapObj); { - int animationCode = MapObject_AnimationCode(mapObj); + int animationCode = MapObject_GetMovementAction(mapObj); int v4 = sub_0206587C(animationCode); if (v4 == -1) { @@ -293,7 +293,7 @@ static void PlayerAvatar_PlayWalkSE(PlayerAvatar *playerAvatar) Sound_PlayEffect(1621); } - int code = MapObject_AnimationCode(mapObj); + int code = MapObject_GetMovementAction(mapObj); if (sub_020613D8(code) == 0) { if ((TileBehavior_IsVeryTallGrass(v2) == 1) || (TileBehavior_IsVeryTallGrass(v1) == 1)) { @@ -326,7 +326,7 @@ void sub_0205F490(PlayerAvatar *playerAvatar) case PLAYER_STATE_WALKING: break; case PLAYER_STATE_CYCLING: - v2 = MapObject_AnimationCode(mapObj); + v2 = MapObject_GetMovementAction(mapObj); if (sub_020613D8(v2) == 1) { break; @@ -412,7 +412,7 @@ int sub_0205F588(PlayerAvatar *playerAvatar) return 1; } - v2 = MapObject_AnimationCode(mapObj); + v2 = MapObject_GetMovementAction(mapObj); if (sub_020613D8(v2) == 1) { return 1; @@ -431,7 +431,7 @@ void sub_0205F5E4(PlayerAvatar *playerAvatar, int param1) mapObj = Player_MapObject(playerAvatar); - MapObject_SetDir(mapObj, param1); + MapObject_TryFace(mapObj, param1); sub_02062A0C(mapObj, 0x0); sub_02064208(mapObj); sub_020656DC(mapObj); @@ -496,7 +496,7 @@ static int sub_0205F6C4(PlayerAvatar *playerAvatar, int param1) static int sub_0205F6D0(PlayerAvatar *playerAvatar, int param1) { MapObject *mapObj = Player_MapObject(playerAvatar); - int v1 = MapObject_GetMoveDir(mapObj); + int v1 = MapObject_GetMovingDir(mapObj); int v2 = sub_0205FAB0(playerAvatar, v1); u32 v3 = sub_02060B7C(playerAvatar, mapObj, v1); @@ -518,7 +518,7 @@ static int sub_0205F6D0(PlayerAvatar *playerAvatar, int param1) return 0; } - MapObject_SetStatusFlagOn(mapObj, (1 << 7) | (1 << 8)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_LOCK_DIR | MAP_OBJ_STATUS_PAUSE_ANIMATION); sub_02060B64(playerAvatar, mapObj, sub_02065838(v1, 0x8), 3); sub_0205EF6C(playerAvatar, 1); sub_0205EF40(playerAvatar, 1); @@ -538,13 +538,13 @@ static int sub_0205F6D0(PlayerAvatar *playerAvatar, int param1) return 0; } - MapObject_SetStatusFlagOn(mapObj, (1 << 7) | (1 << 8)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_LOCK_DIR | MAP_OBJ_STATUS_PAUSE_ANIMATION); sub_02060B64(playerAvatar, mapObj, sub_02065838(v1, 0x8), 3); sub_0205EF6C(playerAvatar, 1); sub_0205EF40(playerAvatar, 1); sub_0205EBEC(playerAvatar, -1, -1); } else { - MapObject_SetStatusFlagOn(mapObj, (1 << 7) | (1 << 8)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_LOCK_DIR | MAP_OBJ_STATUS_PAUSE_ANIMATION); sub_0205FB40(playerAvatar, v1); } @@ -556,7 +556,7 @@ static int sub_0205F808(PlayerAvatar *playerAvatar, int param1) { u32 v0; MapObject *mapObj = Player_MapObject(playerAvatar); - int v2 = MapObject_GetMoveDir(mapObj); + int v2 = MapObject_GetMovingDir(mapObj); Sound_PlayEffect(1620); @@ -576,7 +576,7 @@ static int sub_0205F808(PlayerAvatar *playerAvatar, int param1) return 0; } - MapObject_SetStatusFlagOn(mapObj, (1 << 7) | (1 << 8)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_LOCK_DIR | MAP_OBJ_STATUS_PAUSE_ANIMATION); sub_02060B64(playerAvatar, mapObj, sub_02065838(v2, 0x8), 3); PlayerAvatar_ClearSpeed(playerAvatar); sub_0205EF40(playerAvatar, 1); @@ -596,7 +596,7 @@ static int sub_0205F808(PlayerAvatar *playerAvatar, int param1) sub_0205EBEC(playerAvatar, -1, -1); return 1; } else { - MapObject_SetStatusFlagOn(mapObj, (1 << 7) | (1 << 8)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_LOCK_DIR | MAP_OBJ_STATUS_PAUSE_ANIMATION); sub_02060B64(playerAvatar, mapObj, sub_02065838(v2, 0x8), 3); sub_0205EF40(playerAvatar, 1); sub_0205EB08(playerAvatar, 1); @@ -612,7 +612,7 @@ static int sub_0205F808(PlayerAvatar *playerAvatar, int param1) static int sub_0205F95C(PlayerAvatar *playerAvatar, int param1) { MapObject *mapObj = Player_MapObject(playerAvatar); - int v1 = MapObject_GetMoveDir(mapObj); + int v1 = MapObject_GetMovingDir(mapObj); if (PlayerAvatar_CyclingGear(playerAvatar) == 1) { Sound_PlayEffect(1622); @@ -630,7 +630,7 @@ static int sub_0205F95C(PlayerAvatar *playerAvatar, int param1) static int sub_0205F9AC(PlayerAvatar *playerAvatar, int param1) { MapObject *mapObj = Player_MapObject(playerAvatar); - int v1 = MapObject_GetMoveDir(mapObj); + int v1 = MapObject_GetMovingDir(mapObj); if (PlayerAvatar_CyclingGear(playerAvatar) == 1) { Sound_PlayEffect(1622); @@ -681,7 +681,7 @@ static void sub_0205FA6C(PlayerAvatar *playerAvatar) if (sub_0205EF58(playerAvatar) == 1) { MapObject *v0 = Player_MapObject(playerAvatar); - MapObject_SetStatusFlagOff(v0, (1 << 7) | (1 << 8)); + MapObject_SetStatusFlagOff(v0, MAP_OBJ_STATUS_LOCK_DIR | MAP_OBJ_STATUS_PAUSE_ANIMATION); if (sub_0205F08C(playerAvatar) == 0) { PlayerAvatar_ClearSpeed(playerAvatar); @@ -700,7 +700,7 @@ static int sub_0205FAB0(PlayerAvatar *playerAvatar, int param1) MapObject *mapObj = Player_MapObject(playerAvatar); FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); - MapObject_PosVectorOut(mapObj, &v1); + MapObject_GetPosPtr(mapObj, &v1); v2 = v1; VecFx32_StepDirection(param1, &v2, ((16 * FX32_ONE) >> 1) / 2); @@ -881,7 +881,7 @@ static void sub_0205FD20(PlayerAvatar *playerAvatar, MapObject *param1, int para { int v0; - v0 = sub_02065838(MapObject_Dir(param1), 0x0); + v0 = sub_02065838(MapObject_GetFacingDir(param1), 0x0); sub_02060B64(playerAvatar, param1, v0, 1); } @@ -930,7 +930,7 @@ static void sub_0205FDC8(PlayerAvatar *playerAvatar, MapObject *param1, int para Sound_PlayEffect(1537); } - sub_02062994(param1, param2); + MapObject_Turn(param1, param2); } else { v1 = 0xc; v2 = 4; @@ -967,7 +967,7 @@ static void sub_0205FDC8(PlayerAvatar *playerAvatar, MapObject *param1, int para Sound_PlayEffect(1537); } - sub_02062994(param1, param2); + MapObject_Turn(param1, param2); } } @@ -985,9 +985,9 @@ static void sub_0205FECC(PlayerAvatar *playerAvatar, MapObject *param1, int para if (v0 & (~(1 << 7))) { FieldSystem *fieldSystem = MapObject_FieldSystem(param1); - int x = MapObject_GetXPos(param1); - int y = MapObject_GetYPos(param1); - int z = MapObject_GetZPos(param1); + int x = MapObject_GetX(param1); + int y = MapObject_GetY(param1); + int z = MapObject_GetZ(param1); y = ((y) / 2); sub_02061674(playerAvatar, param2, &x, &y, &z); @@ -1010,7 +1010,7 @@ static void sub_0205FECC(PlayerAvatar *playerAvatar, MapObject *param1, int para v1 = 0x1c; v2 = 1; Sound_PlayEffect(1537); - sub_02062994(param1, param2); + MapObject_Turn(param1, param2); } else { PlayerData *player; @@ -1036,7 +1036,7 @@ static void sub_0205FECC(PlayerAvatar *playerAvatar, MapObject *param1, int para v1 = 0x1c; v2 = 1; Sound_PlayEffect(1537); - sub_02062994(param1, param2); + MapObject_Turn(param1, param2); } } @@ -1057,7 +1057,7 @@ static void sub_0206000C(PlayerAvatar *playerAvatar, MapObject *mapObj, int para v1 = param8[param2]; v2 = 1; Sound_PlayEffect(1537); - sub_02062994(mapObj, param9[param2]); + MapObject_Turn(mapObj, param9[param2]); } else { PlayerData *v3; @@ -1084,7 +1084,7 @@ static void sub_0206000C(PlayerAvatar *playerAvatar, MapObject *mapObj, int para v2 = 1; Sound_PlayEffect(1537); - sub_02062994(mapObj, param9[param2]); + MapObject_Turn(mapObj, param9[param2]); } } @@ -1149,7 +1149,7 @@ static void sub_02060258(PlayerAvatar *playerAvatar, MapObject *mapObj, int para v0 = sub_02065838(v1, 0x28); sub_02060B64(playerAvatar, mapObj, v0, 1); - sub_02062994(mapObj, param2); + MapObject_Turn(mapObj, param2); } static void sub_020602DC(PlayerAvatar *playerAvatar, MapObject *mapObj, const UnkStruct_ov5_021E8F60 *param2, int param3, u16 param4, u16 param5) @@ -1332,7 +1332,7 @@ static void sub_02060548(PlayerAvatar *playerAvatar, MapObject *mapObj, int para { int v0; - v0 = sub_02065838(MapObject_Dir(mapObj), 0x0); + v0 = sub_02065838(MapObject_GetFacingDir(mapObj), 0x0); sub_02060B64(playerAvatar, mapObj, v0, 1); PlayerAvatar_ClearSpeed(playerAvatar); @@ -1365,8 +1365,8 @@ static void sub_02060570(PlayerAvatar *playerAvatar, MapObject *mapObj, int para } else if (v0 & (1 << 6)) { v1 = 0x0; v2 = 1; - param2 = MapObject_GetMoveDir(mapObj); - sub_02062994(mapObj, param2); + param2 = MapObject_GetMovingDir(mapObj); + MapObject_Turn(mapObj, param2); PlayerAvatar_ClearSpeed(playerAvatar); sub_0205EBEC(playerAvatar, -1, -1); } else if (v0 != 0) { @@ -1378,13 +1378,13 @@ static void sub_02060570(PlayerAvatar *playerAvatar, MapObject *mapObj, int para Sound_PlayEffect(1537); } - sub_02062994(mapObj, param2); + MapObject_Turn(mapObj, param2); PlayerAvatar_ClearSpeed(playerAvatar); } else { v1 = 0x0; v2 = 1; - param2 = MapObject_GetMoveDir(mapObj); - sub_02062994(mapObj, param2); + param2 = MapObject_GetMovingDir(mapObj); + MapObject_Turn(mapObj, param2); PlayerAvatar_ClearSpeed(playerAvatar); sub_0205EBEC(playerAvatar, -1, -1); } @@ -1408,7 +1408,7 @@ static void sub_02060688(PlayerAvatar *playerAvatar, MapObject *mapObj, int para int v0 = sub_02065838(param2, 0x28); sub_02060B64(playerAvatar, mapObj, v0, 1); - sub_02062994(mapObj, param2); + MapObject_Turn(mapObj, param2); PlayerAvatar_ClearSpeed(playerAvatar); } } @@ -1441,7 +1441,7 @@ static void sub_020606C8(PlayerAvatar *playerAvatar, MapObject *mapObj, int dir, Sound_PlayEffect(1537); } - sub_02062994(mapObj, dir); + MapObject_Turn(mapObj, dir); PlayerAvatar_ClearSpeed(playerAvatar); } else { v2 = sub_02060390(playerAvatar, dir); @@ -1537,7 +1537,7 @@ static void sub_020608BC(PlayerAvatar *playerAvatar, MapObject *mapObj, int para { int v0; - v0 = sub_02065838(MapObject_Dir(mapObj), 0x0); + v0 = sub_02065838(MapObject_GetFacingDir(mapObj), 0x0); sub_02060B64(playerAvatar, mapObj, v0, 1); PlayerAvatar_ClearSpeed(playerAvatar); @@ -1577,14 +1577,14 @@ static void sub_020608E4(PlayerAvatar *playerAvatar, MapObject *mapObj, int para Sound_PlayEffect(1537); } - sub_02062994(mapObj, param2); + MapObject_Turn(mapObj, param2); PlayerAvatar_ClearSpeed(playerAvatar); } } else if (v0 & (1 << 6)) { - param2 = MapObject_GetMoveDir(mapObj); + param2 = MapObject_GetMovingDir(mapObj); v1 = sub_02065838(param2, 0x0); v2 = 1; - sub_02062994(mapObj, param2); + MapObject_Turn(mapObj, param2); PlayerAvatar_ClearSpeed(playerAvatar); sub_0205EBEC(playerAvatar, -1, -1); } else if (v0 != 0) { @@ -1596,13 +1596,13 @@ static void sub_020608E4(PlayerAvatar *playerAvatar, MapObject *mapObj, int para Sound_PlayEffect(1537); } - sub_02062994(mapObj, param2); + MapObject_Turn(mapObj, param2); PlayerAvatar_ClearSpeed(playerAvatar); } else { v2 = 1; - param2 = MapObject_GetMoveDir(mapObj); + param2 = MapObject_GetMovingDir(mapObj); v1 = sub_02065838(param2, 0x0); - sub_02062994(mapObj, param2); + MapObject_Turn(mapObj, param2); PlayerAvatar_ClearSpeed(playerAvatar); sub_0205EBEC(playerAvatar, -1, -1); } @@ -1627,7 +1627,7 @@ static void sub_02060A60(PlayerAvatar *playerAvatar, MapObject *mapObj, int para int v0 = sub_02065838(param2, 0x28); sub_02060B64(playerAvatar, mapObj, v0, 1); - sub_02062994(mapObj, param2); + MapObject_Turn(mapObj, param2); PlayerAvatar_ClearSpeed(playerAvatar); } } @@ -1660,7 +1660,7 @@ static void sub_02060AA0(PlayerAvatar *playerAvatar, MapObject *mapObj, int para Sound_PlayEffect(1537); } - sub_02062994(mapObj, param2); + MapObject_Turn(mapObj, param2); PlayerAvatar_ClearSpeed(playerAvatar); } else { v2 = sub_02060390(playerAvatar, param2); @@ -1730,11 +1730,11 @@ static u32 sub_02060C24(PlayerAvatar *playerAvatar, MapObject *mapObj, int param { VecFx32 v0; u32 v1, v2; - int x = MapObject_GetXPos(mapObj) + MapObject_GetDxFromDir(param2); - int y = MapObject_GetYPos(mapObj); - int z = MapObject_GetZPos(mapObj) + MapObject_GetDyFromDir(param2); + int x = MapObject_GetX(mapObj) + MapObject_GetDxFromDir(param2); + int y = MapObject_GetY(mapObj); + int z = MapObject_GetZ(mapObj) + MapObject_GetDyFromDir(param2); - MapObject_PosVectorOut(mapObj, &v0); + MapObject_GetPosPtr(mapObj, &v0); v1 = 0; @@ -1770,8 +1770,8 @@ static int sub_02060CE4(PlayerAvatar *playerAvatar, MapObject *mapObj, int param { if (param2 != -1) { FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); - int v1 = MapObject_GetXPos(mapObj) + MapObject_GetDxFromDir(param2); - int v2 = MapObject_GetZPos(mapObj) + MapObject_GetDyFromDir(param2); + int v1 = MapObject_GetX(mapObj) + MapObject_GetDxFromDir(param2); + int v2 = MapObject_GetZ(mapObj) + MapObject_GetDyFromDir(param2); if (sub_020683D8(fieldSystem, v1, v2, 0, param2) == 1) { return 1; @@ -1814,8 +1814,8 @@ static int sub_02060D98(PlayerAvatar *playerAvatar, MapObject *mapObj, int param if (param2 != -1) { FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); - int v2 = MapObject_GetXPos(mapObj) + MapObject_GetDxFromDir(param2); - int v3 = MapObject_GetZPos(mapObj) + MapObject_GetDyFromDir(param2); + int v2 = MapObject_GetX(mapObj) + MapObject_GetDxFromDir(param2); + int v3 = MapObject_GetZ(mapObj) + MapObject_GetDyFromDir(param2); u8 v4 = FieldSystem_GetTileBehavior(fieldSystem, v2, v3); switch (param2) { @@ -1849,8 +1849,8 @@ static int sub_02060E40(PlayerAvatar *playerAvatar, MapObject *mapObj, int param { if (param2 != -1) { FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); - int v1 = MapObject_GetXPos(mapObj); - int v2 = MapObject_GetZPos(mapObj); + int v1 = MapObject_GetX(mapObj); + int v2 = MapObject_GetZ(mapObj); u8 v3 = FieldSystem_GetTileBehavior(fieldSystem, v1, v2); switch (param2) { @@ -1892,8 +1892,8 @@ static int sub_02060EE4(PlayerAvatar *playerAvatar, MapObject *mapObj, int param { if (param2 != -1) { FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); - int v1 = MapObject_GetXPos(mapObj) + MapObject_GetDxFromDir(param2); - int v2 = MapObject_GetZPos(mapObj) + MapObject_GetDyFromDir(param2); + int v1 = MapObject_GetX(mapObj) + MapObject_GetDxFromDir(param2); + int v2 = MapObject_GetZ(mapObj) + MapObject_GetDyFromDir(param2); u8 v3 = FieldSystem_GetTileBehavior(fieldSystem, v1, v2); if ((param2 == 3) && TileBehavior_IsBikeRampEastward(v3)) { @@ -1912,8 +1912,8 @@ static int sub_02060F4C(PlayerAvatar *playerAvatar, MapObject *mapObj, int param { if (param2 != -1) { FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); - int v1 = MapObject_GetXPos(mapObj) + MapObject_GetDxFromDir(param2); - int v2 = MapObject_GetZPos(mapObj) + MapObject_GetDyFromDir(param2); + int v1 = MapObject_GetX(mapObj) + MapObject_GetDxFromDir(param2); + int v2 = MapObject_GetZ(mapObj) + MapObject_GetDyFromDir(param2); u8 v3 = FieldSystem_GetTileBehavior(fieldSystem, v1, v2); if (sub_0206406C(mapObj, v3)) { @@ -1928,8 +1928,8 @@ static int sub_02060FA8(PlayerAvatar *playerAvatar, MapObject *mapObj, int param { if (param2 != -1) { FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); - int v1 = MapObject_GetXPos(mapObj) + MapObject_GetDxFromDir(param2); - int v2 = MapObject_GetZPos(mapObj) + MapObject_GetDyFromDir(param2); + int v1 = MapObject_GetX(mapObj) + MapObject_GetDxFromDir(param2); + int v2 = MapObject_GetZ(mapObj) + MapObject_GetDyFromDir(param2); u8 v3 = FieldSystem_GetTileBehavior(fieldSystem, v1, v2); if (PlayerAvatar_GetPlayerState(playerAvatar) == PLAYER_STATE_CYCLING) { @@ -1962,8 +1962,8 @@ static int sub_02061058(PlayerAvatar *playerAvatar, MapObject *mapObj, int param { if ((param2 != -1) && PlayerAvatar_GetPlayerState(playerAvatar) == PLAYER_STATE_CYCLING) { FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); - int v1 = MapObject_GetXPos(mapObj) + MapObject_GetDxFromDir(param2); - int v2 = MapObject_GetZPos(mapObj) + MapObject_GetDyFromDir(param2); + int v1 = MapObject_GetX(mapObj) + MapObject_GetDxFromDir(param2); + int v2 = MapObject_GetZ(mapObj) + MapObject_GetDyFromDir(param2); u8 v3 = FieldSystem_GetTileBehavior(fieldSystem, v1, v2); if (sub_0206406C(mapObj, v3)) { @@ -1996,9 +1996,9 @@ static int sub_02061100(PlayerAvatar *playerAvatar, MapObject *mapObj, int param FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); if (sub_02071CB4(fieldSystem, 9) == 1) { - int x = MapObject_GetXPos(mapObj); - int y = MapObject_GetYPos(mapObj) / 2; - int z = MapObject_GetZPos(mapObj); + int x = MapObject_GetX(mapObj); + int y = MapObject_GetY(mapObj) / 2; + int z = MapObject_GetZ(mapObj); sub_02061674(playerAvatar, param2, &x, &y, &z); @@ -2024,9 +2024,9 @@ static int sub_02061180(PlayerAvatar *playerAvatar, MapObject *mapObj, int param if (sub_02071CB4(fieldSystem, 9) == 1) { BOOL v1; u32 v2; - int x = MapObject_GetXPos(mapObj); - int y = MapObject_GetYPos(mapObj) / 2; - int z = MapObject_GetZPos(mapObj); + int x = MapObject_GetX(mapObj); + int y = MapObject_GetY(mapObj) / 2; + int z = MapObject_GetZ(mapObj); sub_02061674(playerAvatar, param2, &x, &y, &z); @@ -2074,9 +2074,9 @@ static int sub_02061248(PlayerAvatar *playerAvatar, MapObject *mapObj, int param if (sub_02071CB4(fieldSystem, 9) == 1) { u32 v2; - int x = MapObject_GetXPos(mapObj); - int y = MapObject_GetYPos(mapObj) / 2; - int z = MapObject_GetZPos(mapObj); + int x = MapObject_GetX(mapObj); + int y = MapObject_GetY(mapObj) / 2; + int z = MapObject_GetZ(mapObj); sub_02061674(playerAvatar, param2, &x, &y, &z); @@ -2178,7 +2178,7 @@ int sub_020613AC(PlayerAvatar *playerAvatar) } { - int v1 = MapObject_AnimationCode(mapObj); + int v1 = MapObject_GetMovementAction(mapObj); if (sub_020613D8(v1) == 1) { return 1; @@ -2447,9 +2447,9 @@ u32 sub_020616F0(PlayerAvatar *playerAvatar, int param1) } else { MapObject *mapObj = Player_MapObject(playerAvatar); FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); - int x = MapObject_GetXPos(mapObj); - int y = MapObject_GetYPos(mapObj) / 2; - int z = MapObject_GetZPos(mapObj); + int x = MapObject_GetX(mapObj); + int y = MapObject_GetY(mapObj) / 2; + int z = MapObject_GetZ(mapObj); sub_02061674(playerAvatar, param1, &x, &y, &z); ov9_02251044(fieldSystem, x, y, z, &v0); @@ -2463,9 +2463,9 @@ u32 sub_02061760(PlayerAvatar *playerAvatar) u32 v0; MapObject *mapObj = Player_MapObject(playerAvatar); FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); - int x = MapObject_GetXPos(mapObj); - int y = MapObject_GetYPos(mapObj) / 2; - int z = MapObject_GetZPos(mapObj); + int x = MapObject_GetX(mapObj); + int y = MapObject_GetY(mapObj) / 2; + int z = MapObject_GetZ(mapObj); if (PlayerAvatar_DistortionGravityChanged(playerAvatar) == FALSE) { v0 = FieldSystem_GetTileBehavior(fieldSystem, x, z); @@ -2481,9 +2481,9 @@ void sub_020617BC(PlayerAvatar *const playerAvatar, int *xOut, int *yOut, int *z int v0 = sub_0205EAA0(playerAvatar); MapObject *mapObj = Player_MapObject(playerAvatar); - *xOut = MapObject_GetXPos(mapObj); - *yOut = MapObject_GetYPos(mapObj) / 2; - *zOut = MapObject_GetZPos(mapObj); + *xOut = MapObject_GetX(mapObj); + *yOut = MapObject_GetY(mapObj) / 2; + *zOut = MapObject_GetZ(mapObj); sub_02061674(playerAvatar, v0, xOut, yOut, zOut); } diff --git a/src/unk_0206450C.c b/src/unk_0206450C.c index 7aeadd5cd2..88e5e8e72e 100644 --- a/src/unk_0206450C.c +++ b/src/unk_0206450C.c @@ -229,7 +229,7 @@ void sub_020645C0(MapObject *mapObj) int v1 = sub_02065448(mapObj, v0->unk_04, -1); if (v1 != -1) { - MapObject_SetDir(mapObj, v1); + MapObject_TryFace(mapObj, v1); } else { switch (v0->unk_00) { case 0: @@ -237,7 +237,7 @@ void sub_020645C0(MapObject *mapObj) if (v0->unk_02 <= 0) { v0->unk_02 = sub_0206530C(Unk_020EEA88, -1); - MapObject_SetDir(mapObj, sub_02065330(v0->unk_04, -1)); + MapObject_TryFace(mapObj, sub_02065330(v0->unk_04, -1)); } } } @@ -296,7 +296,7 @@ void sub_02064690(MapObject *mapObj) sub_02062D10(mapObj); sub_02062D34(mapObj); - v0 = MapObject_Dir(mapObj); + v0 = MapObject_GetFacingDir(mapObj); v0 = sub_02065838(v0, 0x0); sub_02065668(mapObj, v0); @@ -320,7 +320,7 @@ void sub_02064690(MapObject *mapObj) v1->unk_00++; case 3: v0 = sub_02065330(v1->unk_0C, -1); - sub_020629A0(mapObj, v0); + MapObject_TryFaceAndTurn(mapObj, v0); if (v1->unk_04 == 1) { if (sub_0206489C(mapObj, v0) == 0) { @@ -365,11 +365,11 @@ static void sub_020647A0(MapObject *mapObj, UnkStruct_020647A0 *param1) { int v0, v1, v2, v3, v4; - v1 = MapObject_XInitial(mapObj); - v2 = MapObject_ZInitial(mapObj); - v3 = MapObject_MaxXOffset(mapObj); - v4 = MapObject_MaxZOffset(mapObj); - v0 = MapObject_GetMoveCode(mapObj); + v1 = MapObject_GetXInitial(mapObj); + v2 = MapObject_GetZInitial(mapObj); + v3 = MapObject_GetMovementRangeX(mapObj); + v4 = MapObject_GetMovementRangeZ(mapObj); + v0 = MapObject_GetMovementType(mapObj); switch (v0) { case 0x6: @@ -432,8 +432,8 @@ static int sub_0206489C(MapObject *mapObj, int param1) sub_020647A0(mapObj, &v2); - v0 = MapObject_GetXPos(mapObj) + MapObject_GetDxFromDir(param1); - v1 = MapObject_GetZPos(mapObj) + MapObject_GetDyFromDir(param1); + v0 = MapObject_GetX(mapObj) + MapObject_GetDxFromDir(param1); + v1 = MapObject_GetZ(mapObj) + MapObject_GetDyFromDir(param1); if ((v2.unk_00 > v0) || (v2.unk_08 < v0)) { return 0; @@ -466,7 +466,7 @@ void sub_02064918(MapObject *mapObj) switch (v0->unk_04) { case 0: - MapObject_SetDir(mapObj, v0->unk_00); + MapObject_TryFace(mapObj, v0->unk_00); v0->unk_04++; break; case 1: @@ -532,7 +532,7 @@ static int sub_020649CC(MapObject *mapObj, UnkStruct_0206496C *param1) int v0 = sub_02065448(mapObj, 38, -1); if (v0 == -1) { - v0 = MapObject_Dir(mapObj); + v0 = MapObject_GetFacingDir(mapObj); } v0 = sub_02065838(v0, 0x0); @@ -585,7 +585,7 @@ static int sub_02064A58(MapObject *mapObj, UnkStruct_0206496C *param1) v2 = v4; } - v1 = MapObject_Dir(mapObj); + v1 = MapObject_GetFacingDir(mapObj); for (v0 = 0; v2[v0] != -1; v0++) { if (v1 == v2[v0]) { @@ -603,7 +603,7 @@ static int sub_02064A58(MapObject *mapObj, UnkStruct_0206496C *param1) v1 = v2[v0]; - MapObject_SetDir(mapObj, v1); + MapObject_TryFace(mapObj, v1); param1->unk_02 = 0; return 1; @@ -634,7 +634,7 @@ void sub_02064AFC(MapObject *mapObj) static int sub_02064B20(MapObject *mapObj, UnkStruct_0206496C *param1) { - int v0 = MapObject_Dir(mapObj); + int v0 = MapObject_GetFacingDir(mapObj); v0 = sub_02065838(v0, 0x0); sub_02065668(mapObj, v0); @@ -679,7 +679,7 @@ static int sub_02064B74(MapObject *mapObj, UnkStruct_0206496C *param1) v2 = v4; } - v1 = MapObject_Dir(mapObj); + v1 = MapObject_GetFacingDir(mapObj); for (v0 = 0; v2[v0] != -1; v0++) { if (v1 == v2[v0]) { @@ -697,11 +697,11 @@ static int sub_02064B74(MapObject *mapObj, UnkStruct_0206496C *param1) v1 = v2[v0]; - MapObject_SetDir(mapObj, v1); + MapObject_TryFace(mapObj, v1); { - int v5 = MapObject_Dir(mapObj); - int v6 = sub_02062968(mapObj); + int v5 = MapObject_GetFacingDir(mapObj); + int v6 = MapObject_GetInitialDir(mapObj); if (v5 == v6) { param1->unk_00 = Direction_GetOpposite(param1->unk_00); @@ -743,16 +743,16 @@ static int sub_02064C6C(MapObject *mapObj, UnkStruct_02064C28 *param1) { int v0; - v0 = sub_02062968(mapObj); + v0 = MapObject_GetInitialDir(mapObj); if (param1->unk_02 == 1) { v0 = Direction_GetOpposite(v0); } - sub_02062994(mapObj, v0); + MapObject_Turn(mapObj, v0); if (sub_0206553C(mapObj) == 0) { - MapObject_SetDir(mapObj, v0); + MapObject_TryFace(mapObj, v0); } param1->unk_00 = 1; @@ -764,18 +764,18 @@ static int sub_02064CA8(MapObject *mapObj, UnkStruct_02064C28 *param1) if (param1->unk_02) { int v0, v1, v2, v3; - v0 = MapObject_XInitial(mapObj); - v1 = MapObject_ZInitial(mapObj); - v2 = MapObject_GetXPos(mapObj); - v3 = MapObject_GetZPos(mapObj); + v0 = MapObject_GetXInitial(mapObj); + v1 = MapObject_GetZInitial(mapObj); + v2 = MapObject_GetX(mapObj); + v3 = MapObject_GetZ(mapObj); if ((v0 == v2) && (v1 == v3)) { - int v4 = Direction_GetOpposite(MapObject_GetMoveDir(mapObj)); + int v4 = Direction_GetOpposite(MapObject_GetMovingDir(mapObj)); - sub_02062994(mapObj, v4); + MapObject_Turn(mapObj, v4); if (sub_0206553C(mapObj) == 0) { - MapObject_SetDir(mapObj, v4); + MapObject_TryFace(mapObj, v4); } param1->unk_02 = 0; @@ -786,7 +786,7 @@ static int sub_02064CA8(MapObject *mapObj, UnkStruct_02064C28 *param1) int v5, v6; u32 v7; - v5 = MapObject_GetMoveDir(mapObj); + v5 = MapObject_GetMovingDir(mapObj); v7 = sub_02063EBC(mapObj, v5); if (v7 & (1 << 0)) { @@ -945,15 +945,15 @@ static int sub_02064EEC(MapObject *mapObj, UnkStruct_02064D98 *param1) { if (param1->unk_01 == param1->unk_02) { if (param1->unk_03 == 0) { - int v0 = MapObject_XInitial(mapObj); - int v1 = MapObject_GetXPos(mapObj); + int v0 = MapObject_GetXInitial(mapObj); + int v1 = MapObject_GetX(mapObj); if (v0 == v1) { param1->unk_01++; } } else { - int v2 = MapObject_ZInitial(mapObj); - int v3 = MapObject_GetZPos(mapObj); + int v2 = MapObject_GetZInitial(mapObj); + int v3 = MapObject_GetZ(mapObj); if (v2 == v3) { param1->unk_01++; @@ -962,10 +962,10 @@ static int sub_02064EEC(MapObject *mapObj, UnkStruct_02064D98 *param1) } if (param1->unk_01 == 3) { - int v4 = MapObject_XInitial(mapObj); - int v5 = MapObject_ZInitial(mapObj); - int v6 = MapObject_GetXPos(mapObj); - int v7 = MapObject_GetZPos(mapObj); + int v4 = MapObject_GetXInitial(mapObj); + int v5 = MapObject_GetZInitial(mapObj); + int v6 = MapObject_GetX(mapObj); + int v7 = MapObject_GetZ(mapObj); if ((v4 == v6) && (v5 == v7)) { param1->unk_01 = 0; @@ -980,10 +980,10 @@ static int sub_02064EEC(MapObject *mapObj, UnkStruct_02064D98 *param1) v8 = sub_02065358(param1->unk_04); v9 = v8[param1->unk_01]; - sub_02062994(mapObj, v9); + MapObject_Turn(mapObj, v9); if (sub_0206553C(mapObj) == 0) { - MapObject_SetDir(mapObj, v9); + MapObject_TryFace(mapObj, v9); } v11 = sub_02063EBC(mapObj, v9); @@ -992,10 +992,10 @@ static int sub_02064EEC(MapObject *mapObj, UnkStruct_02064D98 *param1) param1->unk_01++; v9 = v8[param1->unk_01]; - sub_02062994(mapObj, v9); + MapObject_Turn(mapObj, v9); if (sub_0206553C(mapObj) == 0) { - MapObject_SetDir(mapObj, v9); + MapObject_TryFace(mapObj, v9); } v11 = sub_02063EBC(mapObj, v9); @@ -1120,11 +1120,11 @@ static void sub_02065100(UnkStruct_0206502C *param0) static int sub_02065124(MapObject *mapObj, UnkStruct_0206502C *param1) { - if (MapObject_GetEventType(mapObj) == 0xa) { + if (MapObject_GetTrainerType(mapObj) == 0xa) { FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); PlayerAvatar *playerAvatar = sub_0205EF3C(fieldSystem); - int v2 = MapObject_Dir(mapObj); - int v3 = sub_020629D8(mapObj, 0); + int v2 = MapObject_GetFacingDir(mapObj); + int v3 = MapObject_GetDataAt(mapObj, 0); int v4 = sub_02067D58(mapObj, playerAvatar, v2, v3); if (v4 != -1) { @@ -1156,15 +1156,15 @@ static int sub_020651A4(MapObject *mapObj, UnkStruct_0206502C *param1) { if (param1->unk_01 == param1->unk_02) { if (param1->unk_03 == 0) { - int v0 = MapObject_XInitial(mapObj); - int v1 = MapObject_GetXPos(mapObj); + int v0 = MapObject_GetXInitial(mapObj); + int v1 = MapObject_GetX(mapObj); if (v0 == v1) { sub_02065100(param1); } } else { - int v2 = MapObject_ZInitial(mapObj); - int v3 = MapObject_GetZPos(mapObj); + int v2 = MapObject_GetZInitial(mapObj); + int v3 = MapObject_GetZ(mapObj); if (v2 == v3) { sub_02065100(param1); @@ -1173,10 +1173,10 @@ static int sub_020651A4(MapObject *mapObj, UnkStruct_0206502C *param1) } if (param1->unk_01 == 3) { - int v4 = MapObject_XInitial(mapObj); - int v5 = MapObject_ZInitial(mapObj); - int v6 = MapObject_GetXPos(mapObj); - int v7 = MapObject_GetZPos(mapObj); + int v4 = MapObject_GetXInitial(mapObj); + int v5 = MapObject_GetZInitial(mapObj); + int v6 = MapObject_GetX(mapObj); + int v7 = MapObject_GetZ(mapObj); if ((v4 == v6) && (v5 == v7)) { param1->unk_01 = 0; @@ -1191,10 +1191,10 @@ static int sub_020651A4(MapObject *mapObj, UnkStruct_0206502C *param1) v8 = sub_02065358(param1->unk_04); v9 = v8[param1->unk_01]; - sub_02062994(mapObj, v9); + MapObject_Turn(mapObj, v9); if (sub_0206553C(mapObj) == 0) { - MapObject_SetDir(mapObj, v9); + MapObject_TryFace(mapObj, v9); } v11 = sub_02063EBC(mapObj, v9); @@ -1203,10 +1203,10 @@ static int sub_020651A4(MapObject *mapObj, UnkStruct_0206502C *param1) sub_02065100(param1); v9 = v8[param1->unk_01]; - sub_02062994(mapObj, v9); + MapObject_Turn(mapObj, v9); if (sub_0206553C(mapObj) == 0) { - MapObject_SetDir(mapObj, v9); + MapObject_TryFace(mapObj, v9); } v11 = sub_02063EBC(mapObj, v9); @@ -1295,7 +1295,7 @@ static const int *sub_02065358(int param0) static int sub_0206537C(MapObject *mapObj) { - int v0 = MapObject_GetEventType(mapObj); + int v0 = MapObject_GetTrainerType(mapObj); if ((v0 != 0x1) && (v0 != 0x2)) { return -1; @@ -1312,7 +1312,7 @@ static int sub_0206537C(MapObject *mapObj) { int v3, v4 = 0; - v0 = MapObject_GetMoveCode(mapObj); + v0 = MapObject_GetMovementType(mapObj); do { v3 = Unk_020EEAD0[v4++]; @@ -1340,9 +1340,9 @@ static int sub_0206537C(MapObject *mapObj) { int v8 = Player_GetXPos(playerAvatar); int v9 = Player_GetZPos(playerAvatar); - int v10 = sub_020629D8(mapObj, 0); - int v11 = MapObject_GetXPos(mapObj); - int v12 = MapObject_GetZPos(mapObj); + int v10 = MapObject_GetDataAt(mapObj, 0); + int v11 = MapObject_GetX(mapObj); + int v12 = MapObject_GetZ(mapObj); int v13 = v11 - v10; int v14 = v11 + v10; int v15 = v12 - v10; @@ -1390,8 +1390,8 @@ static int sub_02065448(MapObject *mapObj, int param1, int param2) { int v4 = -1, v5 = -1; - int v6 = MapObject_GetXPos(mapObj); - int v7 = MapObject_GetZPos(mapObj); + int v6 = MapObject_GetX(mapObj); + int v7 = MapObject_GetZ(mapObj); FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); PlayerAvatar *playerAvatar = sub_0205EF3C(fieldSystem); int v10 = Player_GetXPos(playerAvatar); @@ -1454,7 +1454,7 @@ static const int Unk_020EEAB0[2][4] = { static int sub_0206553C(MapObject *mapObj) { - int v0 = MapObject_GetEventType(mapObj); + int v0 = MapObject_GetTrainerType(mapObj); if ((v0 == 0x7) || (v0 == 0x8)) { return 1; @@ -1465,7 +1465,7 @@ static int sub_0206553C(MapObject *mapObj) static void sub_02065550(MapObject *mapObj, UnkStruct_02065550 *param1) { - if (MapObject_GetEventType(mapObj) == 0x7) { + if (MapObject_GetTrainerType(mapObj) == 0x7) { param1->unk_01 = 0; } else { param1->unk_01 = 1; @@ -1474,7 +1474,7 @@ static void sub_02065550(MapObject *mapObj, UnkStruct_02065550 *param1) static void sub_02065568(MapObject *mapObj, UnkStruct_02065550 *param1) { - int v0, v1 = MapObject_Dir(mapObj); + int v0, v1 = MapObject_GetFacingDir(mapObj); for (v0 = 0; (v0 < 4 && v1 != Unk_020EEAB0[param1->unk_01][v0]); v0++) { (void)0; @@ -1487,20 +1487,20 @@ static void sub_02065568(MapObject *mapObj, UnkStruct_02065550 *param1) v0 = (v0 + 1) % 4; v1 = Unk_020EEAB0[param1->unk_01][v0]; - if (MapObject_CheckStatus(mapObj, (1 << 7))) { + if (MapObject_CheckStatus(mapObj, MAP_OBJ_STATUS_LOCK_DIR)) { param1->unk_02 = 1; } else { param1->unk_02 = 0; } - MapObject_SetDir(mapObj, v1); - MapObject_SetStatusFlagOn(mapObj, (1 << 7)); + MapObject_TryFace(mapObj, v1); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_LOCK_DIR); } static void sub_020655E4(MapObject *mapObj, UnkStruct_02065550 *param1) { if (param1->unk_02 == 0) { - MapObject_SetStatusFlagOff(mapObj, (1 << 7)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_LOCK_DIR); } } diff --git a/src/unk_020655F4.c b/src/unk_020655F4.c index 2dada57185..2a9839ee1e 100644 --- a/src/unk_020655F4.c +++ b/src/unk_020655F4.c @@ -122,15 +122,15 @@ static const fx32 Unk_020EECEC[3]; int LocalMapObj_IsAnimationSet(const MapObject *mapObj) { - if (MapObject_GetStateFlag(mapObj, (1 << 0)) == 0) { + if (!MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_0)) { return 0; } - if (MapObject_GetStateFlag(mapObj, (1 << 1)) == 1) { + if (MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_1) == 1) { return 0; } - if ((MapObject_GetStateFlag(mapObj, (1 << 4)) == 1) && (MapObject_GetStateFlag(mapObj, (1 << 5)) == 0)) { + if (MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_4) == 1 && !MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_5)) { return 0; } @@ -141,26 +141,26 @@ void LocalMapObj_SetAnimationCode(MapObject *mapObj, int param1) { GF_ASSERT(param1 < 0x9a); - MapObject_SetAnimationCode(mapObj, param1); + MapObject_SetMovementAction(mapObj, param1); sub_02062BC0(mapObj, 0); - MapObject_SetStatusFlagOn(mapObj, (1 << 4)); - MapObject_SetStatusFlagOff(mapObj, (1 << 5)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_4); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_5); } void sub_02065668(MapObject *mapObj, int param1) { - MapObject_SetAnimationCode(mapObj, param1); + MapObject_SetMovementAction(mapObj, param1); sub_02062BC0(mapObj, 0); - MapObject_SetStatusFlagOff(mapObj, (1 << 5)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_5); } int LocalMapObj_CheckAnimationFinished(const MapObject *mapObj) { - if (MapObject_GetStateFlag(mapObj, (1 << 4)) == 0) { + if (!MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_4)) { return 1; } - if (MapObject_GetStateFlag(mapObj, (1 << 5)) == 0) { + if (!MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_5)) { return 0; } @@ -169,24 +169,24 @@ int LocalMapObj_CheckAnimationFinished(const MapObject *mapObj) int sub_020656AC(MapObject *mapObj) { - if (MapObject_GetStateFlag(mapObj, (1 << 4)) == 0) { + if (!MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_4)) { return 1; } - if (MapObject_GetStateFlag(mapObj, (1 << 5)) == 0) { + if (!MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_5)) { return 0; } - MapObject_SetStatusFlagOff(mapObj, (1 << 4) | (1 << 5)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_4 | MAP_OBJ_STATUS_5); return 1; } void sub_020656DC(MapObject *mapObj) { - MapObject_SetStatusFlagOff(mapObj, (1 << 4)); - MapObject_SetStatusFlagOn(mapObj, (1 << 5)); - MapObject_SetAnimationCode(mapObj, 0xff); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_4); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_5); + MapObject_SetMovementAction(mapObj, 0xff); sub_02062BC0(mapObj, 0); } @@ -387,7 +387,7 @@ void sub_020658B4(MapObject *mapObj) int v0, v1; do { - v0 = MapObject_AnimationCode(mapObj); + v0 = MapObject_GetMovementAction(mapObj); if (v0 == 0xff) { break; @@ -401,12 +401,12 @@ int sub_020658DC(MapObject *mapObj) { sub_020658B4(mapObj); - if (MapObject_GetStateFlag(mapObj, (1 << 5)) == 0) { + if (!MapObject_CheckStatusFlag(mapObj, MAP_OBJ_STATUS_5)) { return 0; } - MapObject_SetStatusFlagOff(mapObj, (1 << 5)); - MapObject_SetAnimationCode(mapObj, 0xff); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_5); + MapObject_SetMovementAction(mapObj, 0xff); sub_02062BC0(mapObj, 0); return 1; @@ -419,13 +419,13 @@ static int sub_02065910(MapObject *mapObj, int param1, int param2) static int sub_02065924(MapObject *mapObj) { - MapObject_SetStatusFlagOn(mapObj, (1 << 5)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_5); return 0; } static void sub_02065930(MapObject *mapObj, int param1) { - MapObject_SetDir(mapObj, param1); + MapObject_TryFace(mapObj, param1); sub_02062A0C(mapObj, 0x0); sub_02064208(mapObj); sub_02062BC8(mapObj); @@ -467,9 +467,9 @@ static void sub_02065980(MapObject *mapObj, int param1, fx32 param2, s16 param3, v0->unk_08 = param2; sub_020641B4(mapObj, param1); - sub_020629A0(mapObj, param1); + MapObject_TryFaceAndTurn(mapObj, param1); sub_02062A0C(mapObj, param4); - MapObject_SetStatusFlagOn(mapObj, (1 << 2)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_START_MOVEMENT); sub_02062BC8(mapObj); } @@ -488,7 +488,7 @@ static int sub_020659C8(MapObject *mapObj) return 0; } - MapObject_SetStatusFlagOn(mapObj, (1 << 3) | (1 << 5)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_END_MOVEMENT | MAP_OBJ_STATUS_5); sub_02064208(mapObj); sub_02062B68(mapObj); sub_02062A0C(mapObj, 0x0); @@ -674,7 +674,7 @@ static void sub_02065C64(MapObject *mapObj, int param1, s16 param2, u16 param3) v0->unk_00 = param3; v0->unk_02 = param2 + 1; - MapObject_SetDir(mapObj, param1); + MapObject_TryFace(mapObj, param1); sub_02062A0C(mapObj, param3); sub_02064208(mapObj); sub_02062BC8(mapObj); @@ -691,7 +691,7 @@ static int sub_02065C98(MapObject *mapObj) return 0; } - MapObject_SetStatusFlagOn(mapObj, (1 << 5)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_5); sub_02062A0C(mapObj, 0x0); sub_02062BC8(mapObj); @@ -837,8 +837,8 @@ static void sub_02065E0C(MapObject *mapObj, int param1, fx32 param2, s16 param3, sub_020641B4(mapObj, param1); } - MapObject_SetStatusFlagOn(mapObj, (1 << 2) | (1 << 16)); - sub_020629A0(mapObj, param1); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_START_MOVEMENT | MAP_OBJ_STATUS_16); + MapObject_TryFaceAndTurn(mapObj, param1); sub_02062A0C(mapObj, param4); sub_02062BC8(mapObj); @@ -865,7 +865,7 @@ static int sub_02065EA0(MapObject *mapObj) if (v0->unk_04 >= (16 * FX32_ONE)) { v0->unk_04 = 0; sub_020641B4(mapObj, v0->unk_0C); - MapObject_SetStatusFlagOn(mapObj, (1 << 2)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_START_MOVEMENT); } { @@ -910,7 +910,7 @@ static int sub_02065EA0(MapObject *mapObj) sub_02063088(mapObj, &v5); } - MapObject_SetStatusFlagOn(mapObj, (1 << 3) | (1 << 17) | (1 << 5)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_END_MOVEMENT | MAP_OBJ_STATUS_17 | MAP_OBJ_STATUS_5); sub_02064208(mapObj); sub_02062B68(mapObj); sub_02062A0C(mapObj, 0x0); @@ -1213,7 +1213,7 @@ static int sub_020663D0(MapObject *mapObj) static int sub_02066418(MapObject *mapObj) { - MapObject_SetStatusFlagOn(mapObj, (1 << 9)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_HIDE); sub_02062BC8(mapObj); return 1; @@ -1229,7 +1229,7 @@ static int sub_02066430(MapObject *mapObj) static int sub_02066448(MapObject *mapObj) { - MapObject_SetStatusFlagOn(mapObj, (1 << 7)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_LOCK_DIR); sub_02062BC8(mapObj); return 1; @@ -1237,7 +1237,7 @@ static int sub_02066448(MapObject *mapObj) static int sub_0206645C(MapObject *mapObj) { - MapObject_SetStatusFlagOff(mapObj, (1 << 7)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_LOCK_DIR); sub_02062BC8(mapObj); return 1; @@ -1245,7 +1245,7 @@ static int sub_0206645C(MapObject *mapObj) static int sub_02066470(MapObject *mapObj) { - MapObject_SetStatusFlagOn(mapObj, (1 << 8)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_PAUSE_ANIMATION); sub_02062BC8(mapObj); return 1; @@ -1253,7 +1253,7 @@ static int sub_02066470(MapObject *mapObj) static int sub_02066488(MapObject *mapObj) { - MapObject_SetStatusFlagOff(mapObj, (1 << 8)); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_PAUSE_ANIMATION); sub_02062BC8(mapObj); return 1; @@ -1315,9 +1315,9 @@ static void sub_02066520(MapObject *mapObj, int param1, s16 param2, u16 param3) v0->unk_04 = param2; sub_020641B4(mapObj, param1); - sub_020629A0(mapObj, param1); + MapObject_TryFaceAndTurn(mapObj, param1); sub_02062A0C(mapObj, param3); - MapObject_SetStatusFlagOn(mapObj, (1 << 2)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_START_MOVEMENT); sub_02062BC8(mapObj); } @@ -1336,7 +1336,7 @@ static int sub_02066560(MapObject *mapObj, const fx32 *param1) return 0; } - MapObject_SetStatusFlagOn(mapObj, (1 << 3) | (1 << 5)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_END_MOVEMENT | MAP_OBJ_STATUS_5); sub_02064208(mapObj); sub_02062B68(mapObj); sub_02062A0C(mapObj, 0x0); @@ -1461,7 +1461,7 @@ static int sub_020666E4(MapObject *mapObj) v0->unk_00++; if (v0->unk_00 >= 8) { - MapObject_SetDir(mapObj, 1); + MapObject_TryFace(mapObj, 1); sub_02062A0C(mapObj, 0x0); sub_02062BC8(mapObj); } @@ -1488,8 +1488,8 @@ static int sub_02066710(MapObject *mapObj) ov5_021F3F10(mapObj); - MapObject_SetStatusFlagOn(mapObj, (1 << 2) | (1 << 16)); - MapObject_SetStatusFlagOff(mapObj, (1 << 20)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_START_MOVEMENT | MAP_OBJ_STATUS_16); + MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_HIDE_SHADOW); sub_02062BC8(mapObj); return 0; @@ -1513,7 +1513,7 @@ static int sub_02066764(MapObject *mapObj) v2.y = 0; sub_02063088(mapObj, &v2); - MapObject_SetStatusFlagOn(mapObj, (1 << 3) | (1 << 17) | (1 << 5)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_END_MOVEMENT | MAP_OBJ_STATUS_17 | MAP_OBJ_STATUS_5); sub_0206A230(mapObj); sub_02062BC8(mapObj); @@ -1562,14 +1562,14 @@ static void sub_02066824(MapObject *mapObj, const VecFx32 *param1, int param2, i v0->unk_00 = param4; v0->unk_04 = *param1; - MapObject_SetDir(mapObj, param2); - sub_02062994(mapObj, param3); + MapObject_TryFace(mapObj, param2); + MapObject_Turn(mapObj, param3); sub_02062A0C(mapObj, param5); sub_02062D28(mapObj); - MapObject_SetXPosPrev(mapObj, MapObject_GetXPos(mapObj)); - MapObject_SetYPosPrev(mapObj, MapObject_GetYPos(mapObj)); - MapObject_SetZPosPrev(mapObj, MapObject_GetZPos(mapObj)); + MapObject_SetXPrev(mapObj, MapObject_GetX(mapObj)); + MapObject_SetYPrev(mapObj, MapObject_GetY(mapObj)); + MapObject_SetZPrev(mapObj, MapObject_GetZ(mapObj)); if (param1->x < 0) { MapObject_AddX(mapObj, -1); @@ -1606,7 +1606,7 @@ static int sub_020668EC(MapObject *mapObj) } MapObject_SetStatusFlagOn( - mapObj, (1 << 3) | (1 << 5)); + mapObj, MAP_OBJ_STATUS_END_MOVEMENT | MAP_OBJ_STATUS_5); sub_02064208(mapObj); sub_02062B68(mapObj); @@ -1886,14 +1886,14 @@ static void sub_02066F88(MapObject *mapObj, fx32 param1, int param2, int param3, v1->unk_03 = param8; v1->unk_0E = (0x100 * 16) / v1->unk_00; - MapObject_SetDir(mapObj, param2); - sub_02062994(mapObj, param3); + MapObject_TryFace(mapObj, param2); + MapObject_Turn(mapObj, param3); sub_02062A0C(mapObj, param5); sub_02062D28(mapObj); - MapObject_SetXPosPrev(mapObj, MapObject_GetXPos(mapObj)); - MapObject_SetYPosPrev(mapObj, MapObject_GetYPos(mapObj)); - MapObject_SetZPosPrev(mapObj, MapObject_GetZPos(mapObj)); + MapObject_SetXPrev(mapObj, MapObject_GetX(mapObj)); + MapObject_SetYPrev(mapObj, MapObject_GetY(mapObj)); + MapObject_SetZPrev(mapObj, MapObject_GetZ(mapObj)); GF_ASSERT(param6 <= 2); @@ -1933,7 +1933,7 @@ static int sub_02067068(MapObject *mapObj) UnkStruct_02066F88 *v2; v2 = sub_02062AC8(mapObj); - MapObject_PosVectorOut(mapObj, &v1); + MapObject_GetPosPtr(mapObj, &v1); switch (v2->unk_02) { case 0: @@ -1947,7 +1947,7 @@ static int sub_02067068(MapObject *mapObj) break; } - MapObject_SetPosVec(mapObj, &v1); + MapObject_SetPos(mapObj, &v1); v0 = v2->unk_04; @@ -1996,9 +1996,9 @@ static int sub_02067068(MapObject *mapObj) v2->unk_08 -= (16 * FX32_ONE); v0 = v2->unk_04; - MapObject_SetXPosPrev(mapObj, MapObject_GetXPos(mapObj)); - MapObject_SetYPosPrev(mapObj, MapObject_GetYPos(mapObj)); - MapObject_SetZPosPrev(mapObj, MapObject_GetZPos(mapObj)); + MapObject_SetXPrev(mapObj, MapObject_GetX(mapObj)); + MapObject_SetYPrev(mapObj, MapObject_GetY(mapObj)); + MapObject_SetZPrev(mapObj, MapObject_GetZ(mapObj)); switch (v2->unk_02) { case 0: @@ -2034,7 +2034,7 @@ static int sub_02067068(MapObject *mapObj) sub_02063088(mapObj, &v7); } - MapObject_SetStatusFlagOn(mapObj, (1 << 3) | (1 << 17) | (1 << 5)); + MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_END_MOVEMENT | MAP_OBJ_STATUS_17 | MAP_OBJ_STATUS_5); sub_02064208(mapObj); sub_02062B68(mapObj); sub_02062A0C(mapObj, 0x0); diff --git a/src/unk_020673B8.c b/src/unk_020673B8.c index 4d50a9e2c2..0378b1ea1b 100644 --- a/src/unk_020673B8.c +++ b/src/unk_020673B8.c @@ -72,34 +72,34 @@ int sub_020673C0(MapObject *param0) static void sub_020673E4(MapObject *param0) { - int v0 = MapObject_GetEventType(param0); + int v0 = MapObject_GetTrainerType(param0); Unk_020EF630[v0](param0); } static int sub_02067400(MapObject *param0) { - int v0 = MapObject_GetEventType(param0); + int v0 = MapObject_GetTrainerType(param0); return Unk_020EF660[v0](param0); } static int sub_0206741C(MapObject *param0) { - int v0 = MapObject_GetEventType(param0); + int v0 = MapObject_GetTrainerType(param0); return Unk_020EF690[v0](param0); } static int sub_02067438(MapObject *param0) { - int v0 = MapObject_GetXPos(param0); - int v1 = MapObject_XPosPrev(param0); + int v0 = MapObject_GetX(param0); + int v1 = MapObject_GetXPrev(param0); if (v0 != v1) { return 1; } - v0 = MapObject_GetZPos(param0); - v1 = MapObject_ZPosPrev(param0); + v0 = MapObject_GetZ(param0); + v1 = MapObject_GetZPrev(param0); if (v0 != v1) { return 1; @@ -110,15 +110,15 @@ static int sub_02067438(MapObject *param0) static int sub_0206746C(MapObject *param0) { - int v0 = MapObject_GetXPos(param0); - int v1 = MapObject_XPosPrev(param0); + int v0 = MapObject_GetX(param0); + int v1 = MapObject_GetXPrev(param0); if (v0 != v1) { return 0; } - v0 = MapObject_GetZPos(param0); - v1 = MapObject_ZPosPrev(param0); + v0 = MapObject_GetZ(param0); + v1 = MapObject_GetZPrev(param0); if (v0 != v1) { return 0; @@ -147,7 +147,7 @@ static void sub_020674AC(MapObject *param0) UnkStruct_020674AC *v0; v0 = sub_02062A7C(param0, (sizeof(UnkStruct_020674AC))); - v0->unk_03 = sub_020629D8(param0, 1); + v0->unk_03 = MapObject_GetDataAt(param0, 1); } static int sub_020674C4(MapObject *param0) @@ -199,7 +199,7 @@ static int sub_02067540(MapObject *param0) switch (v0->unk_01) { case 0: { int v1[4] = { 0, 0, 1, 1 }; - int v2 = MapObject_Dir(param0); + int v2 = MapObject_GetFacingDir(param0); v0->unk_04 = v2; v0->unk_05 = v1[v2]; @@ -239,7 +239,7 @@ static int sub_02067540(MapObject *param0) return 1; } - MapObject_SetDir(param0, v0->unk_04); + MapObject_TryFace(param0, v0->unk_04); v0->unk_01++; v0->unk_07 = 0; @@ -256,9 +256,9 @@ static void sub_0206762C(MapObject *param0) UnkStruct_0206762C *v1; v1 = sub_02062A7C(param0, (sizeof(UnkStruct_0206762C))); - v1->unk_03 = sub_020629D8(param0, 1); + v1->unk_03 = MapObject_GetDataAt(param0, 1); - v0 = MapObject_GetEventType(param0); + v0 = MapObject_GetTrainerType(param0); if (v0 == 0x5) { v0 = 0; @@ -322,7 +322,7 @@ static int sub_020676D4(MapObject *param0) switch (v0->unk_01) { case 0: { - int v2, v3 = MapObject_Dir(param0); + int v2, v3 = MapObject_GetFacingDir(param0); for (v2 = 0; (v2 < 4 && v3 != v1[v0->unk_05][v2]); v2++) { (void)0; @@ -364,7 +364,7 @@ static int sub_020676D4(MapObject *param0) return 1; } - MapObject_SetDir(param0, v0->unk_04); + MapObject_TryFace(param0, v0->unk_04); v0->unk_01++; v0->unk_07 = 0; v0->unk_00 = 0; diff --git a/src/unk_020677F4.c b/src/unk_020677F4.c index 74c0a1e6b1..ddb625af1f 100644 --- a/src/unk_020677F4.c +++ b/src/unk_020677F4.c @@ -162,7 +162,7 @@ void sub_02067968(MapObject *param0) } ov5_021ECFD8(param0, &v0->unk_08, v0->unk_00); - MapObject_SetStatusFlagOn(param0, (1 << 21)); + MapObject_SetStatusFlagOn(param0, MAP_OBJ_STATUS_21); } void sub_02067998(MapObject *param0) @@ -177,7 +177,7 @@ void sub_02067998(MapObject *param0) if (v0->unk_00 != 0xffff) { ov5_021ECEB4(param0, &v0->unk_08, v0->unk_00); } else { - MapObject_SetStatusFlagOff(param0, (1 << 21)); + MapObject_SetStatusFlagOff(param0, MAP_OBJ_STATUS_21); } ov5_021F20D4(param0); @@ -186,7 +186,7 @@ void sub_02067998(MapObject *param0) if (v0->unk_08 != NULL) { ov5_021ED03C(v0->unk_08, &v0->unk_0C); ov5_021EDEB4(param0, v0->unk_08); - MapObject_SetStatusFlagOff(param0, (1 << 21)); + MapObject_SetStatusFlagOff(param0, MAP_OBJ_STATUS_21); } } @@ -225,7 +225,7 @@ UnkStruct_020216E0 *sub_02067A58(MapObject *param0) { UnkStruct_020216E0 *v0 = NULL; - GF_ASSERT(sub_020677F4(sub_02062920(param0))); + GF_ASSERT(sub_020677F4(MapObject_GetGraphicsID(param0))); if (sub_02062D4C(param0) == 1) { UnkStruct_02067870 *v1 = sub_02062AF0(param0); diff --git a/src/unk_02067A84.c b/src/unk_02067A84.c index 5151fc8168..e322a4e7f8 100644 --- a/src/unk_02067A84.c +++ b/src/unk_02067A84.c @@ -142,7 +142,7 @@ static void sub_02067C28(UnkStruct_02067C28 *param0, MapObject *param1, int para { param0->unk_00 = param2; param0->unk_04 = param3; - param0->unk_08 = MapObject_GetEventID(param1); + param0->unk_08 = MapObject_GetScript(param1); param0->unk_0C = Script_GetTrainerID(param0->unk_08); param0->unk_10 = Script_IsTrainerDoubleBattle(param0->unk_0C); param0->unk_14 = param1; @@ -150,7 +150,7 @@ static void sub_02067C28(UnkStruct_02067C28 *param0, MapObject *param1, int para static int sub_02067C54(const MapObject *param0) { - int v0 = MapObject_GetEventType(param0); + int v0 = MapObject_GetTrainerType(param0); switch (v0) { case 0x4: @@ -174,8 +174,8 @@ static int sub_02067C80(const MapObject *param0, PlayerAvatar *playerAvatar, int if (v0 == 0x1) { v3 = Player_GetXPos(playerAvatar); v4 = Player_GetZPos(playerAvatar); - v2 = MapObject_Dir(param0); - v1 = sub_020629D8(param0, 0); + v2 = MapObject_GetFacingDir(param0); + v1 = MapObject_GetDataAt(param0, 0); v5 = sub_02067DA8(param0, v2, v1, v3, v4, 0); if (v5 != -1) { @@ -191,7 +191,7 @@ static int sub_02067C80(const MapObject *param0, PlayerAvatar *playerAvatar, int if (v0 == 0x2) { v3 = Player_GetXPos(playerAvatar); v4 = Player_GetZPos(playerAvatar); - v1 = sub_020629D8(param0, 0); + v1 = MapObject_GetDataAt(param0, 0); v2 = 0; do { @@ -237,10 +237,10 @@ static int sub_02067DC4(const MapObject *mapObj, int param1, int param2, int par { int v0, v1; - v0 = MapObject_GetXPos(mapObj); + v0 = MapObject_GetX(mapObj); if (v0 == param2) { - v1 = MapObject_GetZPos(mapObj); + v1 = MapObject_GetZ(mapObj); if ((param3 < v1) && (param3 >= (v1 - param1))) { return v1 - param3; @@ -254,10 +254,10 @@ static int sub_02067DF0(const MapObject *mapObj, int param1, int param2, int par { int v0, v1; - v0 = MapObject_GetXPos(mapObj); + v0 = MapObject_GetX(mapObj); if (v0 == param2) { - v1 = MapObject_GetZPos(mapObj); + v1 = MapObject_GetZ(mapObj); if ((param3 > v1) && (param3 <= (v1 + param1))) { return param3 - v1; @@ -271,10 +271,10 @@ static int sub_02067E1C(const MapObject *mapObj, int param1, int param2, int par { int v0, v1; - v1 = MapObject_GetZPos(mapObj); + v1 = MapObject_GetZ(mapObj); if (v1 == param3) { - v0 = MapObject_GetXPos(mapObj); + v0 = MapObject_GetX(mapObj); if ((param2 < v0) && (param2 >= (v0 - param1))) { return v0 - param2; @@ -288,10 +288,10 @@ static int sub_02067E48(const MapObject *mapObj, int param1, int param2, int par { int v0, v1; - v1 = MapObject_GetZPos(mapObj); + v1 = MapObject_GetZ(mapObj); if (v1 == param3) { - v0 = MapObject_GetXPos(mapObj); + v0 = MapObject_GetX(mapObj); if ((param2 > v0) && (param2 <= (v0 + param1))) { return param2 - v0; @@ -317,9 +317,9 @@ static int sub_02067E74(const MapObject *mapObj, int param1, int param2) return 1; } - v1 = MapObject_GetXPos(mapObj); - v2 = MapObject_GetZPos(mapObj); - v3 = MapObject_GetYPos(mapObj); + v1 = MapObject_GetX(mapObj); + v2 = MapObject_GetZ(mapObj); + v3 = MapObject_GetY(mapObj); v1 += MapObject_GetDxFromDir(param1); v2 += MapObject_GetDyFromDir(param1); @@ -347,10 +347,7 @@ static int sub_02067E74(const MapObject *mapObj, int param1, int param2) static int sub_02067F14(MapObject *mapObj) { - int v0; - - v0 = MapObject_GetEventID(mapObj); - return Script_GetTrainerID(v0); + return Script_GetTrainerID(MapObject_GetScript(mapObj)); } int sub_02067F24(MapObject *mapObj) @@ -365,7 +362,7 @@ static MapObject *sub_02067F2C(FieldSystem *fieldSystem, MapObjectManager *param v0 = 0; - while (sub_020625B0(param1, &v1, &v0, (1 << 0))) { + while (sub_020625B0(param1, &v1, &v0, MAP_OBJ_STATUS_0)) { if (v1 != param2) { int v2 = sub_02067C54(v1); @@ -485,7 +482,7 @@ static int sub_020680A4(UnkStruct_020EF6D0 *param0) } ov5_021ECDFC(param0->unk_24, param0->unk_08); - MapObject_SetStatusFlagOn(v0, (1 << 6)); + MapObject_SetStatusFlagOn(v0, MAP_OBJ_STATUS_PAUSE_MOVEMENT); param0->unk_00 = 2; return 1; @@ -500,7 +497,7 @@ static int sub_020680D0(UnkStruct_020EF6D0 *param0) } { - u32 v1 = MapObject_GetMoveCode(param0->unk_24); + u32 v1 = MapObject_GetMovementType(param0->unk_24); switch (v1) { case 0x33: @@ -646,11 +643,11 @@ static int sub_02068264(UnkStruct_020EF6D0 *param0) MapObject *v2; v2 = Player_MapObject(param0->playerAvatar); - v1 = sub_02064488(MapObject_GetXPos(v2), MapObject_GetZPos(v2), MapObject_GetXPos(param0->unk_24), MapObject_GetZPos(param0->unk_24)); + v1 = sub_02064488(MapObject_GetX(v2), MapObject_GetZ(v2), MapObject_GetX(param0->unk_24), MapObject_GetZ(param0->unk_24)); if ((PlayerAvatar_GetDir(param0->playerAvatar) != v1) && ((param0->unk_18 == 0) || (param0->unk_14 == 2))) { if (LocalMapObj_IsAnimationSet(v2) == 1) { - MapObject_SetStatusFlagOff(v2, (1 << 7)); + MapObject_SetStatusFlagOff(v2, MAP_OBJ_STATUS_LOCK_DIR); v0 = sub_02065838(v1, 0x0); LocalMapObj_SetAnimationCode(v2, v0); param0->unk_00 = 15; diff --git a/src/unk_02069BE0.c b/src/unk_02069BE0.c index 130075784b..2abb7bafed 100644 --- a/src/unk_02069BE0.c +++ b/src/unk_02069BE0.c @@ -221,8 +221,8 @@ static int sub_02069D8C(MapObject *mapObj) { FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); PlayerAvatar *playerAvatar = sub_0205EF3C(fieldSystem); - int v2 = MapObject_GetXPos(mapObj); - int v3 = MapObject_GetZPos(mapObj); + int v2 = MapObject_GetX(mapObj); + int v3 = MapObject_GetZ(mapObj); int v4 = PlayerAvatar_XPosPrev(playerAvatar); int v5 = PlayerAvatar_ZPosPrev(playerAvatar); @@ -309,7 +309,7 @@ static int (*const Unk_020EF8EC[])(MapObject *, UnkStruct_02069F48 *) = { MapObject *sub_02069EB8(MapObject *mapObj) { int v0 = 0; - int v1 = MapObject_GetEventType(mapObj); + int v1 = MapObject_GetTrainerType(mapObj); int v2 = sub_02062918(mapObj); u32 v3 = sub_02067F24(mapObj); const MapObjectManager *mapObjMan = MapObject_MapObjectManager(mapObj); @@ -364,8 +364,8 @@ static int sub_02069F48(MapObject *mapObj, UnkStruct_02069F48 *param1) static void sub_02069FC4(MapObject *mapObj, UnkStruct_02069F48 *param1, MapObject *param2) { param1->unk_01 = 1; - param1->unk_02 = MapObject_GetXPos(param2); - param1->unk_04 = MapObject_GetZPos(param2); + param1->unk_02 = MapObject_GetX(param2); + param1->unk_04 = MapObject_GetZ(param2); param1->unk_06 = 0xff; param1->unk_08 = param2; } @@ -373,12 +373,12 @@ static void sub_02069FC4(MapObject *mapObj, UnkStruct_02069F48 *param1, MapObjec static int sub_02069FE8(MapObject *mapObj, UnkStruct_02069F48 *param1) { MapObject *v0 = param1->unk_08; - int v1 = MapObject_GetXPos(mapObj); - int v2 = MapObject_GetZPos(mapObj); - int v3 = MapObject_XPosPrev(v0); - int v4 = MapObject_ZPosPrev(v0); + int v1 = MapObject_GetX(mapObj); + int v2 = MapObject_GetZ(mapObj); + int v3 = MapObject_GetXPrev(v0); + int v4 = MapObject_GetZPrev(v0); - if (((v1 != v3) || (v2 != v4)) && ((MapObject_IsMoving(v0) == 1) || (MapObject_CheckStatus(v0, ((1 << 11) | (1 << 12) | (1 << 6))) == 0))) { + if (((v1 != v3) || (v2 != v4)) && ((MapObject_IsMoving(v0) == 1) || (!MapObject_CheckStatus(v0, (MAP_OBJ_STATUS_11 | MAP_OBJ_STATUS_12 | MAP_OBJ_STATUS_PAUSE_MOVEMENT))))) { return 1; } @@ -387,12 +387,12 @@ static int sub_02069FE8(MapObject *mapObj, UnkStruct_02069F48 *param1) static int sub_0206A034(MapObject *mapObj, UnkStruct_02069F48 *param1) { - int v0 = MapObject_GetXPos(mapObj); - int v1 = MapObject_GetZPos(mapObj); - int v2 = MapObject_GetXPos(param1->unk_08); - int v3 = MapObject_GetZPos(param1->unk_08); - int v4 = MapObject_XPosPrev(param1->unk_08); - int v5 = MapObject_ZPosPrev(param1->unk_08); + int v0 = MapObject_GetX(mapObj); + int v1 = MapObject_GetZ(mapObj); + int v2 = MapObject_GetX(param1->unk_08); + int v3 = MapObject_GetZ(param1->unk_08); + int v4 = MapObject_GetXPrev(param1->unk_08); + int v5 = MapObject_GetZPrev(param1->unk_08); int v6; if ((v0 == v2) && (v1 == v3)) { @@ -549,7 +549,7 @@ static void sub_0206A23C(MapObject *mapObj, int param1, u32 param2) v0->unk_01 = -1; v0->unk_02 = param2; - MapObject_SetDir(mapObj, 0); + MapObject_TryFace(mapObj, 0); } void sub_0206A25C(MapObject *mapObj) @@ -603,7 +603,7 @@ void sub_0206A2BC(MapObject *mapObj) static int sub_0206A2E0(MapObject *mapObj, UnkStruct_0206A23C *param1) { - int v0 = MapObject_Dir(mapObj); + int v0 = MapObject_GetFacingDir(mapObj); v0 = sub_02065838(v0, 0x0); @@ -868,8 +868,8 @@ static BOOL sub_0206A54C(FieldSystem *fieldSystem, int param1, int param2, int p static int sub_0206A574(MapObject *mapObj, int param1, int param2) { FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); - int v1 = MapObject_GetXPos(mapObj); - int v2 = MapObject_GetZPos(mapObj); + int v1 = MapObject_GetX(mapObj); + int v2 = MapObject_GetZ(mapObj); BOOL v3 = sub_0206A524(fieldSystem, v1, v2, param1, param2); return v3; @@ -878,8 +878,8 @@ static int sub_0206A574(MapObject *mapObj, int param1, int param2) static int sub_0206A5A4(MapObject *mapObj, int param1, int param2) { FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); - int v1 = MapObject_GetXPos(mapObj); - int v2 = MapObject_GetZPos(mapObj); + int v1 = MapObject_GetX(mapObj); + int v2 = MapObject_GetZ(mapObj); BOOL v3 = sub_0206A54C(fieldSystem, v1, v2, param1, param2); return v3; @@ -916,12 +916,12 @@ static int sub_0206A630(MapObject *mapObj, UnkStruct_0206A47C *param1, int param { u32 v0; int v1 = param1->unk_08; - int v2 = MapObject_Dir(mapObj); + int v2 = MapObject_GetFacingDir(mapObj); v0 = sub_0206A60C(mapObj, &v2, v1); if (v2 == -1) { - v2 = MapObject_Dir(mapObj); + v2 = MapObject_GetFacingDir(mapObj); param2 = sub_02065838(v2, 0x1c); sub_02065668(mapObj, param2); return 0; @@ -935,14 +935,14 @@ static int sub_0206A630(MapObject *mapObj, UnkStruct_0206A47C *param1, int param } if ((v0 & (1 << 0)) && (param1->unk_04 == 2)) { - v2 = Direction_GetOpposite(MapObject_Dir(mapObj)); + v2 = Direction_GetOpposite(MapObject_GetFacingDir(mapObj)); v1 = Unk_020EF8E4[v1]; param1->unk_08 = v1; v0 = sub_0206A60C(mapObj, &v2, v1); if (v2 == -1) { - v2 = MapObject_Dir(mapObj); + v2 = MapObject_GetFacingDir(mapObj); param2 = sub_02065838(v2, 0x1c); sub_02065668(mapObj, param2); return 0; @@ -961,7 +961,7 @@ static int sub_0206A630(MapObject *mapObj, UnkStruct_0206A47C *param1, int param v0 = sub_0206A60C(mapObj, &v2, v1); if (v2 == -1) { - v2 = MapObject_Dir(mapObj); + v2 = MapObject_GetFacingDir(mapObj); param2 = sub_02065838(v2, 0x1c); sub_02065668(mapObj, param2); return 0; @@ -975,7 +975,7 @@ static int sub_0206A630(MapObject *mapObj, UnkStruct_0206A47C *param1, int param } } - v2 = MapObject_Dir(mapObj); + v2 = MapObject_GetFacingDir(mapObj); param2 = sub_02065838(v2, 0x1c); sub_02065668(mapObj, param2); diff --git a/src/unk_0207070C.c b/src/unk_0207070C.c index b38c4ea7f2..c980210899 100644 --- a/src/unk_0207070C.c +++ b/src/unk_0207070C.c @@ -183,7 +183,7 @@ void sub_02070728(FieldSystem *fieldSystem, UnkStruct_02070950 *param1) param1->unk_08 = mapObj; if (mapObj != NULL) { - switch (sub_02062920(mapObj)) { + switch (MapObject_GetGraphicsID(mapObj)) { case 0x54: param1->unk_0C |= (1 << 3); break;