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

Defines for Actor#bgCheckFlags (#1126)

* First pass, tool assisted bgCheckFlags

* Few manual bgCheckFlags

* Run formatter

* Remove fake bgCheckFlags 10-15

* Move existing documentation to the defines

* Comment on `bgCheckFlags` and rephrase some doc

* Name obvious flags, and some cleanup

* Comment on flag 9 being wall-interaction-related (thanks engineer and fig)

* Run formatter

* `BGCHECKFLAG_7` -> `BGCHECKFLAG_GROUND_STRICT`

* Touch up water-related bgcheckflags doc

* `BGCHECKFLAG_9` -> `BGCHECKFLAG_PLAYER_WALL_INTERACT`
This commit is contained in:
Dragorn421 2022-02-19 03:16:19 +01:00 committed by GitHub
parent 251d90301c
commit 67f294774b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
121 changed files with 711 additions and 652 deletions

View file

@ -857,7 +857,7 @@ void func_80AEC780(EnRu1* this, GlobalContext* globalCtx) {
if ((func_80AEC5FC(this, globalCtx)) && (!Gameplay_InCsMode(globalCtx)) &&
(!(player->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_21))) &&
(player->actor.bgCheckFlags & 1)) {
(player->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
globalCtx->csCtx.segment = &D_80AF0880;
gSaveContext.cutsceneTrigger = 1;
@ -911,7 +911,7 @@ void func_80AEC9C4(EnRu1* this) {
}
void func_80AECA18(EnRu1* this) {
if (!(this->actor.bgCheckFlags & 1)) {
if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->action = 13;
this->unk_26C = 0.0f;
this->actor.velocity.y = 0.0f;
@ -1317,7 +1317,7 @@ void func_80AEDAE0(EnRu1* this, GlobalContext* globalCtx) {
DynaPolyActor* dynaPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.floorBgId);
if (dynaPolyActor == NULL || dynaPolyActor->actor.id == ACTOR_EN_BOX) {
this->actor.bgCheckFlags &= ~0x19;
this->actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_WALL | BGCHECKFLAG_CEILING);
}
}
@ -1332,7 +1332,7 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) {
s32 temp_a0;
s32 phi_v1;
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
velocityY = &this->actor.velocity.y;
dynaPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.floorBgId);
if (*velocityY <= 0.0f) {
@ -1368,7 +1368,7 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) {
func_80AED4FC(this);
}
}
if (this->actor.bgCheckFlags & 0x10) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_CEILING) {
speedXZ = &this->actor.speedXZ;
velocityY = &this->actor.velocity.y;
if (*speedXZ >= (kREG(27) * 0.01f) + 3.0f) {
@ -1381,7 +1381,7 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) {
func_80AED4FC(this);
}
}
if (this->actor.bgCheckFlags & 8) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) {
speedXZ = &this->actor.speedXZ;
if (*speedXZ != 0.0f) {
rotY = this->actor.world.rot.y;
@ -1515,7 +1515,7 @@ void func_80AEE2F8(EnRu1* this, GlobalContext* globalCtx) {
DynaPolyActor* dynaPolyActor;
s32 floorBgId;
if ((this->actor.bgCheckFlags & 1) && (this->actor.floorBgId != BGCHECK_SCENE)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.floorBgId != BGCHECK_SCENE)) {
floorBgId = this->actor.floorBgId;
dynaPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, floorBgId);
if ((dynaPolyActor != NULL) && (dynaPolyActor->actor.id == ACTOR_BG_BDAN_SWITCH)) {
@ -1534,7 +1534,7 @@ s32 func_80AEE394(EnRu1* this, GlobalContext* globalCtx) {
DynaPolyActor* dynaPolyActor;
s32 floorBgId;
if ((this->actor.bgCheckFlags & 1) && this->actor.floorBgId != BGCHECK_SCENE) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && this->actor.floorBgId != BGCHECK_SCENE) {
colCtx = &globalCtx->colCtx;
floorBgId = this->actor.floorBgId; // necessary match, can't move this out of this block unfortunately
dynaPolyActor = DynaPoly_GetActor(colCtx, floorBgId);
@ -1561,7 +1561,7 @@ void func_80AEE488(EnRu1* this, GlobalContext* globalCtx) {
this->roomNum3 = curRoomNum;
this->action = 31;
func_80AED520(this, globalCtx);
} else if ((!func_80AEE394(this, globalCtx)) && (!(this->actor.bgCheckFlags & 1))) {
} else if (!func_80AEE394(this, globalCtx) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
this->actor.minVelocityY = -((kREG(24) * 0.01f) + 6.8f);
this->actor.gravity = -((kREG(23) * 0.01f) + 1.3f);
this->action = 28;
@ -1570,7 +1570,8 @@ void func_80AEE488(EnRu1* this, GlobalContext* globalCtx) {
void func_80AEE568(EnRu1* this, GlobalContext* globalCtx) {
if (!func_80AEE394(this, globalCtx)) {
if ((this->actor.bgCheckFlags & 1) && (this->actor.speedXZ == 0.0f) && (this->actor.minVelocityY == 0.0f)) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speedXZ == 0.0f) &&
(this->actor.minVelocityY == 0.0f)) {
func_80AEE02C(this);
func_8002F580(&this->actor, globalCtx);
this->action = 27;
@ -1671,7 +1672,7 @@ void func_80AEE7C4(EnRu1* this, GlobalContext* globalCtx) {
}
s32 func_80AEEAC8(EnRu1* this, GlobalContext* globalCtx) {
if (this->actor.bgCheckFlags & 1) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {
func_80AEE02C(this);
func_8002F580(&this->actor, globalCtx);
this->action = 27;