summaryrefslogtreecommitdiff
path: root/src/object
diff options
context:
space:
mode:
authornotyourav <65437533+notyourav@users.noreply.github.com>2022-03-02 13:04:09 -0800
committerGitHub <noreply@github.com>2022-03-02 13:04:09 -0800
commit00c79925f45f11269f9e08ff51bb89b3622843d7 (patch)
tree5e0f0d18319bb89e1a3469d0f68e38a7c68fb20f /src/object
parente57bf718fce2cc5b36da6ca60c12c1f4dfaa3074 (diff)
parent07f7ea15096fb0f323e77e72566b1d8fa13b7c13 (diff)
Merge pull request #416 from hatal175/giantrock
Decompile GiantRock and GiantRock2
Diffstat (limited to 'src/object')
-rw-r--r--src/object/giantRock.c12
-rw-r--r--src/object/giantRock2.c45
2 files changed, 57 insertions, 0 deletions
diff --git a/src/object/giantRock.c b/src/object/giantRock.c
new file mode 100644
index 00000000..d40befca
--- /dev/null
+++ b/src/object/giantRock.c
@@ -0,0 +1,12 @@
+#include "entity.h"
+
+void GiantRock(Entity* this) {
+ if (this->action == 0) {
+ this->action = 1;
+ this->spriteSettings.draw = 1;
+ this->collisionLayer = 2;
+ UpdateSpriteForCollisionLayer(this);
+ this->spritePriority.b0 = 0;
+ InitializeAnimation(this, this->type);
+ }
+}
diff --git a/src/object/giantRock2.c b/src/object/giantRock2.c
new file mode 100644
index 00000000..c347e04b
--- /dev/null
+++ b/src/object/giantRock2.c
@@ -0,0 +1,45 @@
+#define NENT_DEPRECATED
+#include "entity.h"
+#include "room.h"
+#include "asm.h"
+
+typedef struct {
+ Entity base;
+ u8 filler[0xC];
+ u16 tile;
+} GiantRock2Entity;
+
+void GiantRock2_Init(GiantRock2Entity*);
+void GiantRock2_Idle(GiantRock2Entity*);
+
+void GiantRock2(Entity* this) {
+ static void (*const actionFuncs[])(GiantRock2Entity*) = {
+ GiantRock2_Init,
+ GiantRock2_Idle,
+ };
+ actionFuncs[this->action]((GiantRock2Entity*)this);
+}
+
+void GiantRock2_Init(GiantRock2Entity* this) {
+ u32 collisionLayer;
+ u16 position;
+ int index;
+ u32 tileIndex;
+
+ super->action = 1;
+ this->tile = COORD_TO_TILE(super);
+ collisionLayer = super->collisionLayer;
+ super->spritePriority.b0 = 7;
+ position = (this->tile - 0x80);
+ tileIndex = 0x4022;
+ for (index = 4; index > -1; index--) {
+ SetTile(tileIndex, position - 2, collisionLayer);
+ SetTile(tileIndex, position - 1, collisionLayer);
+ SetTile(tileIndex, position, collisionLayer);
+ SetTile(tileIndex, position + 1, collisionLayer);
+ position += 0x40;
+ }
+}
+
+void GiantRock2_Idle(GiantRock2Entity* this) {
+}