1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-24 16:01:26 +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

@ -77,23 +77,23 @@ typedef void (*DemoGjDrawFunc)(DemoGj*, PlayState*);
// bits 11-15
s32 DemoGj_GetCollectibleType(DemoGj* this) {
s32 params = this->dyna.actor.params >> 0xB;
s32 type = PARAMS_GET_U(this->dyna.actor.params, 11, 5);
return params & 0x1F;
return type;
}
// bits 8-10
s32 DemoGj_GetCollectibleAmount(DemoGj* this) {
s32 params = this->dyna.actor.params >> 0x8;
s32 amount = PARAMS_GET_U(this->dyna.actor.params, 8, 3);
return params & 7;
return amount;
}
// bits 0-7
s32 DemoGj_GetType(DemoGj* this) {
s32 params = this->dyna.actor.params;
s32 type = PARAMS_GET_U(this->dyna.actor.params, 0, 8);
return params & 0xFF;
return type;
}
void DemoGj_InitCylinder(DemoGj* this, PlayState* play, ColliderCylinder* cylinder,