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

Generic actor params getters (#1359)

* Initial PARAMS_GET macros

* NOSHIFT macro

* Use number of bits rather than raw mask values

* Add descriptions for each generic macro

* Reformat

* Adjust comment

* format

* edit en_door macro names

* edit redead macro name

* edit bdan switch macro name, and remove unneeded comments in go2

* mizushutter macro names

* remove PARAMS_GET_S, rework ishi switch flag handling

* actually remove PARAMS_GET_S

* remove PARAMS_GET2_S

* PARAMS_GET_U and PARAMS_GET_S

* format

* fix merge

* format

---------

Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
Tharo 2024-08-14 20:29:43 +01:00 committed by GitHub
parent 137e0d2a10
commit eaf955ad22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
200 changed files with 1113 additions and 1045 deletions

View file

@ -79,7 +79,7 @@ void BgBreakwall_SetupAction(BgBreakwall* this, BgBreakwallActionFunc actionFunc
void BgBreakwall_Init(Actor* thisx, PlayState* play) {
BgBreakwall* this = (BgBreakwall*)thisx;
s32 pad;
s32 wallType = ((this->dyna.actor.params >> 13) & 3) & 0xFF;
s32 wallType = (u8)PARAMS_GET_U(this->dyna.actor.params, 13, 2);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, 0);
@ -91,7 +91,7 @@ void BgBreakwall_Init(Actor* thisx, PlayState* play) {
}
if (this->bombableWallDList != NULL) {
if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) {
if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) {
Actor_Kill(&this->dyna.actor);
return;
}
@ -203,7 +203,7 @@ Actor* BgBreakwall_SpawnFragments(PlayState* play, BgBreakwall* this, Vec3f* pos
void BgBreakwall_WaitForObject(BgBreakwall* this, PlayState* play) {
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) {
CollisionHeader* colHeader = NULL;
s32 wallType = ((this->dyna.actor.params >> 13) & 3) & 0xFF;
s32 wallType = (u8)PARAMS_GET_U(this->dyna.actor.params, 13, 2);
this->dyna.actor.objectSlot = this->requiredObjectSlot;
Actor_SetObjectDependency(play, &this->dyna.actor);
@ -227,7 +227,7 @@ void BgBreakwall_WaitForObject(BgBreakwall* this, PlayState* play) {
void BgBreakwall_Wait(BgBreakwall* this, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) {
Vec3f effectPos;
s32 wallType = ((this->dyna.actor.params >> 13) & 3) & 0xFF;
s32 wallType = (u8)PARAMS_GET_U(this->dyna.actor.params, 13, 2);
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
effectPos.y = effectPos.z = effectPos.x = 0.0f;
@ -240,7 +240,7 @@ void BgBreakwall_Wait(BgBreakwall* this, PlayState* play) {
}
BgBreakwall_SpawnFragments(play, this, &effectPos, 0.0f, 6.4f, 5.0f, 1, 2.0f);
Flags_SetSwitch(play, this->dyna.actor.params & 0x3F);
Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6));
if (wallType == BWALL_KD_FLOOR) {
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_EXPLOSION);