summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorengineer124 <47598039+engineer124@users.noreply.github.com>2021-10-13 03:27:29 +1100
committerGitHub <noreply@github.com>2021-10-12 13:27:29 -0300
commit3aeadb42b8a195b3d2f67ce71fcd184ddf26d856 (patch)
tree9b7ae22819651306b4bd8c59f2384ac84c15de99 /src/code
parent4c43661cf34544a6ffc6817912021de5679e8f42 (diff)
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
Diffstat (limited to 'src/code')
-rw-r--r--src/code/code_800E8EA0.c4
-rw-r--r--src/code/z_collision_check.c4
-rw-r--r--src/code/z_effect_soft_sprite_old_init.c2
-rw-r--r--src/code/z_en_item00.c4
-rw-r--r--src/code/z_quake.c6
-rw-r--r--src/code/z_room.c2
-rw-r--r--src/code/z_snap.c4
7 files changed, 13 insertions, 13 deletions
diff --git a/src/code/code_800E8EA0.c b/src/code/code_800E8EA0.c
index ca2e9e841..754b8759d 100644
--- a/src/code/code_800E8EA0.c
+++ b/src/code/code_800E8EA0.c
@@ -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;
diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c
index 40ea71ee0..6ea0b2fcf 100644
--- a/src/code/z_collision_check.c
+++ b/src/code/z_collision_check.c
@@ -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;
diff --git a/src/code/z_effect_soft_sprite_old_init.c b/src/code/z_effect_soft_sprite_old_init.c
index 39cc4af73..aa461153c 100644
--- a/src/code/z_effect_soft_sprite_old_init.c
+++ b/src/code/z_effect_soft_sprite_old_init.c
@@ -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);
diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c
index 13be40c0a..0a412c2da 100644
--- a/src/code/z_en_item00.c
+++ b/src/code/z_en_item00.c
@@ -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;
diff --git a/src/code/z_quake.c b/src/code/z_quake.c
index b45e02381..aeb8370ab 100644
--- a/src/code/z_quake.c
+++ b/src/code/z_quake.c
@@ -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;
diff --git a/src/code/z_room.c b/src/code/z_room.c
index 0a11f83fe..5f900ea87 100644
--- a/src/code/z_room.c
+++ b/src/code/z_room.c
@@ -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)) &&
diff --git a/src/code/z_snap.c b/src/code/z_snap.c
index b6538a685..120861ff5 100644
--- a/src/code/z_snap.c
+++ b/src/code/z_snap.c
@@ -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;