Skip to content

Commit

Permalink
Renaming functions and some small changes in map_object_move.c
Browse files Browse the repository at this point in the history
  • Loading branch information
Viperio19 committed Jan 8, 2025
1 parent c19d32d commit c1add84
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions include/map_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ MapObject *MapObjectMan_GetMapObject(const MapObjectManager *mapObjMan);
void sub_02062880(const MapObject **mapObj);
void MapObjectMan_SetFieldSystem(MapObjectManager *mapObjMan, FieldSystem *fieldSystem);
FieldSystem *MapObjectMan_FieldSystem(const MapObjectManager *mapObjMan);
void MapObjectMan_GetNARC(MapObjectManager *mapObjMan, NARC *narc);
NARC *sub_020628A0(const MapObjectManager *mapObjMan);
void MapObjectMan_SetNARC(MapObjectManager *mapObjMan, NARC *narc);
NARC *MapObjectMan_GetNARC(const MapObjectManager *mapObjMan);
void MapObject_SetStatus(MapObject *mapObj, u32 status);
u32 MapObject_GetStatus(const MapObject *mapObj);
void MapObject_SetStatusFlagOn(MapObject *mapObj, u32 flag);
Expand Down
10 changes: 5 additions & 5 deletions src/map_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static MapObject *sub_020624CC(const MapObjectManager *mapObjMan, int localID, i
static void sub_02062604(MapObject *mapObj);
static void sub_02062618(MapObject *mapObj);
static void sub_02062628(MapObject *mapObj);
static int FieldSystem_GetGraphicsID(FieldSystem *fieldSystem, int param1);
static int sub_0206262C(FieldSystem *fieldSystem, int param1);
static void sub_02062648(MapObject *mapObj);
static void sub_02062660(MapObject *mapObj);
static void sub_02062670(MapObject *mapObj);
Expand Down Expand Up @@ -689,7 +689,7 @@ static void MapObjectMan_AddMoveTask(const MapObjectManager *mapObjMan, MapObjec
static void sub_020621E8(MapObject *mapObj, const ObjectEvent *objectEvent, FieldSystem *fieldSystem)
{
MapObject_SetLocalID(mapObj, ObjectEvent_GetLocalID(objectEvent));
MapObject_SetGraphicsID(mapObj, FieldSystem_GetGraphicsID(fieldSystem, ObjectEvent_GetGraphicsID(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));
Expand Down Expand Up @@ -904,7 +904,7 @@ static void sub_02062628(MapObject *mapObj)
(void)0;
}

static int FieldSystem_GetGraphicsID(FieldSystem *fieldSystem, int graphicsID)
static int sub_0206262C(FieldSystem *fieldSystem, int graphicsID)
{
if (graphicsID >= 0x65 && graphicsID <= 0x74) {
graphicsID -= 0x65;
Expand Down Expand Up @@ -1135,12 +1135,12 @@ FieldSystem *MapObjectMan_FieldSystem(const MapObjectManager *mapObjMan)
return mapObjMan->fieldSystem;
}

void MapObjectMan_GetNARC(MapObjectManager *mapObjMan, NARC *narc)
void MapObjectMan_SetNARC(MapObjectManager *mapObjMan, NARC *narc)
{
mapObjMan->narc = narc;
}

NARC *sub_020628A0(const MapObjectManager *mapObjMan)
NARC *MapObjectMan_GetNARC(const MapObjectManager *mapObjMan)
{
GF_ASSERT(mapObjMan->narc != NULL);
return ((MapObjectManager *)mapObjMan)->narc;
Expand Down
16 changes: 8 additions & 8 deletions src/map_object_move.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,28 +982,28 @@ void sub_02064464(MapObject *mapObj)
}

static const int sOppositeDirections[] = {
DIR_SOUTH,
DIR_NORTH,
DIR_EAST,
DIR_WEST
[DIR_NORTH] = DIR_SOUTH,
[DIR_SOUTH] = DIR_NORTH,
[DIR_WEST] = DIR_EAST,
[DIR_EAST] = DIR_WEST
};

int Direction_GetOpposite(int dir)
{
return sOppositeDirections[dir];
}

int sub_02064488(int x, int z, int xPrev, int zPrev)
int sub_02064488(int param0, int param1, int param2, int param3)
{
if (x > xPrev) {
if (param0 > param2) {
return DIR_WEST;
}

if (x < xPrev) {
if (param0 < param2) {
return DIR_EAST;
}

if (z > zPrev) {
if (param1 > param3) {
return DIR_NORTH;
}

Expand Down
6 changes: 3 additions & 3 deletions src/overlay005/ov5_021ECC20.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ void ov5_021ECC78(MapObjectManager *param0)
static void ov5_021ECCA4(MapObjectManager *param0)
{
NARC *v0 = NARC_ctor(NARC_INDEX_DATA__MMODEL__MMODEL, 4);
MapObjectMan_GetNARC(param0, v0);
MapObjectMan_SetNARC(param0, v0);
}

static void ov5_021ECCBC(MapObjectManager *param0)
{
NARC *v0 = sub_020628A0(param0);
NARC *v0 = MapObjectMan_GetNARC(param0);
NARC_dtor(v0);
}

Expand Down Expand Up @@ -120,7 +120,7 @@ int ov5_021ECD38(const MapObject *param0)
void *ov5_021ECD68(const MapObjectManager *param0, u32 param1, int param2)
{
void *v0;
NARC *v1 = sub_020628A0(param0);
NARC *v1 = MapObjectMan_GetNARC(param0);
u32 v2 = NARC_GetMemberSize(v1, param1);

if (param2 == 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/overlay005/ov5_021ECE40.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ static int ov5_021ED2E8(UnkStruct_ov5_021ED0A4 *param0, UnkStruct_ov5_021F06D8 *
GF_ASSERT(v0 != NULL);

{
NARC *v1 = sub_020628A0(param0->unk_104);
NARC *v1 = MapObjectMan_GetNARC(param0->unk_104);
ov5_021F0784(param1, param2, v1, v0->unk_04, 0);
}

Expand Down

0 comments on commit c1add84

Please sign in to comment.