Merge pull request #339 from Cuyler36:m_submenu_changes

Use OPEN/CLOSE_POLY_OPA_DISP macros in mSM_setup_view
This commit is contained in:
Cuyler36
2024-05-15 07:56:02 -04:00
committed by GitHub
+10 -11
View File
@@ -44,9 +44,7 @@
static Submenu_Overlay_c ovl_base; static Submenu_Overlay_c ovl_base;
static void mSM_setup_view(Submenu* submenu, GRAPH* graph, int init_flag) { static void mSM_setup_view(Submenu* submenu, GRAPH* graph, int init_flag) {
Gfx* gfx;
Mtx* mtx; Mtx* mtx;
View* view;
if (init_flag) { if (init_flag) {
mtx = GRAPH_ALLOC_TYPE(graph, Mtx, 1); mtx = GRAPH_ALLOC_TYPE(graph, Mtx, 1);
@@ -56,26 +54,27 @@ static void mSM_setup_view(Submenu* submenu, GRAPH* graph, int init_flag) {
mtx = submenu->overlay->projection_matrix; mtx = submenu->overlay->projection_matrix;
} }
OPEN_DISP(graph); OPEN_POLY_OPA_DISP(graph);
gfx = NOW_POLY_OPA_DISP;
if (init_flag == FALSE) { if (init_flag == FALSE) {
View* view;
if (submenu->mode != 4) { if (submenu->mode != 4) {
view = &((GAME_PLAY*)gamePT)->view; view = &((GAME_PLAY*)gamePT)->view;
} else { } else {
view = &((GAME_TRADEMARK*)gamePT)->view; // I'm not sure this is the correct game subclass view = &((GAME_TRADEMARK*)gamePT)->view; // I'm not sure this is the correct game subclass
} }
gDPPipeSync(gfx++); gDPPipeSync(POLY_OPA_DISP++);
gDPSetScissor(gfx++, G_SC_NON_INTERLACE, view->screen.l, view->screen.top, view->screen.r, view->screen.bottom); gDPSetScissor(POLY_OPA_DISP++, G_SC_NON_INTERLACE, view->screen.l, view->screen.top, view->screen.r,
gSPViewport(gfx++, &view->viewport); view->screen.bottom);
gDPSetScissor(gfx++, G_SC_NON_INTERLACE, 0, 0, 640, 480); gSPViewport(POLY_OPA_DISP++, &view->viewport);
gDPSetScissor(POLY_OPA_DISP++, G_SC_NON_INTERLACE, 0, 0, 640, 480);
} }
gSPMatrix(gfx++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
SET_POLY_OPA_DISP(gfx); CLOSE_POLY_OPA_DISP(graph);
CLOSE_DISP(graph);
} }
static void mSM_change_view(GRAPH* graph, f32 eye_dist, f32 y_lookAt, f32 vp_x, f32 vp_y, s16 angle, int width, static void mSM_change_view(GRAPH* graph, f32 eye_dist, f32 y_lookAt, f32 vp_x, f32 vp_y, s16 angle, int width,