1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-23 07:21:19 +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

@ -59,9 +59,9 @@ void ObjMakeoshihiki_Init(Actor* thisx, PlayState* play) {
s32 typeIdx;
Vec3f* spawnPos;
if (!((thisx->params >> 6) & 1) && Flags_GetSwitch(play, thisx->params & 0x3F)) {
if (!PARAMS_GET_U(thisx->params, 6, 1) && Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6))) {
typeIdx = 1;
} else if (!((thisx->params >> 0xE) & 1) && Flags_GetSwitch(play, (thisx->params >> 8) & 0x3F)) {
} else if (!PARAMS_GET_U(thisx->params, 14, 1) && Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 8, 6))) {
typeIdx = 2;
} else {
typeIdx = 0;
@ -96,10 +96,10 @@ void ObjMakeoshihiki_Draw(Actor* thisx, PlayState* play) {
for (i = 0; i < 3; i++) {
if (Math3D_Vec3fDistSq(&thisx->child->world.pos, &block->posVecs[i]) < 0.001f) {
if (block->unk_24[i] & 1) {
if ((thisx->params >> 6) & 1) {
if (PARAMS_GET_U(thisx->params, 6, 1)) {
sfxCond1 = false;
} else {
if (Flags_GetSwitch(play, thisx->params & 0x3F)) {
if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6))) {
cond = true;
} else {
cond = false;
@ -107,10 +107,10 @@ void ObjMakeoshihiki_Draw(Actor* thisx, PlayState* play) {
sfxCond1 = sFlags[i][0] ^ cond;
}
if ((thisx->params >> 0xE) & 1) {
if (PARAMS_GET_U(thisx->params, 14, 1)) {
sfxCond2 = false;
} else {
if (Flags_GetSwitch(play, (thisx->params >> 8) & 0x3F)) {
if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 8, 6))) {
cond2 = true;
} else {
cond2 = false;
@ -123,8 +123,8 @@ void ObjMakeoshihiki_Draw(Actor* thisx, PlayState* play) {
}
}
sFlagSwitchFuncs[sFlags[i][0]](play, thisx->params & 0x3F);
sFlagSwitchFuncs[sFlags[i][1]](play, (thisx->params >> 8) & 0x3F);
sFlagSwitchFuncs[sFlags[i][0]](play, PARAMS_GET_U(thisx->params, 0, 6));
sFlagSwitchFuncs[sFlags[i][1]](play, PARAMS_GET_U(thisx->params, 8, 6));
if (block->unk_24[i] & 2) {
((ObjOshihiki*)thisx->child)->cantMove = true;