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

Macros: PLAYER -> GET_PLAYER(globalCtx), ACTIVE_CAM -> GET_ACTIVE_CAM(globalCtx) (#921)

* PLAYER -> GET_PLAYER(globalCtx)

* ACTIVE_CAM -> GET_ACTIVE_CAM(globalCtx)

* PR Suggestions

* formatter

* Add brackets

* remove from actorfixer.py

* Bring back actorfixer.py change
This commit is contained in:
engineer124 2021-08-31 20:22:03 +10:00 committed by GitHub
parent f8498478c4
commit 1117783731
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
281 changed files with 1013 additions and 979 deletions

View file

@ -459,7 +459,7 @@ void func_80ADE9BC(EnPoh* this) {
}
void EnPoh_MoveTowardsPlayerHeight(EnPoh* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
Player* player = GET_PLAYER(globalCtx);
Math_StepToF(&this->actor.world.pos.y, player->actor.world.pos.y, 1.0f);
this->actor.world.pos.y += 2.5f * Math_SinS(this->unk_195 * 0x800);
@ -520,7 +520,7 @@ void func_80ADEC9C(EnPoh* this, GlobalContext* globalCtx) {
Player* player;
s16 facingDiff;
player = PLAYER;
player = GET_PLAYER(globalCtx);
SkelAnime_Update(&this->skelAnime);
if (this->unk_198 != 0) {
this->unk_198--;
@ -614,12 +614,16 @@ void func_80ADF15C(EnPoh* this, GlobalContext* globalCtx) {
if (this->unk_198 < 5) {
vec.y = Math_SinS((this->unk_198 * 0x1000) - 0x4000) * 23.0f + (this->actor.world.pos.y + 40.0f);
multiplier = Math_CosS((this->unk_198 * 0x1000) - 0x4000) * 23.0f;
vec.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier + this->actor.world.pos.x;
vec.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier + this->actor.world.pos.z;
vec.x = Math_SinS(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) + 0x4800) * multiplier +
this->actor.world.pos.x;
vec.z = Math_CosS(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) + 0x4800) * multiplier +
this->actor.world.pos.z;
} else {
vec.y = (this->actor.world.pos.y + 40.0f) + (15.0f * (this->unk_198 - 5));
vec.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.world.pos.x;
vec.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.world.pos.z;
vec.x =
Math_SinS(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) + 0x4800) * 23.0f + this->actor.world.pos.x;
vec.z =
Math_CosS(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) + 0x4800) * 23.0f + this->actor.world.pos.z;
}
EffectSsDeadDb_Spawn(globalCtx, &vec, &D_80AE1B60, &D_80AE1B6C, this->unk_198 * 10 + 80, 0, 255, 255, 255, 255,
0, 0, 255, 1, 9, 1);
@ -1189,7 +1193,7 @@ void EnPoh_DrawSoul(Actor* thisx, GlobalContext* globalCtx) {
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, this->info->primColor.r, this->info->primColor.g,
this->info->primColor.b, this->lightColor.a);
gDPSetEnvColor(POLY_XLU_DISP++, this->lightColor.r, this->lightColor.g, this->lightColor.b, 255);
Matrix_RotateY((s16)(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x8000) * 9.58738e-05f, MTXMODE_APPLY);
Matrix_RotateY((s16)(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) + 0x8000) * 9.58738e-05f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_poh.c", 2910),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, this->info->soulDisplayList);