From 7198d40ec8dac00e3fc5b0d2ae01741fd12aea0e Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Fri, 19 Mar 2021 18:49:19 -0400 Subject: [PATCH] port some documentation from FR --- gflib/text.c | 5 ++--- src/overworld.c | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/gflib/text.c b/gflib/text.c index ffce2cb56..f07a2367a 100644 --- a/gflib/text.c +++ b/gflib/text.c @@ -1280,7 +1280,7 @@ s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing) default: return 0; } - case CHAR_DYNAMIC: + case CHAR_SPECIAL_F7: if (bufferPointer == NULL) bufferPointer = DynamicPlaceholderTextUtil_GetPlaceholderPtr(*++str); while (*bufferPointer != EOS) @@ -1398,8 +1398,7 @@ s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing) if (lineWidth > width) return lineWidth; - else - return width; + return width; } u8 RenderTextFont9(u8 *pixels, u8 fontId, u8 *str) diff --git a/src/overworld.c b/src/overworld.c index 665b840c5..e7c86b0a4 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -3048,32 +3048,32 @@ static void SetPlayerFacingDirection(u8 linkPlayerId, u8 facing) } -static u8 MovementEventModeCB_Normal(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 a3) +static u8 MovementEventModeCB_Normal(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) { - return gLinkPlayerFacingHandlers[a3](linkPlayerObjEvent, objEvent, a3); + return gLinkPlayerFacingHandlers[dir](linkPlayerObjEvent, objEvent, dir); } -static u8 MovementEventModeCB_Ignored(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 a3) +static u8 MovementEventModeCB_Ignored(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) { return FACING_UP; } // Duplicate Function -static u8 MovementEventModeCB_Normal_2(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 a3) +static u8 MovementEventModeCB_Normal_2(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) { - return gLinkPlayerFacingHandlers[a3](linkPlayerObjEvent, objEvent, a3); + return gLinkPlayerFacingHandlers[dir](linkPlayerObjEvent, objEvent, dir); } -static bool8 FacingHandler_DoNothing(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 a3) +static bool8 FacingHandler_DoNothing(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) { return FALSE; } -static bool8 FacingHandler_DpadMovement(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 a3) +static bool8 FacingHandler_DpadMovement(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) { s16 x, y; - linkDirection(objEvent) = FlipVerticalAndClearForced(a3, linkDirection(objEvent)); + linkDirection(objEvent) = FlipVerticalAndClearForced(dir, linkDirection(objEvent)); ObjectEventMoveDestCoords(objEvent, linkDirection(objEvent), &x, &y); if (LinkPlayerDetectCollision(linkPlayerObjEvent->objEventId, linkDirection(objEvent), x, y)) @@ -3089,9 +3089,9 @@ static bool8 FacingHandler_DpadMovement(struct LinkPlayerObjectEvent *linkPlayer } } -static bool8 FacingHandler_ForcedFacingChange(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 a3) +static bool8 FacingHandler_ForcedFacingChange(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) { - linkDirection(objEvent) = FlipVerticalAndClearForced(a3, linkDirection(objEvent)); + linkDirection(objEvent) = FlipVerticalAndClearForced(dir, linkDirection(objEvent)); return FALSE; }