1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-22 06:52:03 +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

@ -83,10 +83,10 @@ static InitChainEntry sInitChain[] = {
};
void ObjTsubo_SpawnCollectible(ObjTsubo* this, PlayState* play) {
s16 dropParams = this->actor.params & 0x1F;
s16 dropParams = PARAMS_GET_U(this->actor.params, 0, 5);
if ((dropParams >= 0) && (dropParams < ITEM00_MAX)) {
Item_DropCollectible(play, &this->actor.world.pos, (dropParams | (((this->actor.params >> 9) & 0x3F) << 8)));
Item_DropCollectible(play, &this->actor.world.pos, dropParams | (PARAMS_GET_U(this->actor.params, 9, 6) << 8));
}
}
@ -135,7 +135,7 @@ void ObjTsubo_Init(Actor* thisx, PlayState* play) {
Actor_Kill(&this->actor);
return;
}
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[(this->actor.params >> 8) & 1]);
this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[PARAMS_GET_U(this->actor.params, 8, 1)]);
if (this->requiredObjectSlot < 0) {
PRINTF("Error : バンク危険! (arg_data 0x%04x)(%s %d)\n", this->actor.params, "../z_obj_tsubo.c", 410);
Actor_Kill(&this->actor);
@ -183,7 +183,8 @@ void ObjTsubo_AirBreak(ObjTsubo* this, PlayState* play) {
}
EffectSsKakera_Spawn(play, &pos, &velocity, &this->actor.world.pos, -240, arg5, 10, 10, 0,
(Rand_ZeroOne() * 95.0f) + 15.0f, 0, 32, 60, KAKERA_COLOR_NONE,
sObjectIds[(this->actor.params >> 8) & 1], D_80BA1B8C[(this->actor.params >> 8) & 1]);
sObjectIds[PARAMS_GET_U(this->actor.params, 8, 1)],
D_80BA1B8C[PARAMS_GET_U(this->actor.params, 8, 1)]);
}
func_80033480(play, &this->actor.world.pos, 30.0f, 4, 20, 50, 1);
}
@ -212,7 +213,8 @@ void ObjTsubo_WaterBreak(ObjTsubo* this, PlayState* play) {
phi_s0 = (Rand_ZeroOne() < .2f) ? 64 : 32;
EffectSsKakera_Spawn(play, &pos, &velocity, &this->actor.world.pos, -180, phi_s0, 30, 30, 0,
(Rand_ZeroOne() * 95.0f) + 15.0f, 0, 32, 70, KAKERA_COLOR_NONE,
sObjectIds[(this->actor.params >> 8) & 1], D_80BA1B8C[(this->actor.params >> 8) & 1]);
sObjectIds[PARAMS_GET_U(this->actor.params, 8, 1)],
D_80BA1B8C[PARAMS_GET_U(this->actor.params, 8, 1)]);
}
}
@ -338,5 +340,5 @@ void ObjTsubo_Update(Actor* thisx, PlayState* play) {
}
void ObjTsubo_Draw(Actor* thisx, PlayState* play) {
Gfx_DrawDListOpa(play, D_80BA1B84[(thisx->params >> 8) & 1]);
Gfx_DrawDListOpa(play, D_80BA1B84[PARAMS_GET_U(thisx->params, 8, 1)]);
}