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

@ -10,10 +10,11 @@
#define FLAGS ACTOR_FLAG_4
#define OBJSWITCH_TYPE(thisx) ((thisx)->params & 7)
#define OBJSWITCH_SUBTYPE(thisx) (((thisx)->params >> 4) & 7)
#define OBJSWITCH_SWITCH_FLAG(thisx) (((thisx)->params >> 8) & 0x3F)
#define OBJSWITCH_FROZEN(thisx) (((thisx)->params >> 7) & 1)
#define OBJSWITCH_TYPE(thisx) PARAMS_GET_U((thisx)->params, 0, 3)
#define OBJSWITCH_SUBTYPE(thisx) PARAMS_GET_U((thisx)->params, 4, 3)
#define OBJSWITCH_SWITCH_FLAG(thisx) PARAMS_GET_U((thisx)->params, 8, 6)
#define OBJSWITCH_FROZEN(thisx) PARAMS_GET_U((thisx)->params, 7, 1)
#define OBJSWITCH_FROZEN_FLAG (1 << 7)
void ObjSwitch_Init(Actor* thisx, PlayState* play);
@ -290,11 +291,8 @@ void ObjSwitch_UpdateTwoTexScrollXY(ObjSwitch* this) {
void ObjSwitch_Init(Actor* thisx, PlayState* play) {
ObjSwitch* this = (ObjSwitch*)thisx;
s32 isSwitchFlagSet;
s32 type;
isSwitchFlagSet = Flags_GetSwitch(play, OBJSWITCH_SWITCH_FLAG(&this->dyna.actor));
type = OBJSWITCH_TYPE(&this->dyna.actor);
s32 isSwitchFlagSet = Flags_GetSwitch(play, OBJSWITCH_SWITCH_FLAG(&this->dyna.actor));
s32 type = OBJSWITCH_TYPE(&this->dyna.actor);
if (type == OBJSWITCH_TYPE_FLOOR || type == OBJSWITCH_TYPE_FLOOR_RUSTY) {
ObjSwitch_InitDynaPoly(this, play, &gFloorSwitchCol, DYNA_TRANSFORM_POS);
@ -798,9 +796,8 @@ void ObjSwitch_DrawCrystal(Actor* thisx, PlayState* play) {
};
ObjSwitch* this = (ObjSwitch*)thisx;
s32 pad;
s32 subType;
s32 subType = OBJSWITCH_SUBTYPE(&this->dyna.actor);
subType = OBJSWITCH_SUBTYPE(&this->dyna.actor);
func_8002ED80(&this->dyna.actor, play, 0);
OPEN_DISPS(play->state.gfxCtx, "../z_obj_switch.c", 1494);