1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-21 14:31:17 +00:00

Big cleanup (#775)

* Adult and child2 macros OK

* ICHAIN cleanup

* almost all overlay data

* format.sh

* func_8002FBAC NON_EQUIVALENT

* PR fixes (MZXrules)

* fix

* change //@ bug to //! @bug

* merge master and missed a //@bug

* fix ruto

* some more cleanup (#2)

* more `! @bug` formatting cleanup

* parenthesis cleanup

* hex naviEnemyId

* run formatter

* replace `IS_NOT_` macros with `!IS_`

* run formatter

* run formatter

* PR fixes (fig)

* Missed something

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
louist103 2021-08-21 19:12:57 -04:00 committed by GitHub
parent 17c79a8f60
commit 556cdad7eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
177 changed files with 902 additions and 862 deletions

View file

@ -90,8 +90,8 @@ void EnBox_ClipToGround(EnBox* this, GlobalContext* globalCtx) {
}
}
void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) {
GlobalContext* globalCtx2 = globalCtx;
void EnBox_Init(Actor* thisx, GlobalContext* globalCtx2) {
GlobalContext* globalCtx = globalCtx2;
EnBox* this = THIS;
AnimationHeader* anim;
CollisionHeader* colHeader;
@ -106,8 +106,8 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) {
DynaPolyActor_Init(&this->dyna, DPM_UNK);
CollisionHeader_GetVirtual(&gTreasureChestCol, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx2, &globalCtx2->colCtx.dyna, &this->dyna.actor, colHeader);
func_8003ECA8(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
func_8003ECA8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
this->movementFlags = 0;
this->type = thisx->params >> 12 & 0xF;
@ -117,17 +117,17 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) {
this->switchFlag = this->dyna.actor.world.rot.z;
this->dyna.actor.minVelocityY = -50.0f;
if (globalCtx2) {} // helps the compiler store globalCtx2 into s1
if (globalCtx) {} // helps the compiler store globalCtx2 into s1
if (Flags_GetTreasure(globalCtx2, this->dyna.actor.params & 0x1F)) {
if (Flags_GetTreasure(globalCtx, this->dyna.actor.params & 0x1F)) {
this->alpha = 255;
this->iceSmokeTimer = 100;
EnBox_SetupAction(this, EnBox_Open);
this->movementFlags |= ENBOX_MOVE_STICK_TO_GROUND;
animFrameStart = endFrame;
} else if ((this->type == ENBOX_TYPE_SWITCH_FLAG_FALL_BIG || this->type == ENBOX_TYPE_SWITCH_FLAG_FALL_SMALL) &&
!Flags_GetSwitch(globalCtx2, this->switchFlag)) {
func_8003EBF8(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId);
!Flags_GetSwitch(globalCtx, this->switchFlag)) {
func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
if (Rand_ZeroOne() < 0.5f) {
this->movementFlags |= ENBOX_MOVE_FALL_ANGLE_SIDE;
}
@ -137,9 +137,9 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) {
this->movementFlags |= ENBOX_MOVE_IMMOBILE;
this->dyna.actor.flags |= 0x10;
} else if ((this->type == ENBOX_TYPE_ROOM_CLEAR_BIG || this->type == ENBOX_TYPE_ROOM_CLEAR_SMALL) &&
!Flags_GetClear(globalCtx2, this->dyna.actor.room)) {
!Flags_GetClear(globalCtx, this->dyna.actor.room)) {
EnBox_SetupAction(this, EnBox_AppearOnRoomClear);
func_8003EBF8(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId);
func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
this->movementFlags |= ENBOX_MOVE_IMMOBILE;
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 50.0f;
this->alpha = 0;
@ -147,14 +147,14 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) {
} else if (this->type == ENBOX_TYPE_9 || this->type == ENBOX_TYPE_10) {
EnBox_SetupAction(this, func_809C9700);
this->dyna.actor.flags |= 0x2000000;
func_8003EBF8(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId);
func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
this->movementFlags |= ENBOX_MOVE_IMMOBILE;
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 50.0f;
this->alpha = 0;
this->dyna.actor.flags |= 0x10;
} else if (this->type == ENBOX_TYPE_SWITCH_FLAG_BIG && !Flags_GetSwitch(globalCtx2, this->switchFlag)) {
} else if (this->type == ENBOX_TYPE_SWITCH_FLAG_BIG && !Flags_GetSwitch(globalCtx, this->switchFlag)) {
EnBox_SetupAction(this, EnBox_AppearOnSwitchFlag);
func_8003EBF8(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId);
func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
this->movementFlags |= ENBOX_MOVE_IMMOBILE;
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 50.0f;
this->alpha = 0;
@ -171,7 +171,7 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) {
this->dyna.actor.world.rot.y += 0x8000;
this->dyna.actor.home.rot.z = this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z = 0;
SkelAnime_Init(globalCtx2, &this->skelanime, &gTreasureChestSkel, anim, this->jointTable, this->morphTable, 5);
SkelAnime_Init(globalCtx, &this->skelanime, &gTreasureChestSkel, anim, this->jointTable, this->morphTable, 5);
Animation_Change(&this->skelanime, anim, 1.5f, animFrameStart, endFrame, ANIMMODE_ONCE, 0.0f);
switch (this->type) {