summaryrefslogtreecommitdiff
path: root/src/manager/moveableObjectManager.c
diff options
context:
space:
mode:
authoroctorock <79596758+octorock@users.noreply.github.com>2022-05-01 11:43:19 +0200
committeroctorock <79596758+octorock@users.noreply.github.com>2022-05-18 13:07:06 +0200
commit60e33b636d7b9dca767b3833ee39affcc626f420 (patch)
tree51d7752fb76f5044028c56404f75c780783d8002 /src/manager/moveableObjectManager.c
parent3afbd0e9012be95e687ccb36eb62f6df08cded19 (diff)
Rename managers
Diffstat (limited to 'src/manager/moveableObjectManager.c')
-rw-r--r--src/manager/moveableObjectManager.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/manager/moveableObjectManager.c b/src/manager/moveableObjectManager.c
new file mode 100644
index 00000000..6c697777
--- /dev/null
+++ b/src/manager/moveableObjectManager.c
@@ -0,0 +1,30 @@
+/**
+ * @file moveableObjectManager.c
+ * @ingroup Managers
+ *
+ * @brief Create object at different place depending on if the flag is set.
+ *
+ * E.g. for pushable rock.
+ */
+#include "manager/moveableObjectManager.h"
+#include "flags.h"
+#include "room.h"
+
+void MoveableObjectManager_Main(MoveableObjectManager* this) {
+ Entity* object = CreateObject(super->timer, super->type, super->type2);
+ if (!object)
+ return;
+ object->field_0x86.HWORD = this->flags;
+ if (CheckFlags(this->flags)) {
+ object->x.HALF.HI = this->unk_36 | (this->unk_37 & 0xF) << 8; // r1
+ object->y.HALF.HI = this->unk_3c & 0xFFF;
+ object->collisionLayer = this->unk_3c >> 0xC;
+ } else {
+ object->x.HALF.HI = this->unk_38;
+ object->y.HALF.HI = this->unk_3a;
+ object->collisionLayer = this->unk_37 >> 4;
+ }
+ object->x.HALF.HI += gRoomControls.origin_x;
+ object->y.HALF.HI += gRoomControls.origin_y;
+ DeleteManager(super);
+}