summaryrefslogtreecommitdiff
path: root/src/object/button.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/object/button.c')
-rw-r--r--src/object/button.c16
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);