summaryrefslogtreecommitdiff
path: root/src/object/houseSign.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/object/houseSign.c')
-rw-r--r--src/object/houseSign.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/object/houseSign.c b/src/object/houseSign.c
new file mode 100644
index 00000000..7e5413b0
--- /dev/null
+++ b/src/object/houseSign.c
@@ -0,0 +1,24 @@
+/**
+ * @file houseSign.c
+ * @ingroup Objects
+ *
+ * @brief HouseSign object
+ */
+#include "entity.h"
+
+extern u32 CheckRectOnScreen(s16, s16, u32, u32);
+
+/*
+This object is created by HouseSignManager.
+It checks whether the 0x10 x 0x10 rect at field_0x80, field_0x82 is still on the screen.
+If not, then it deletes itself and unsets the this->type2 bit in the managers field_0x20 bitfield.
+*/
+void HouseSign(Entity* this) {
+ if (this->action == 0) {
+ this->action = 1;
+ }
+ if (CheckRectOnScreen(this->field_0x80.HWORD, this->field_0x82.HWORD, 0x10, 0x10) == 0) {
+ this->parent->zVelocity &= ~(1 << this->type2);
+ DeleteThisEntity();
+ }
+}