summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorTom Overton <tom-overton@users.noreply.github.com>2024-02-29 19:01:29 -0800
committerGitHub <noreply@github.com>2024-02-29 20:01:29 -0700
commit55a27a19353e0d5a0d8706ad1a5fcb877290b949 (patch)
tree02384425d7197b942573321eef833111b954f5e5 /src/code
parent26183fe65445602a9fbf5dbe7338be08a6bb8ec9 (diff)
Update `OPEN_DISPS`/`CLOSE_DISPS` macros, clean up various fake matches, and match `mSM_draw_mail` (#152)
* Update `OPEN_DISPS`/`CLOSE_DISPS` macros and match `mSM_draw_mail` * Improve matches in `ac_train_window`
Diffstat (limited to 'src/code')
-rw-r--r--src/code/game.c3
-rw-r--r--src/code/m_actor.c6
-rw-r--r--src/code/m_actor_shadow.c17
-rw-r--r--src/code/m_lib.c6
-rw-r--r--src/code/m_rcp.c23
5 files changed, 12 insertions, 43 deletions
diff --git a/src/code/game.c b/src/code/game.c
index beaf04f..a188125 100644
--- a/src/code/game.c
+++ b/src/code/game.c
@@ -108,9 +108,6 @@ void game_debug_draw_last(Game* game, GraphicsContext* gfxCtx) {
gfxclose(gfxHead, gfx);
POLY_OPA_DISP = gfx;
- do {
- } while (0);
-
CLOSE_DISPS(gfxCtx);
}
diff --git a/src/code/m_actor.c b/src/code/m_actor.c
index 688230c..83ccf30 100644
--- a/src/code/m_actor.c
+++ b/src/code/m_actor.c
@@ -254,12 +254,6 @@ void Actor_draw(Game_Play* game_play, Actor* actor) {
fault_AddClient(&faultClient, func_80056380_jp, actor, "Actor_draw");
- //! FAKE
- if (1) {}
- if (1) {}
- if (1) {}
- if (1) {}
-
OPEN_DISPS(game_play->state.gfxCtx);
light = Global_light_read(&game_play->glight, game_play->state.gfxCtx);
diff --git a/src/code/m_actor_shadow.c b/src/code/m_actor_shadow.c
index c0ab1bd..b8c993a 100644
--- a/src/code/m_actor_shadow.c
+++ b/src/code/m_actor_shadow.c
@@ -192,19 +192,6 @@ void mActorShadow_GetLastAlphaScale(f32* scale, u8* alpha, Actor* actor, ShadowI
*alpha = alphaCalc;
}
-#define AC_GCN_OPEN_DISP(gfxCtx) \
- { \
- GraphicsContext* __gfxCtx = gfxCtx; \
- int __gfx_opened = 0; \
- do { \
- } while (0)
-
-#define AC_GCN_CLOSE_DISP(gfxCtx) \
- (void)__gfx_opened; \
- } \
- do { \
- } while (0)
-
void mActorShadow_DrawActorShadow(Actor* actor, ShadowInfo* shadow, Game* game, f32 rad, s32 id, xyz_t ofs) {
Game_Play* play = (Game_Play*)game;
u8 alpha;
@@ -217,7 +204,7 @@ void mActorShadow_DrawActorShadow(Actor* actor, ShadowInfo* shadow, Game* game,
mActorShadow_GetLastAlphaScale(&scale, &alpha, actor, shadow);
- AC_GCN_OPEN_DISP(play->state.gfxCtx);
+ OPEN_DISPS(play->state.gfxCtx);
_texture_z_light_fog_prim_shadow(play->state.gfxCtx);
@@ -287,7 +274,7 @@ void mActorShadow_DrawActorShadow(Actor* actor, ShadowInfo* shadow, Game* game,
gSPDisplayList(SHADOW_DISP++, ef_shadow_in_modelT);
}
- AC_GCN_CLOSE_DISP(play->state.gfxCtx);
+ CLOSE_DISPS(play->state.gfxCtx);
}
void mActorShadow_GetShadowPosition(Actor* actor, xyz_t* position) {
diff --git a/src/code/m_lib.c b/src/code/m_lib.c
index 6529fe3..4ec530d 100644
--- a/src/code/m_lib.c
+++ b/src/code/m_lib.c
@@ -594,9 +594,6 @@ void none_proc2(Actor* actor UNUSED, Game_Play* play UNUSED) {
}
void Cheap_gfx_display(Game_Play* play, Gfx* dl) {
- //! FAKE
- if (1) {}
-
OPEN_DISPS(play->state.gfxCtx);
_texture_z_light_fog_prim(play->state.gfxCtx);
@@ -609,9 +606,6 @@ void Cheap_gfx_display(Game_Play* play, Gfx* dl) {
}
void Cheap_gfx_display_xlu(Game_Play* play, Gfx* dl) {
- //! FAKE
- if (1) {}
-
OPEN_DISPS(play->state.gfxCtx);
_texture_z_light_fog_prim_xlu(play->state.gfxCtx);
diff --git a/src/code/m_rcp.c b/src/code/m_rcp.c
index 23b3dcd..c626d58 100644
--- a/src/code/m_rcp.c
+++ b/src/code/m_rcp.c
@@ -458,8 +458,6 @@ Gfx* two_tex_scroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 widt
}
void DisplayList_initialize(GraphicsContext* gfxCtx, u8 clearR, u8 clearG, u8 clearB, Game_Play* game_play) {
- void* unk_008;
-
OPEN_DISPS(gfxCtx);
gSPDisplayList(POLY_OPA_DISP++, RSP_RDP_clear_data);
@@ -483,14 +481,16 @@ void DisplayList_initialize(GraphicsContext* gfxCtx, u8 clearR, u8 clearG, u8 cl
gDPSetColorImage(SHADOW_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, gfxCtx->unk_2E4);
gDPSetColorImage(LIGHT_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, gfxCtx->unk_2E4);
- unk_008 = gfxCtx->unk_008;
-
- gDPSetDepthImage(POLY_OPA_DISP++, unk_008);
- gDPSetDepthImage(POLY_XLU_DISP++, unk_008);
- gDPSetDepthImage(OVERLAY_DISP++, unk_008);
- gDPSetDepthImage(UNK_2B0_DISP++, unk_008);
- gDPSetDepthImage(SHADOW_DISP++, unk_008);
- gDPSetDepthImage(LIGHT_DISP++, unk_008);
+ {
+ void* unk_008 = gfxCtx->unk_008;
+
+ gDPSetDepthImage(POLY_OPA_DISP++, unk_008);
+ gDPSetDepthImage(POLY_XLU_DISP++, unk_008);
+ gDPSetDepthImage(OVERLAY_DISP++, unk_008);
+ gDPSetDepthImage(UNK_2B0_DISP++, unk_008);
+ gDPSetDepthImage(SHADOW_DISP++, unk_008);
+ gDPSetDepthImage(LIGHT_DISP++, unk_008);
+ }
if ((game_play == NULL) || ((game_play->submenu.unk_00 < 2) && (fbdemo_mode < 2))) {
gDPSetColorImage(POLY_OPA_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, gfxCtx->unk_008);
@@ -508,9 +508,6 @@ void DisplayList_initialize(GraphicsContext* gfxCtx, u8 clearR, u8 clearG, u8 cl
gDPPipeSync(POLY_OPA_DISP++);
}
- //! FAKE:
- if (gfxCtx && gfxCtx && gfxCtx) {}
-
CLOSE_DISPS(gfxCtx);
func_80091074_jp(gfxCtx);