diff options
| author | Henny022p <73211432+Henny022p@users.noreply.github.com> | 2026-02-08 18:32:38 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-08 18:32:38 +0100 |
| commit | 5ab63f00e522ff69c5bc987e379f0163943f2833 (patch) | |
| tree | 53622222ac729c6ab6dc75ef7f9bafa8031daf18 /src/object/button.c | |
| parent | 73901a0a012d55ebb66a4627dcb246d19737fcb5 (diff) | |
| parent | 5b2cafdc894823d57beee8f3947a391d881d91de (diff) | |
Various code cleanup changes
Diffstat (limited to 'src/object/button.c')
| -rw-r--r-- | src/object/button.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/object/button.c b/src/object/button.c index d72e176f..a2967cac 100644 --- a/src/object/button.c +++ b/src/object/button.c @@ -4,9 +4,15 @@ * * @brief Button object */ -#include "functions.h" #include "tiles.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "player.h" +#include "map.h" typedef struct { /*0x00*/ Entity base; @@ -16,7 +22,7 @@ typedef struct { /*0x74*/ u16 tilePos; /*0x76*/ u8 unused2[14]; /*0x84*/ u16 unk_84; - /*0x86*/ u16 unk_86; + /*0x86*/ u16 flag; } ButtonEntity; void Button_Init(ButtonEntity* this); @@ -45,7 +51,7 @@ void Button_Init(ButtonEntity* this) { this->tilePos = (((super->x.HALF.HI - gRoomControls.origin_x) >> 4) & 0x3F) | ((((super->y.HALF.HI - gRoomControls.origin_y) >> 4) & 0x3F) << 6); this->unk_72 = GetTileTypeAtTilePos(this->tilePos, super->collisionLayer); - if (super->type == 0 && CheckFlags(this->unk_86)) { + if (super->type == 0 && CheckFlags(this->flag)) { super->action = 5; SetTileType(TILE_TYPE_122, this->tilePos, super->collisionLayer); } else { @@ -114,7 +120,7 @@ void Button_Action4(ButtonEntity* this) { } } else { super->action = 2; - ClearFlag(this->unk_86); + ClearFlag(this->flag); SetTileType(TILE_TYPE_119, this->tilePos, super->collisionLayer); SoundReq(SFX_BUTTON_PRESS); } @@ -276,7 +282,7 @@ bool32 sub_08081F7C(ButtonEntity* this, u32 tileType) { super->child->spriteOffsetY = -4; } else { if (super->timer == 6) { - SetFlag(this->unk_86); + SetFlag(this->flag); SetTileType(tileType, this->tilePos, super->collisionLayer); sub_08081F24(super); SoundReq(SFX_BUTTON_PRESS); |
