mirror of
https://github.com/zeldaret/tmc
synced 2026-07-09 06:53:27 -04:00
Decompile GiantRock and GiantRock2
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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) {
|
||||
}
|
||||
Reference in New Issue
Block a user