mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-10-02 14:31:06 -05:00
Use verbs for PlayerPos and DistortionState functions
This commit is contained in:
@@ -96,7 +96,7 @@ int sub_0205F060(PlayerAvatar * playerAvatar);
|
||||
void sub_0205F074(PlayerAvatar * playerAvatar, int param1);
|
||||
int sub_0205F08C(PlayerAvatar * playerAvatar);
|
||||
void PlayerAvatar_SetDistortionState(PlayerAvatar * playerAvatar, enum AvatarDistortionState state);
|
||||
enum AvatarDistortionState PlayerAvatar_DistortionState(PlayerAvatar * const playerAvatar);
|
||||
enum AvatarDistortionState PlayerAvatar_MapDistortionState(PlayerAvatar * const playerAvatar);
|
||||
BOOL PlayerAvatar_DistortionGravityChanged(PlayerAvatar * const playerAvatar);
|
||||
BOOL PlayerAvatar_DistortionStateOnFloor(PlayerAvatar * const playerAvatar);
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ static BOOL Field_CheckSign(FieldSystem *fieldSystem);
|
||||
static BOOL Field_UpdateRepel(FieldSystem *fieldSystem);
|
||||
static BOOL Field_UpdateFriendship(FieldSystem *fieldSystem);
|
||||
static void Field_CalculateFriendship(FieldSystem *fieldSystem);
|
||||
static void Field_PlayerPos(const FieldSystem *fieldSystem, int *playerX, int *playerZ);
|
||||
static void Field_GetPlayerPos(const FieldSystem *fieldSystem, int *playerX, int *playerZ);
|
||||
static void Field_Step(const FieldSystem *fieldSystem, int *playerX, int *playerZ);
|
||||
static void Field_StepInDirection(const FieldSystem *fieldSystem, int playerDir, int *playerX, int *playerZ);
|
||||
static u8 Field_CurrentTileBehavior(const FieldSystem *fieldSystem);
|
||||
@@ -280,7 +280,7 @@ BOOL FieldInput_Process (const FieldInput *input, FieldSystem *fieldSystem)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
enum AvatarDistortionState distortionState = PlayerAvatar_DistortionState(fieldSystem->playerAvatar);
|
||||
enum AvatarDistortionState distortionState = PlayerAvatar_MapDistortionState(fieldSystem->playerAvatar);
|
||||
|
||||
if (distortionState == AVATAR_DISTORTION_STATE_NONE || distortionState == AVATAR_DISTORTION_STATE_ACTIVE) {
|
||||
int event = sub_0203CA6C(fieldSystem, sub_0203A440(fieldSystem), sub_0203A448(fieldSystem));
|
||||
@@ -548,7 +548,7 @@ static BOOL Field_CheckWildEncounter (FieldSystem *fieldSystem)
|
||||
{
|
||||
int playerX, playerZ;
|
||||
|
||||
Field_PlayerPos(fieldSystem, &playerX, &playerZ);
|
||||
Field_GetPlayerPos(fieldSystem, &playerX, &playerZ);
|
||||
|
||||
if (sub_0206AE8C(SaveData_Events(fieldSystem->saveData)) == TRUE) {
|
||||
if (sub_02056374(fieldSystem, playerX, playerZ) == TRUE) {
|
||||
@@ -598,7 +598,7 @@ static BOOL Field_CheckMapTransition (FieldSystem *fieldSystem, const FieldInput
|
||||
}
|
||||
}
|
||||
|
||||
Field_PlayerPos(fieldSystem, &playerX, &playerZ);
|
||||
Field_GetPlayerPos(fieldSystem, &playerX, &playerZ);
|
||||
|
||||
tileBehavior = sub_02054F94(fieldSystem, playerX, playerZ);
|
||||
|
||||
@@ -948,7 +948,7 @@ static BOOL Field_UpdateSafari (FieldSystem *fieldSystem)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void Field_PlayerPos (const FieldSystem *fieldSystem, int *playerX, int *playerZ)
|
||||
static void Field_GetPlayerPos (const FieldSystem *fieldSystem, int *playerX, int *playerZ)
|
||||
{
|
||||
*playerX = Player_GetXPos(fieldSystem->playerAvatar);
|
||||
*playerZ = Player_GetZPos(fieldSystem->playerAvatar);
|
||||
@@ -962,7 +962,7 @@ static void Field_Step (const FieldSystem *fieldSystem, int *playerX, int *playe
|
||||
|
||||
static void Field_StepInDirection (const FieldSystem *fieldSystem, int playerDir, int *playerX, int *playerZ)
|
||||
{
|
||||
Field_PlayerPos(fieldSystem, playerX, playerZ);
|
||||
Field_GetPlayerPos(fieldSystem, playerX, playerZ);
|
||||
|
||||
switch (playerDir) {
|
||||
case DIR_NORTH:
|
||||
@@ -985,7 +985,7 @@ static void Field_StepInDirection (const FieldSystem *fieldSystem, int playerDir
|
||||
static u8 Field_CurrentTileBehavior (const FieldSystem *fieldSystem)
|
||||
{
|
||||
int playerX, playerZ;
|
||||
Field_PlayerPos(fieldSystem, &playerX, &playerZ);
|
||||
Field_GetPlayerPos(fieldSystem, &playerX, &playerZ);
|
||||
return sub_02054F94(fieldSystem, playerX, playerZ);
|
||||
}
|
||||
|
||||
@@ -1047,7 +1047,7 @@ static void Field_SetMapConnection (FieldSystem *fieldSystem, const int playerX,
|
||||
static void Field_TrySetMapConnection (FieldSystem *fieldSystem)
|
||||
{
|
||||
int playerX, playerZ;
|
||||
Field_PlayerPos(fieldSystem, &playerX, &playerZ);
|
||||
Field_GetPlayerPos(fieldSystem, &playerX, &playerZ);
|
||||
|
||||
Location nextMap;
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ static void PlayerAvatar_RequestStateWalking (PlayerAvatar * playerAvatar)
|
||||
int v0;
|
||||
int v1 = 0x0;
|
||||
|
||||
if (PlayerAvatar_DistortionState(playerAvatar) != AVATAR_DISTORTION_STATE_NONE) {
|
||||
if (PlayerAvatar_MapDistortionState(playerAvatar) != AVATAR_DISTORTION_STATE_NONE) {
|
||||
v1 = 0x18;
|
||||
} else {
|
||||
MapObject * mapObj = Player_MapObject(playerAvatar);
|
||||
@@ -254,7 +254,7 @@ static void PlayerAvatar_RequestStateSurf (PlayerAvatar * playerAvatar)
|
||||
int v0, v1;
|
||||
MapObject * mapObj = Player_MapObject(playerAvatar);
|
||||
FieldSystem * fieldSystem = MapObject_FieldSystem(mapObj);
|
||||
enum AvatarDistortionState distortionState = PlayerAvatar_DistortionState(playerAvatar);
|
||||
enum AvatarDistortionState distortionState = PlayerAvatar_MapDistortionState(playerAvatar);
|
||||
UnkStruct_ov101_021D5D90 * v5 = sub_0205EC04(playerAvatar);
|
||||
|
||||
if (v5 != NULL) {
|
||||
@@ -312,7 +312,7 @@ static void PlayerAvatar_RequestStatePoketch (PlayerAvatar * playerAvatar)
|
||||
int v0;
|
||||
int v1 = 0x14;
|
||||
|
||||
if (PlayerAvatar_DistortionState(playerAvatar) != AVATAR_DISTORTION_STATE_NONE) {
|
||||
if (PlayerAvatar_MapDistortionState(playerAvatar) != AVATAR_DISTORTION_STATE_NONE) {
|
||||
v1 = 0x1b;
|
||||
} else {
|
||||
MapObject * mapObj = Player_MapObject(playerAvatar);
|
||||
@@ -332,7 +332,7 @@ static void PlayerAvatar_RequestStateSave (PlayerAvatar * playerAvatar)
|
||||
int v0;
|
||||
int v1 = 0x15;
|
||||
|
||||
if (PlayerAvatar_DistortionState(playerAvatar) != AVATAR_DISTORTION_STATE_NONE) {
|
||||
if (PlayerAvatar_MapDistortionState(playerAvatar) != AVATAR_DISTORTION_STATE_NONE) {
|
||||
v1 = 0x1a;
|
||||
} else {
|
||||
MapObject * mapObj = Player_MapObject(playerAvatar);
|
||||
@@ -623,7 +623,7 @@ static BOOL ov5_021E0160 (TaskManager * taskMan)
|
||||
|
||||
switch (v0->unk_00) {
|
||||
case 0:
|
||||
if (PlayerAvatar_DistortionState(v0->playerAvatar) == AVATAR_DISTORTION_STATE_NONE) {
|
||||
if (PlayerAvatar_MapDistortionState(v0->playerAvatar) == AVATAR_DISTORTION_STATE_NONE) {
|
||||
sub_020553F0(v0->fieldSystem, 0);
|
||||
sub_02055554(v0->fieldSystem, 1151, 1);
|
||||
}
|
||||
@@ -642,7 +642,7 @@ static BOOL ov5_021E0160 (TaskManager * taskMan)
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if (PlayerAvatar_DistortionState(v0->playerAvatar) == AVATAR_DISTORTION_STATE_NONE) {
|
||||
if (PlayerAvatar_MapDistortionState(v0->playerAvatar) == AVATAR_DISTORTION_STATE_NONE) {
|
||||
int v1 = Player_GetXPos(v0->playerAvatar) + sub_0206419C(v0->unk_04);
|
||||
int v2 = Player_GetZPos(v0->playerAvatar) + sub_020641A8(v0->unk_04);
|
||||
|
||||
@@ -651,7 +651,7 @@ static BOOL ov5_021E0160 (TaskManager * taskMan)
|
||||
int v3 = MapObject_GetXPos(v0->unk_24);
|
||||
int v4 = ((MapObject_GetYPos(v0->unk_24) / 2));
|
||||
int v5 = MapObject_GetZPos(v0->unk_24);
|
||||
enum AvatarDistortionState distortionState = PlayerAvatar_DistortionState(v0->playerAvatar);
|
||||
enum AvatarDistortionState distortionState = PlayerAvatar_MapDistortionState(v0->playerAvatar);
|
||||
|
||||
sub_02061674(v0->playerAvatar, v0->unk_04, &v3, &v4, &v5);
|
||||
v0->unk_28 = ov5_021F85BC(v0->playerAvatar, v3, v4, v5, v0->unk_04, 0, distortionState);
|
||||
@@ -671,7 +671,7 @@ static BOOL ov5_021E0160 (TaskManager * taskMan)
|
||||
int v8[6] = {
|
||||
0x34, 0x34, 0x34, 0x85, 0x89, 0x8d
|
||||
};
|
||||
enum AvatarDistortionState distortionState = PlayerAvatar_DistortionState(v0->playerAvatar);
|
||||
enum AvatarDistortionState distortionState = PlayerAvatar_MapDistortionState(v0->playerAvatar);
|
||||
|
||||
v7 = sub_02065838(v0->unk_04, v8[distortionState]);
|
||||
LocalMapObj_SetAnimationCode(v0->unk_24, v7);
|
||||
@@ -685,7 +685,7 @@ static BOOL ov5_021E0160 (TaskManager * taskMan)
|
||||
|
||||
sub_020656AC(v0->unk_24);
|
||||
|
||||
if (PlayerAvatar_DistortionState(v0->playerAvatar) == AVATAR_DISTORTION_STATE_NONE) {
|
||||
if (PlayerAvatar_MapDistortionState(v0->playerAvatar) == AVATAR_DISTORTION_STATE_NONE) {
|
||||
int v10;
|
||||
|
||||
ov5_021F2838(v0->unk_28, 1);
|
||||
@@ -762,7 +762,7 @@ static BOOL ov5_021E03C8 (TaskManager * param0)
|
||||
0x34, 0x34, 0x34, 0x85, 0x89, 0x8d
|
||||
};
|
||||
|
||||
enum AvatarDistortionState distortionState = PlayerAvatar_DistortionState(v0->playerAvatar);
|
||||
enum AvatarDistortionState distortionState = PlayerAvatar_MapDistortionState(v0->playerAvatar);
|
||||
|
||||
if (distortionState == AVATAR_DISTORTION_STATE_NONE) {
|
||||
ov5_021F2838(v0->unk_14, 0);
|
||||
@@ -1726,7 +1726,7 @@ static void PlayerAvatar_Redraw (PlayerAvatar * playerAvatar, int param1)
|
||||
{
|
||||
MapObject * v0 = Player_MapObject(playerAvatar);
|
||||
|
||||
if (PlayerAvatar_DistortionState(playerAvatar) == AVATAR_DISTORTION_STATE_NONE) {
|
||||
if (PlayerAvatar_MapDistortionState(playerAvatar) == AVATAR_DISTORTION_STATE_NONE) {
|
||||
ov5_021EE3FC(v0, param1, NULL, NULL);
|
||||
} else {
|
||||
int v1;
|
||||
|
||||
@@ -170,7 +170,7 @@ static void ov5_021F86E4 (UnkStruct_ov101_021D5D90 * param0, void * param1)
|
||||
}
|
||||
|
||||
v0->unk_04 = MapObject_GetMoveDir(v1);
|
||||
v0->unk_34 = PlayerAvatar_DistortionState(playerAvatar);
|
||||
v0->unk_34 = PlayerAvatar_MapDistortionState(playerAvatar);
|
||||
|
||||
GF_ASSERT(v0->unk_04 != -1);
|
||||
|
||||
|
||||
@@ -858,7 +858,7 @@ void PlayerAvatar_SetDistortionState (PlayerAvatar * playerAvatar, enum AvatarDi
|
||||
GF_ASSERT(0);
|
||||
}
|
||||
|
||||
enum AvatarDistortionState PlayerAvatar_DistortionState (PlayerAvatar * const playerAvatar)
|
||||
enum AvatarDistortionState PlayerAvatar_MapDistortionState (PlayerAvatar * const playerAvatar)
|
||||
{
|
||||
enum AvatarDistortionState state = AVATAR_DISTORTION_STATE_NONE;
|
||||
u32 v1 = sub_0205EBB0(playerAvatar, ((1 << 8) | (1 << 9) | (1 << 10) | (1 << 11) | (1 << 12)));
|
||||
@@ -887,7 +887,7 @@ enum AvatarDistortionState PlayerAvatar_DistortionState (PlayerAvatar * const pl
|
||||
// this function can be simplified, but preserving matching reduces clarity
|
||||
BOOL PlayerAvatar_DistortionGravityChanged (PlayerAvatar * const playerAvatar)
|
||||
{
|
||||
enum AvatarDistortionState state = PlayerAvatar_DistortionState(playerAvatar);
|
||||
enum AvatarDistortionState state = PlayerAvatar_MapDistortionState(playerAvatar);
|
||||
|
||||
if (state == AVATAR_DISTORTION_STATE_NONE || state == AVATAR_DISTORTION_STATE_ACTIVE) {
|
||||
return FALSE;
|
||||
@@ -898,7 +898,7 @@ BOOL PlayerAvatar_DistortionGravityChanged (PlayerAvatar * const playerAvatar)
|
||||
|
||||
BOOL PlayerAvatar_DistortionStateOnFloor (PlayerAvatar * const playerAvatar)
|
||||
{
|
||||
enum AvatarDistortionState state = PlayerAvatar_DistortionState(playerAvatar);
|
||||
enum AvatarDistortionState state = PlayerAvatar_MapDistortionState(playerAvatar);
|
||||
|
||||
return state == AVATAR_DISTORTION_STATE_NONE
|
||||
|| state == AVATAR_DISTORTION_STATE_ACTIVE
|
||||
|
||||
@@ -199,7 +199,7 @@ static int PlayerAvatar_CheckStartMoveInternal (PlayerAvatar * playerAvatar, int
|
||||
if (PlayerAvatar_DistortionGravityChanged(playerAvatar) == TRUE) {
|
||||
v2 = sub_020611FC(playerAvatar, mapObj, dir);
|
||||
|
||||
if ((v2 & (~(1 << 7))) && PlayerAvatar_DistortionState(playerAvatar) == AVATAR_DISTORTION_STATE_FLOOR) {
|
||||
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);
|
||||
@@ -860,7 +860,7 @@ static int sub_0205FCC0 (PlayerAvatar * playerAvatar, int param1)
|
||||
|
||||
v0 = PlayerAvatar_GetDir(playerAvatar);
|
||||
|
||||
enum AvatarDistortionState distortionState = PlayerAvatar_DistortionState(playerAvatar);
|
||||
enum AvatarDistortionState distortionState = PlayerAvatar_MapDistortionState(playerAvatar);
|
||||
|
||||
if (distortionState != AVATAR_DISTORTION_STATE_NONE
|
||||
&& distortionState != AVATAR_DISTORTION_STATE_ACTIVE
|
||||
@@ -887,7 +887,7 @@ static void sub_0205FD20 (PlayerAvatar * playerAvatar, MapObject * param1, int p
|
||||
|
||||
static void sub_0205FD40 (PlayerAvatar * playerAvatar, MapObject * param1, int param2, u16 param3, u16 param4)
|
||||
{
|
||||
enum AvatarDistortionState distortionState = PlayerAvatar_DistortionState(playerAvatar);
|
||||
enum AvatarDistortionState distortionState = PlayerAvatar_MapDistortionState(playerAvatar);
|
||||
|
||||
switch (distortionState) {
|
||||
case AVATAR_DISTORTION_STATE_FLOOR:
|
||||
@@ -1129,7 +1129,7 @@ static void sub_02060258 (PlayerAvatar * playerAvatar, MapObject * mapObj, int p
|
||||
int v0, v1;
|
||||
v1 = param2;
|
||||
|
||||
enum AvatarDistortionState distortionState = PlayerAvatar_DistortionState(playerAvatar);
|
||||
enum AvatarDistortionState distortionState = PlayerAvatar_MapDistortionState(playerAvatar);
|
||||
|
||||
switch (distortionState) {
|
||||
case AVATAR_DISTORTION_STATE_WEST_WALL:
|
||||
@@ -2070,7 +2070,7 @@ static int sub_02061248 (PlayerAvatar * playerAvatar, MapObject * mapObj, int pa
|
||||
{
|
||||
BOOL v0 = 0;
|
||||
|
||||
if ((param2 != -1) && PlayerAvatar_DistortionState(playerAvatar) == AVATAR_DISTORTION_STATE_FLOOR) {
|
||||
if ((param2 != -1) && PlayerAvatar_MapDistortionState(playerAvatar) == AVATAR_DISTORTION_STATE_FLOOR) {
|
||||
FieldSystem * fieldSystem = MapObject_FieldSystem(mapObj);
|
||||
|
||||
if (sub_02071CB4(fieldSystem, 9) == 1) {
|
||||
@@ -2413,7 +2413,7 @@ static int PlayerAvatar_IsUnderCyclingRoad (PlayerAvatar * playerAvatar, u32 par
|
||||
void sub_02061674 (PlayerAvatar * playerAvatar, int param1, int * param2, int * param3, int * param4)
|
||||
{
|
||||
const UnkStruct_020EDB04 * v0;
|
||||
enum AvatarDistortionState distortionState = PlayerAvatar_DistortionState(playerAvatar);
|
||||
enum AvatarDistortionState distortionState = PlayerAvatar_MapDistortionState(playerAvatar);
|
||||
|
||||
switch (distortionState) {
|
||||
case AVATAR_DISTORTION_STATE_NONE:
|
||||
|
||||
Reference in New Issue
Block a user