mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Macros: PLAYER -> GET_PLAYER(globalCtx) and ACTIVE_CAM -> GET_ACTIVE_CAM(globalCtx) (#283)
* PLAYER -> GET_PLAYER(globalCtx), ACTIVE_CAM -> GET_ACTIVE_CAM(globalCtx) * formatter * PR Suggestions * `FIRST_ENEMY` -> `GET_FIRST_ENEMY(globalCtx)` * Fix merge conflicts
This commit is contained in:
+3
-4
@@ -17,8 +17,7 @@
|
||||
#define VIRTUAL_TO_PHYSICAL(addr) (uintptr_t)((u8*)(addr)-0x80000000)
|
||||
#define SEGMENTED_TO_VIRTUAL(addr) (void*)(PHYSICAL_TO_VIRTUAL(gSegments[SEGMENT_NUMBER(addr)]) + SEGMENT_OFFSET(addr))
|
||||
|
||||
// Currently most often called ctxt in MM, TODO: Refactor names when its used
|
||||
#define ACTIVE_CAM globalCtx->cameraPtrs[globalCtx->activeCamera]
|
||||
#define GET_ACTIVE_CAM(globalCtx) ((globalCtx)->cameraPtrs[(globalCtx)->activeCamera])
|
||||
#define MAIN_CAM 0
|
||||
#define SUBCAM_FREE 0
|
||||
|
||||
@@ -37,9 +36,9 @@
|
||||
} \
|
||||
(void)0
|
||||
|
||||
#define PLAYER ((Player*)globalCtx->actorCtx.actorList[ACTORCAT_PLAYER].first)
|
||||
#define GET_PLAYER(globalCtx) ((Player*)(globalCtx)->actorCtx.actorList[ACTORCAT_PLAYER].first)
|
||||
|
||||
#define FIRST_ENEMY ((Actor*)globalCtx->actorCtx.actorList[ACTORCAT_ENEMY].first)
|
||||
#define GET_FIRST_ENEMY(globalCtx) ((Actor*)(globalCtx)->actorCtx.actorList[ACTORCAT_ENEMY].first)
|
||||
|
||||
// linkAge still exists in MM, but is always set to 0 (always adult)
|
||||
// There are remnants of these macros from OOT, but they are essentially useless
|
||||
|
||||
@@ -54,7 +54,7 @@ s32 func_800E8FA4(Actor* actor, Vec3f* param_2, Vec3s* param_3, Vec3s* param_4)
|
||||
}
|
||||
|
||||
s32 func_800E9138(GlobalContext* globalCtx, Actor* actor, Vec3s* param_3, Vec3s* param_4, f32 param_5) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s16 sVar3;
|
||||
Vec3f local_14;
|
||||
s16 sVar3A;
|
||||
@@ -83,7 +83,7 @@ s32 func_800E9138(GlobalContext* globalCtx, Actor* actor, Vec3s* param_3, Vec3s*
|
||||
}
|
||||
|
||||
s32 func_800E9250(GlobalContext* globalCtx, Actor* actor, Vec3s* param_3, Vec3s* param_4, Vec3f param_5) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s16 sVar3;
|
||||
Vec3f local_14;
|
||||
s16 sVar3A;
|
||||
|
||||
@@ -2913,8 +2913,8 @@ void CollisionCheck_AC(GlobalContext* globalCtx, CollisionCheckContext* colCtxt,
|
||||
/**
|
||||
* Iterates through all AT colliders, testing them for AC collisions with each AC collider, setting the info regarding
|
||||
* the collision for each AC and AT collider that collided. Then spawns hitmarks and plays sound effects for each
|
||||
* successful collision. To collide, an AT collider must share a type (PLAYER, ENEMY, or BOMB) with the AC collider and
|
||||
* the toucher and bumper elements that overlapped must share a dmgFlag.
|
||||
* successful collision. To collide, an AT collider must share a type (AC_TYPE_PLAYER, AC_TYPE_ENEMY, or AC_TYPE_OTHER)
|
||||
* with the AC collider and the toucher and bumper elements that overlapped must share a dmgFlag.
|
||||
*/
|
||||
void CollisionCheck_AT(GlobalContext* globalCtx, CollisionCheckContext* colCtxt) {
|
||||
Collider** col;
|
||||
|
||||
@@ -899,7 +899,7 @@ void EffectSsFireTail_SpawnFlame(GlobalContext* globalCtx, Actor* actor, Vec3f*
|
||||
#endif
|
||||
|
||||
void EffectSsFireTail_SpawnFlameOnPlayer(GlobalContext* globalCtx, f32 scale, s16 bodyPart, f32 colorIntensity) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
EffectSsFireTail_SpawnFlame(globalCtx, &player->actor, &player->bodyPartsPos[bodyPart], scale, bodyPart,
|
||||
colorIntensity);
|
||||
|
||||
@@ -403,7 +403,7 @@ void func_800A6780(EnItem00* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_800A6A40(EnItem00* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (this->unk14A != 0) {
|
||||
if (Actor_HasParent(&this->actor, globalCtx) == 0) {
|
||||
@@ -439,7 +439,7 @@ void func_800A6A40(EnItem00* this, GlobalContext* globalCtx) {
|
||||
void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnItem00* this = THIS;
|
||||
s32 pad;
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s32 sp38 = player->stateFlags3 & 0x1000;
|
||||
s32 getItemId = GI_NONE;
|
||||
s32 pad2;
|
||||
|
||||
+3
-3
@@ -444,7 +444,7 @@ void Quake2_Update(void) {
|
||||
Player* player;
|
||||
GlobalContext* globalCtx = sQuake2Context.globalCtx;
|
||||
PosRot playerPosRot;
|
||||
Camera* camera = globalCtx->cameraPtrs[globalCtx->activeCamera];
|
||||
Camera* camera = GET_ACTIVE_CAM(globalCtx);
|
||||
f32 speedRatio = CLAMP_MAX(camera->speedRatio, 1.0f);
|
||||
|
||||
if (sQuake2Context.type != 0) {
|
||||
@@ -605,7 +605,7 @@ void Quake2_Update(void) {
|
||||
angle1 = 0x3F0;
|
||||
angle2 = 0x156;
|
||||
sQuake2Context.countdown = 2;
|
||||
player = PLAYER;
|
||||
player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (&player->actor != NULL) {
|
||||
func_800B8248(&playerPosRot, player);
|
||||
@@ -654,7 +654,7 @@ void Quake2_Update(void) {
|
||||
angle1 = 0x3F0;
|
||||
angle2 = 0x156;
|
||||
sQuake2Context.countdown = 2;
|
||||
player = PLAYER;
|
||||
player = GET_PLAYER(globalCtx);
|
||||
angle1Speed = 359.2f;
|
||||
angle2Speed = -18.5f;
|
||||
rotX = 0.0f;
|
||||
|
||||
+1
-1
@@ -114,7 +114,7 @@ s32 Room_HandleLoadCallbacks(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
gSegments[3] = PHYSICAL_TO_VIRTUAL(roomCtx->activeRoomVram);
|
||||
|
||||
Scene_ProcessHeader(globalCtx, (SceneCmd*)roomCtx->currRoom.segment);
|
||||
func_80123140(globalCtx, PLAYER);
|
||||
func_80123140(globalCtx, GET_PLAYER(globalCtx));
|
||||
Actor_SpawnTransitionActors(globalCtx, &globalCtx->actorCtx);
|
||||
|
||||
if (((globalCtx->sceneNum != SCENE_IKANA) || (roomCtx->currRoom.num != 1)) &&
|
||||
|
||||
+2
-2
@@ -119,7 +119,7 @@ s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos,
|
||||
s32 ret = 0;
|
||||
u32 unk2;
|
||||
|
||||
camera = ACTIVE_CAM;
|
||||
camera = GET_ACTIVE_CAM(globalCtx);
|
||||
|
||||
distance = OLib_Vec3fDist(pos, &camera->eye);
|
||||
if ((distance < distanceMin) || (distanceMax < distance)) {
|
||||
@@ -148,7 +148,7 @@ s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos,
|
||||
}
|
||||
|
||||
actors[0] = actor;
|
||||
actors[1] = &PLAYER->actor;
|
||||
actors[1] = &GET_PLAYER(globalCtx)->actor;
|
||||
if (CollisionCheck_LineOCCheck(globalCtx, &globalCtx->colChkCtx, pos, &camera->eye, actors, 2) != 0) {
|
||||
func_8013A41C(0x3b);
|
||||
ret |= 0x3b;
|
||||
|
||||
@@ -72,7 +72,7 @@ void ArmsHook_Wait(ArmsHook* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.parent == NULL) {
|
||||
ArmsHook_SetupAction(this, ArmsHook_Shoot);
|
||||
func_800B6C04(&this->actor, 20.0f);
|
||||
this->actor.parent = &PLAYER->actor;
|
||||
this->actor.parent = &GET_PLAYER(globalCtx)->actor;
|
||||
this->timer = 26;
|
||||
}
|
||||
}
|
||||
@@ -120,7 +120,7 @@ void ArmsHook_AttachHookToActor(ArmsHook* this, Actor* actor) {
|
||||
}
|
||||
|
||||
void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((this->actor.parent == NULL) || (!func_801240C8(player))) {
|
||||
ArmsHook_DetachHookFromActor(this);
|
||||
@@ -288,7 +288,7 @@ static Vec3f D_808C1C4C = { 0.0f, -500.0f, 0.0f };
|
||||
void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ArmsHook* this = THIS;
|
||||
f32 f0;
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);;
|
||||
|
||||
if (player->actor.draw != NULL && player->rightHandType == 0xB) {
|
||||
Vec3f sp68;
|
||||
|
||||
@@ -59,7 +59,7 @@ void BgCtowerRot_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->actionFunc = BgCtowerRot_CorridorRotate;
|
||||
return;
|
||||
}
|
||||
player = PLAYER;
|
||||
player = GET_PLAYER(globalCtx);
|
||||
if (this->dyna.actor.params == MAIN_DOOR) {
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06017410);
|
||||
this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y + 0x4000;
|
||||
@@ -85,7 +85,7 @@ void BgCtowerRot_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void BgCtowerRot_CorridorRotate(BgCtowerRot* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Vec3f offset;
|
||||
f32 rotZ;
|
||||
f32 offsetDiffZ;
|
||||
@@ -128,7 +128,7 @@ void BgCtowerRot_DoorClose(BgCtowerRot* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void BgCtowerRot_DoorIdle(BgCtowerRot* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Vec3f offset;
|
||||
|
||||
Actor_CalcOffsetOrientedToDrawRotation(&this->dyna.actor, &offset, &player->actor.world.pos);
|
||||
|
||||
@@ -523,8 +523,8 @@ void func_80A9C058(BgHakuginPost* this, GlobalContext* globalCtx, BgHakuginPostU
|
||||
sp44.x = this->dyna.actor.home.pos.x + unkStruct1->unk_14.x;
|
||||
sp44.y = this->unk_16C + unkStruct1->unk_14.y;
|
||||
sp44.z = this->dyna.actor.home.pos.z + unkStruct1->unk_14.z;
|
||||
func_8013ECE0(Math3D_DistanceSquared(&sp44, &PLAYER->actor.world.pos), 255, 20, 150);
|
||||
quake = Quake_Add(ACTIVE_CAM, 3);
|
||||
func_8013ECE0(Math3D_DistanceSquared(&sp44, &GET_PLAYER(globalCtx)->actor.world.pos), 255, 20, 150);
|
||||
quake = Quake_Add(GET_ACTIVE_CAM(globalCtx), 3);
|
||||
Quake_SetSpeed(quake, 20000);
|
||||
Quake_SetQuakeValues(quake, 7, 0, 0, 0);
|
||||
Quake_SetCountdown(quake, 12);
|
||||
@@ -540,8 +540,8 @@ void func_80A9C058(BgHakuginPost* this, GlobalContext* globalCtx, BgHakuginPostU
|
||||
|
||||
void func_80A9C18C(BgHakuginPost* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
Player* player = PLAYER;
|
||||
Camera* activeCam = ACTIVE_CAM;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Camera* activeCam = GET_ACTIVE_CAM(globalCtx);
|
||||
s16 quake;
|
||||
|
||||
func_8013ECE0(Math3D_XZDistanceSquared(player->actor.world.pos.x, player->actor.world.pos.z,
|
||||
@@ -814,7 +814,7 @@ void func_80A9CE00(BgHakuginPost* this) {
|
||||
|
||||
void func_80A9CE1C(BgHakuginPost* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
ColliderCylinder* collider;
|
||||
s32 yDiff;
|
||||
s32 i;
|
||||
|
||||
@@ -146,7 +146,7 @@ void func_80BD5A18(BgIkanaShutter* this, GlobalContext* globalCtx) {
|
||||
this->dyna.actor.velocity.y *= 0.978f;
|
||||
this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y;
|
||||
if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) {
|
||||
quake = Quake_Add(ACTIVE_CAM, 3);
|
||||
quake = Quake_Add(GET_ACTIVE_CAM(globalCtx), 3);
|
||||
Quake_SetSpeed(quake, 0x5420);
|
||||
Quake_SetQuakeValues(quake, 4, 0, 0, 0);
|
||||
Quake_SetCountdown(quake, 12);
|
||||
|
||||
@@ -49,7 +49,7 @@ static InitChainEntry sInitChain[] = {
|
||||
s32 func_80C0A740(BgIkninSusceil* this, GlobalContext* globalCtx) {
|
||||
s32 pad2[2];
|
||||
Vec3f offset;
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
Actor_CalcOffsetOrientedToDrawRotation(&this->dyna.actor, &offset, &player->actor.world.pos);
|
||||
|
||||
@@ -66,7 +66,7 @@ void func_80C0A838(BgIkninSusceil* this, GlobalContext* globalCtx) {
|
||||
|
||||
void func_80C0A86C(BgIkninSusceil* this, GlobalContext* globalCtx, s16 verticalMag, s16 countdown, s32 arg4) {
|
||||
s32 pad;
|
||||
s16 quake = Quake_Add(ACTIVE_CAM, 3);
|
||||
s16 quake = Quake_Add(GET_ACTIVE_CAM(globalCtx), 3);
|
||||
|
||||
Quake_SetSpeed(quake, 0x7B30);
|
||||
Quake_SetQuakeValues(quake, verticalMag, 0, 0, 0);
|
||||
@@ -84,7 +84,7 @@ s32 func_80C0A95C(BgIkninSusceil* this, GlobalContext* globalCtx) {
|
||||
s32 phi_t0 = true;
|
||||
s32 i;
|
||||
f32 new_var;
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Vec3f offset;
|
||||
f32 temp1, temp2, temp3, temp4;
|
||||
|
||||
@@ -218,7 +218,7 @@ void func_80C0AE5C(BgIkninSusceil* this, GlobalContext* globalCtx) {
|
||||
void BgIkninSusceil_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
BgIkninSusceil* this = THIS;
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((this->unk168 == 0) && (this->unk166 > 0) && (player->stateFlags3 & 0x100) && (player->unk_B48 > 1000.0f)) {
|
||||
this->unk168 = 2;
|
||||
|
||||
@@ -25,7 +25,7 @@ extern Gfx D_06000088[];
|
||||
extern CollisionHeader D_060011C0;
|
||||
|
||||
void BgTobira01_Open(BgTobira01* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s16 cutsceneId = this->dyna.actor.cutscene;
|
||||
s16 prevTimer;
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ void DoorAna_WaitClosed(DoorAna* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s32 dooranaType = GET_DOORANA_TYPE(this);
|
||||
s8 pad[4];
|
||||
s32 entranceIndex;
|
||||
@@ -187,7 +187,7 @@ void DoorAna_GrabLink(DoorAna* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if ((this->actor.yDistToPlayer <= 0.0f) && (this->actor.xzDistToPlayer > 20.0f)) {
|
||||
player = PLAYER;
|
||||
player = GET_PLAYER(globalCtx);
|
||||
player->actor.world.pos.x = (Math_SinS(this->actor.yawTowardsPlayer) * 20.0f) + this->actor.world.pos.x;
|
||||
player->actor.world.pos.z = (Math_CosS(this->actor.yawTowardsPlayer) * 20.0f) + this->actor.world.pos.z;
|
||||
}
|
||||
@@ -197,7 +197,7 @@ void DoorAna_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
DoorAna* this = THIS;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
this->actor.shape.rot.y = BINANG_ROT180(func_800DFCDC(globalCtx->cameraPtrs[globalCtx->activeCamera]));
|
||||
this->actor.shape.rot.y = BINANG_ROT180(func_800DFCDC(GET_ACTIVE_CAM(globalCtx)));
|
||||
}
|
||||
|
||||
void DoorAna_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
@@ -223,7 +223,7 @@ void DoorSpiral_WaitForObject(DoorSpiral* this, GlobalContext* globalCtx) {
|
||||
*/
|
||||
f32 DoorSpiral_GetDistFromPlayer(GlobalContext* globalCtx, DoorSpiral* this, f32 yOffset, f32 spiralWidth,
|
||||
f32 spiralHeight) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Vec3f target;
|
||||
Vec3f offset;
|
||||
|
||||
@@ -244,7 +244,7 @@ f32 DoorSpiral_GetDistFromPlayer(GlobalContext* globalCtx, DoorSpiral* this, f32
|
||||
* Checks if the player should climb the stairs.
|
||||
*/
|
||||
s32 DoorSpiral_PlayerShouldClimb(DoorSpiral* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (!(func_801233E4(globalCtx))) {
|
||||
SpiralInfo* spiralInfo = &sSpiralInfo[this->spiralType];
|
||||
@@ -277,7 +277,7 @@ void DoorSpiral_Wait(DoorSpiral* this, GlobalContext* globalCtx) {
|
||||
if (this->shouldClimb) {
|
||||
DoorSpiral_SetupAction(this, DoorSpiral_PlayerClimb);
|
||||
} else if (DoorSpiral_PlayerShouldClimb(this, globalCtx)) {
|
||||
player = PLAYER;
|
||||
player = GET_PLAYER(globalCtx);
|
||||
|
||||
player->doorType = 4;
|
||||
player->doorDirection = this->orientation;
|
||||
@@ -293,7 +293,7 @@ void DoorSpiral_Wait(DoorSpiral* this, GlobalContext* globalCtx) {
|
||||
* Player is climbing the stairs.
|
||||
*/
|
||||
void DoorSpiral_PlayerClimb(DoorSpiral* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (!(player->stateFlags1 & 0x20000000)) {
|
||||
DoorSpiral_SetupAction(this, DoorSpiral_WaitForObject);
|
||||
@@ -304,7 +304,7 @@ void DoorSpiral_PlayerClimb(DoorSpiral* this, GlobalContext* globalCtx) {
|
||||
void DoorSpiral_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
DoorSpiral* this = (DoorSpiral*)thisx;
|
||||
s32 pad;
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((!(player->stateFlags1 & 0x100004C0)) || (this->actionFunc == DoorSpiral_WaitForObject)) {
|
||||
this->actionFunc(this, globalCtx);
|
||||
|
||||
@@ -163,7 +163,7 @@ void func_80918FE4(EffDust* this, GlobalContext* globalCtx) {
|
||||
|
||||
void func_80919230(EffDust* this, GlobalContext* globalCtx) {
|
||||
s16 theta;
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Actor* parent = this->actor.parent;
|
||||
f32* distanceTraveled = this->distanceTraveled;
|
||||
s32 i;
|
||||
@@ -262,7 +262,7 @@ void func_80919768(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
s16 sp92;
|
||||
Vec3f activeCamEye;
|
||||
|
||||
activeCamEye = ACTIVE_CAM->eye;
|
||||
activeCamEye = GET_ACTIVE_CAM(globalCtx)->eye;
|
||||
sp92 = Math_Vec3f_Yaw(&activeCamEye, &thisx->world.pos);
|
||||
|
||||
OPEN_DISPS(gfxCtx);
|
||||
@@ -313,7 +313,7 @@ void func_809199FC(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
Vec3f* initialPositions;
|
||||
s32 i;
|
||||
f32 aux;
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
OPEN_DISPS(gfxCtx);
|
||||
func_8012C28C(gfxCtx);
|
||||
|
||||
@@ -513,7 +513,7 @@ void EnBigpo_WarpingOut(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void EnBigpo_SetupWarpIn(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
f32 distance = CLAMP_MIN(this->actor.xzDistToPlayer, 200.0f);
|
||||
s16 randomYaw = (Rand_Next() >> 0x14) + this->actor.yawTowardsPlayer;
|
||||
|
||||
@@ -559,7 +559,7 @@ void EnBigpo_SetupIdleFlying(EnBigpo* this) {
|
||||
}
|
||||
|
||||
void EnBigpo_IdleFlying(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
DECR(this->idleTimer);
|
||||
@@ -611,7 +611,7 @@ void EnBigpo_SetupSpinAttack(EnBigpo* this) {
|
||||
}
|
||||
|
||||
void EnBigpo_SpinAttack(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s16 yawDiff;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
@@ -636,7 +636,7 @@ void EnBigpo_SetupSpinDown(EnBigpo* this) {
|
||||
}
|
||||
|
||||
void EnBigpo_SpinningDown(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
Math_SmoothStepToF(&this->actor.world.pos.y, player->actor.world.pos.y + 100.0f, 0.3f, 5.0f, 1.0f);
|
||||
@@ -699,7 +699,7 @@ void EnBigpo_BurnAwayDeath(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
|
||||
this->idleTimer++;
|
||||
if (this->idleTimer < 8) {
|
||||
cam = func_800DFCDC(ACTIVE_CAM) + 0x4800;
|
||||
cam = func_800DFCDC(GET_ACTIVE_CAM(globalCtx)) + 0x4800;
|
||||
if (this->idleTimer < 5) {
|
||||
unkTemp = (this->idleTimer << 0xC) - 0x4000;
|
||||
// 1.4.0...1 is NOT 1.4, the rodata demands it
|
||||
@@ -869,7 +869,7 @@ void EnBigpo_SelectRandomFireLocations(EnBigpo* this, GlobalContext* globalCtx)
|
||||
s32 fireCount = 0;
|
||||
|
||||
// count the number of possible fires we can find (4 in vanilla)
|
||||
for (enemyPtr = FIRST_ENEMY; enemyPtr != NULL; enemyPtr = enemyPtr->next) {
|
||||
for (enemyPtr = GET_FIRST_ENEMY(globalCtx); enemyPtr != NULL; enemyPtr = enemyPtr->next) {
|
||||
if (enemyPtr->id == ACTOR_EN_BIGPO && enemyPtr->params == ENBIGPO_POSSIBLEFIRE) {
|
||||
fireCount++;
|
||||
}
|
||||
@@ -887,7 +887,7 @@ void EnBigpo_SelectRandomFireLocations(EnBigpo* this, GlobalContext* globalCtx)
|
||||
|
||||
// for available possiblefires, pick three to be random fires
|
||||
for (fireIndex = 0; fireIndex < ARRAY_COUNT(this->fires); fireIndex++, fireCount--) {
|
||||
enemyPtr = FIRST_ENEMY;
|
||||
enemyPtr = GET_FIRST_ENEMY(globalCtx);
|
||||
randomIndex = ((s32)Rand_ZeroFloat(fireCount)) % fireCount;
|
||||
|
||||
while (enemyPtr != NULL) {
|
||||
@@ -920,7 +920,7 @@ void EnBigpo_SelectRandomFireLocations(EnBigpo* this, GlobalContext* globalCtx)
|
||||
}
|
||||
|
||||
// remove unused fires
|
||||
for (enemyPtr = FIRST_ENEMY; enemyPtr != NULL; enemyPtr = enemyPtr->next) {
|
||||
for (enemyPtr = GET_FIRST_ENEMY(globalCtx); enemyPtr != NULL; enemyPtr = enemyPtr->next) {
|
||||
if (enemyPtr->id == ACTOR_EN_BIGPO && enemyPtr->params == ENBIGPO_POSSIBLEFIRE) {
|
||||
randomFirePo = (EnBigpo*)enemyPtr;
|
||||
randomFirePo->actionFunc = EnBigpo_Die;
|
||||
@@ -1227,7 +1227,7 @@ void EnBigpo_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
*/
|
||||
void EnBigpo_UpdateFire(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnBigpo* this = (EnBigpo*)thisx;
|
||||
this->actor.shape.rot.y = BINANG_ROT180(func_800DFCDC(ACTIVE_CAM));
|
||||
this->actor.shape.rot.y = BINANG_ROT180(func_800DFCDC(GET_ACTIVE_CAM(globalCtx)));
|
||||
this->actionFunc(this, globalCtx);
|
||||
}
|
||||
|
||||
@@ -1357,7 +1357,7 @@ void EnBigpo_DrawScoopSoul(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->actor.world.pos.z, this->mainColor.r, this->mainColor.g, this->mainColor.b,
|
||||
this->mainColor.a * 2);
|
||||
|
||||
Matrix_RotateY(BINANG_ROT180(func_800DFCDC(ACTIVE_CAM)), MTXMODE_APPLY);
|
||||
Matrix_RotateY(BINANG_ROT180(func_800DFCDC(GET_ACTIVE_CAM(globalCtx))), MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -1377,7 +1377,7 @@ void EnBigpo_DrawLantern(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Gfx* dispHead;
|
||||
Vec3f vec1;
|
||||
Vec3f vec2;
|
||||
Camera* cam = ACTIVE_CAM;
|
||||
Camera* cam = GET_ACTIVE_CAM(globalCtx);
|
||||
|
||||
if (cam != NULL) {
|
||||
Math_Vec3f_Diff(&cam->eye, &cam->at, &vec1);
|
||||
@@ -1437,7 +1437,7 @@ void EnBigpo_DrawCircleFlames(Actor* thisx, GlobalContext* globalCtx) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
Matrix_RotateY(BINANG_ROT180(func_800DFCDC(ACTIVE_CAM)), MTXMODE_NEW);
|
||||
Matrix_RotateY(BINANG_ROT180(func_800DFCDC(GET_ACTIVE_CAM(globalCtx))), MTXMODE_NEW);
|
||||
if (this->actionFunc == EnBigpo_SpawnCutsceneStage6) {
|
||||
Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
|
||||
fireRadius = 500;
|
||||
|
||||
@@ -80,7 +80,7 @@ static struct_80B8E1A8 D_809CDC7C[] = {
|
||||
};
|
||||
|
||||
void func_809CCDE0(EnBji01* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Vec3f sp58;
|
||||
s32 pad[2];
|
||||
|
||||
|
||||
@@ -509,7 +509,7 @@ void EnClearTag_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void EnClearTag_UpdateCamera(EnClearTag* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Camera* camera;
|
||||
s32 pad;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user