1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-06 14:20:11 +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

@ -73,7 +73,7 @@ void EffectSsEnFire_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
OPEN_DISPS(gfxCtx, "../z_eff_en_fire.c", 169);
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
camYaw = (Camera_GetCamDirYaw(ACTIVE_CAM) + 0x8000);
camYaw = (Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) + 0x8000);
Matrix_RotateY(camYaw * (M_PI / 0x8000), MTXMODE_APPLY);
scale = Math_SinS(this->life * 0x333) * (this->rScale * 0.00005f);

View file

@ -178,7 +178,7 @@ void EffectSsFhgFlash_UpdateShock(GlobalContext* globalCtx, u32 index, EffectSs*
this->rXZRot = (this->rXZRot + rand) + 0x4000;
if (this->rParam == FHGFLASH_SHOCK_PLAYER) {
player = PLAYER;
player = GET_PLAYER(globalCtx);
randBodypart = Rand_ZeroFloat(17.9f);
this->pos.x = player->bodyPartsPos[randBodypart].x + Rand_CenteredFloat(10.0f);
this->pos.y = player->bodyPartsPos[randBodypart].y + Rand_CenteredFloat(15.0f);

View file

@ -86,12 +86,14 @@ void EffectSsFireTail_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this)
Matrix_Translate(this->pos.x + this->actor->world.pos.x, this->pos.y + this->actor->world.pos.y,
this->pos.z + this->actor->world.pos.z, MTXMODE_NEW);
} else {
Player* player = PLAYER;
Player* player = GET_PLAYER(globalCtx);
s16 bodyPart = this->rBodyPart;
this->pos.x = player->bodyPartsPos[bodyPart].x - (Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM)) * 5.0f);
this->pos.x =
player->bodyPartsPos[bodyPart].x - (Math_SinS(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx))) * 5.0f);
this->pos.y = player->bodyPartsPos[bodyPart].y;
this->pos.z = player->bodyPartsPos[bodyPart].z - (Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM)) * 5.0f);
this->pos.z =
player->bodyPartsPos[bodyPart].z - (Math_CosS(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx))) * 5.0f);
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
}
@ -99,11 +101,11 @@ void EffectSsFireTail_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this)
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
}
yaw = Math_Vec3f_Yaw(&scale, &this->vec) - Camera_GetCamDirYaw(ACTIVE_CAM);
yaw = Math_Vec3f_Yaw(&scale, &this->vec) - Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx));
temp1 = fabsf(Math_CosS(yaw));
temp2 = Math_SinS(yaw);
dist = Math_Vec3f_DistXZ(&scale, &this->vec) / (this->rReg10 * 0.1f);
Matrix_RotateY((s16)(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x8000) * (M_PI / 0x8000), MTXMODE_APPLY);
Matrix_RotateY((s16)(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) + 0x8000) * (M_PI / 0x8000), MTXMODE_APPLY);
Matrix_RotateZ(temp2 * this->rReg2 * dist * (M_PI / 180.0f), MTXMODE_APPLY);
temp2 = 1.0f - ((f32)(this->life + 1) / this->rLifespan);
temp2 = 1.0f - SQ(temp2);

View file

@ -117,7 +117,7 @@ void EffectSsHahen_DrawGray(GlobalContext* globalCtx, u32 index, EffectSs* this)
}
void EffectSsHahen_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) {
Player* player = PLAYER;
Player* player = GET_PLAYER(globalCtx);
this->rPitch += 55;
this->rYaw += 10;

View file

@ -348,7 +348,7 @@ s32 func_809AA0EC(EffectSs* this) {
void func_809AA230(EffectSs* this, GlobalContext* globalCtx) {
static f32 D_809AA5B0[] = { 10.0f, 20.0f, 40.0f };
Player* player = PLAYER;
Player* player = GET_PLAYER(globalCtx);
if (this->rReg8 == 0) {
if ((((this->rReg4 >> 4) & 1) * 0x10) == 0x10) {

View file

@ -131,8 +131,8 @@ void EffectSsLightning_Update(GlobalContext* globalCtx, u32 index, EffectSs* thi
pos.y = this->pos.y + (Math_SinS(this->rYaw - 0x4000) * scale);
scale = Math_CosS(this->rYaw - 0x4000) * scale;
pos.x = this->pos.x - (Math_CosS(Camera_GetInputDirYaw(ACTIVE_CAM)) * scale);
pos.z = this->pos.z + (Math_SinS(Camera_GetInputDirYaw(ACTIVE_CAM)) * scale);
pos.x = this->pos.x - (Math_CosS(Camera_GetInputDirYaw(GET_ACTIVE_CAM(globalCtx))) * scale);
pos.z = this->pos.z + (Math_SinS(Camera_GetInputDirYaw(GET_ACTIVE_CAM(globalCtx))) * scale);
EffectSsLightning_NewLightning(globalCtx, &pos, yaw, this);

View file

@ -82,7 +82,7 @@ void EffectSsSibuki_Update(GlobalContext* globalCtx, u32 index, EffectSs* this)
s32 pad[3];
f32 xzVelScale;
s16 yaw;
Player* player = PLAYER;
Player* player = GET_PLAYER(globalCtx);
if (this->pos.y <= player->actor.floorHeight) {
this->life = 0;

View file

@ -35,7 +35,7 @@ void EffectSsSolderSrchBall_Update(GlobalContext* globalCtx, u32 index, EffectSs
f32 playerPosDiffY;
f32 playerPosDiffZ;
s16* linkDetected;
Player* player = PLAYER;
Player* player = GET_PLAYER(globalCtx);
linkDetected = this->actor;