From e0d59345c7378949933f13d8110639519952e5f4 Mon Sep 17 00:00:00 2001 From: Matthew Coppola Date: Thu, 24 Oct 2024 01:16:11 -0400 Subject: [PATCH] Center-align crosshairs and zoom range --- port/fast3d/gfx_pc.cpp | 47 +++++++++++++++--- src/game/bondview.c | 16 +++--- src/game/sight.c | 108 ++++++++++++++++++++++------------------- src/include/gbiex.h | 38 ++++++++++----- 4 files changed, 133 insertions(+), 76 deletions(-) diff --git a/port/fast3d/gfx_pc.cpp b/port/fast3d/gfx_pc.cpp index 571e03f05..43713c67d 100644 --- a/port/fast3d/gfx_pc.cpp +++ b/port/fast3d/gfx_pc.cpp @@ -1573,7 +1573,7 @@ static inline void gfx_sp_tri4(Gfx *cmd) { uint8_t x = C1(0, 4); uint8_t y = C1(4, 4); uint8_t z = C0(0, 4); - + if(x || y || z) { gfx_sp_tri1(x, y, z, false); } @@ -2148,10 +2148,10 @@ static void gfx_dp_image_rectangle(int32_t tile, int32_t w, int32_t h, rdp.combine_mode = saved_combine_mode; } -static void gfx_dp_fill_rectangle(int32_t ulx, int32_t uly, int32_t lrx, int32_t lry) { +static int gfx_dp_fill_rectangle_common(int32_t ulx, int32_t uly, int32_t lrx, int32_t lry, uint64_t *saved_combine_mode) { if (rdp.color_image_address == rdp.z_buf_address) { // Don't clear Z buffer here since we already did it with glClear - return; + return 1; } uint32_t mode = (rdp.other_mode_h & (3U << G_MDSFT_CYCLETYPE)); @@ -2174,14 +2174,39 @@ static void gfx_dp_fill_rectangle(int32_t ulx, int32_t uly, int32_t lrx, int32_t v->color = rdp.fill_color; } - uint64_t saved_combine_mode = rdp.combine_mode; + *saved_combine_mode = rdp.combine_mode; if (mode == G_CYC_FILL) { gfx_dp_set_combine_mode(color_comb(0, 0, 0, G_CCMUX_SHADE), alpha_comb(0, 0, 0, G_ACMUX_SHADE), 0, 0); } - gfx_draw_rectangle(ulx, uly, lrx, lry); - rdp.combine_mode = saved_combine_mode; + return 0; +} + +static void gfx_dp_fill_rectangle(int32_t ulx, int32_t uly, int32_t lrx, int32_t lry) { + uint64_t saved_combine_mode; + if (gfx_dp_fill_rectangle_common(ulx, uly, lrx, lry, &saved_combine_mode) == 0) { + gfx_draw_rectangle(ulx, uly, lrx, lry); + rdp.combine_mode = saved_combine_mode; + } +} + +static void gfx_dp_fill_rectangle_centered(int32_t ulx, int32_t uly, int32_t lrx, int32_t lry) { + uint64_t saved_combine_mode; + if (gfx_dp_fill_rectangle_common(ulx, uly, lrx, lry, &saved_combine_mode) == 0) { + // The coordinates of the rect are usually quantized to the default N64 + // resolution (320x220), but adding the rect to the graphics display + // list scales it by four. So, a single pixel at 320x220 becomes four + // pixels at 1280x880. Since the crosshair was misaligned by half a + // native pixel, we need to shift the crosshair by two scaled pixels. + ulx -= 2; + lrx -= 2; + uly -= 2; + lry -= 2; + + gfx_draw_rectangle(ulx, uly, lrx, lry); + rdp.combine_mode = saved_combine_mode; + } } static void gfx_dp_set_z_image(void* z_buf_address) { @@ -2392,6 +2417,16 @@ static void gfx_run_dl(Gfx* cmd) { gfx_dp_fill_rectangle(ulx, uly, lrx, lry); break; } + case G_FILLRECT_CENTERED_WIDE_EXT: { + int32_t lrx, lry, ulx, uly; + lrx = (int32_t)(C0(0, 24) << 8) >> 8; + lry = (int32_t)(C1(0, 24) << 8) >> 8; + ++cmd; + ulx = (int32_t)(C0(0, 24) << 8) >> 8; + uly = (int32_t)(C1(0, 24) << 8) >> 8; + gfx_dp_fill_rectangle_centered(ulx, uly, lrx, lry); + break; + } case G_TEXRECT_WIDE_EXT: { int32_t lrx, lry, tile, ulx, uly; uint32_t uls, ult, dsdx, dtdy; diff --git a/src/game/bondview.c b/src/game/bondview.c index af101fa37..935476d6c 100644 --- a/src/game/bondview.c +++ b/src/game/bondview.c @@ -1109,14 +1109,14 @@ Gfx *bviewDrawEyespyMetrics(Gfx *gdl) s32 x = viewleft + (viewwidth >> 1); s32 y = viewtop + (viewheight >> 1); - gDPFillRectangle(gdl++, x + 2, y + 0, x + 7, y + 1); - gDPFillRectangle(gdl++, x + 2, y + 0, x + 5, y + 1); - gDPFillRectangle(gdl++, x - 6, y + 0, x - 1, y + 1); - gDPFillRectangle(gdl++, x - 4, y + 0, x - 1, y + 1); - gDPFillRectangle(gdl++, x + 0, y + 2, x + 1, y + 7); - gDPFillRectangle(gdl++, x + 0, y + 2, x + 1, y + 5); - gDPFillRectangle(gdl++, x + 0, y - 6, x + 1, y - 1); - gDPFillRectangle(gdl++, x + 0, y - 4, x + 1, y - 1); + gDPFillRectangleCenteredEXT(gdl++, x + 2, y + 0, x + 7, y + 1); + gDPFillRectangleCenteredEXT(gdl++, x + 2, y + 0, x + 5, y + 1); + gDPFillRectangleCenteredEXT(gdl++, x - 6, y + 0, x - 1, y + 1); + gDPFillRectangleCenteredEXT(gdl++, x - 4, y + 0, x - 1, y + 1); + gDPFillRectangleCenteredEXT(gdl++, x + 0, y + 2, x + 1, y + 7); + gDPFillRectangleCenteredEXT(gdl++, x + 0, y + 2, x + 1, y + 5); + gDPFillRectangleCenteredEXT(gdl++, x + 0, y - 6, x + 1, y - 1); + gDPFillRectangleCenteredEXT(gdl++, x + 0, y - 4, x + 1, y - 1); } if (g_Vars.currentplayer->eyespy->mode == EYESPYMODE_CAMSPY) { diff --git a/src/game/sight.c b/src/game/sight.c index 78359c4ef..a3bdd642f 100644 --- a/src/game/sight.c +++ b/src/game/sight.c @@ -519,35 +519,35 @@ Gfx *sightDrawAimer(Gfx *gdl, s32 x, s32 y, s32 radius, s32 cornergap, u32 colou // Draw the lines that span most of the viewport if (PLAYERCOUNT() == 1) { - gDPHudRectangle(gdl++, viewleft + 48, y, x - radius + 2, y); - gDPHudRectangle(gdl++, x + radius - 2, y, viewright - 49, y); - gDPHudRectangle(gdl++, x, viewtop + 10, x, y - radius + 2); - gDPHudRectangle(gdl++, x, y + radius - 2, x, viewbottom - 10); + gDPHudRectangleCentered(gdl++, viewleft + 48, y, x - radius + 2, y); + gDPHudRectangleCentered(gdl++, x + radius - 2, y, viewright - 49, y); + gDPHudRectangleCentered(gdl++, x, viewtop + 10, x, y - radius + 2); + gDPHudRectangleCentered(gdl++, x, y + radius - 2, x, viewbottom - 10); } else { - gDPHudRectangle(gdl++, viewleft, y, x - radius + 2, y); - gDPHudRectangle(gdl++, x + radius - 2, y, viewright, y); - gDPHudRectangle(gdl++, x, viewtop, x, y - radius + 2); - gDPHudRectangle(gdl++, x, y + radius - 2, x, viewbottom); + gDPHudRectangleCentered(gdl++, viewleft, y, x - radius + 2, y); + gDPHudRectangleCentered(gdl++, x + radius - 2, y, viewright, y); + gDPHudRectangleCentered(gdl++, x, viewtop, x, y - radius + 2); + gDPHudRectangleCentered(gdl++, x, y + radius - 2, x, viewbottom); } gdl = text0f153838(gdl); gdl = textSetPrimColour(gdl, colour); // Draw the box - gDPHudRectangle(gdl++, x - radius, y - radius, x - radius, y + radius); - gDPHudRectangle(gdl++, x + radius, y - radius, x + radius, y + radius); - gDPHudRectangle(gdl++, x - radius, y - radius, x + radius, y - radius); - gDPHudRectangle(gdl++, x - radius, y + radius, x + radius, y + radius); + gDPHudRectangleCentered(gdl++, x - radius, y - radius, x - radius, y + radius); + gDPHudRectangleCentered(gdl++, x + radius, y - radius, x + radius, y + radius); + gDPHudRectangleCentered(gdl++, x - radius, y - radius, x + radius, y - radius); + gDPHudRectangleCentered(gdl++, x - radius, y + radius, x + radius, y + radius); // Go over the corners a second time - gDPHudRectangle(gdl++, x - radius, y - radius, x - radius, y - cornergap); - gDPHudRectangle(gdl++, x - radius, y + cornergap, x - radius, y + radius); - gDPHudRectangle(gdl++, x + radius, y - radius, x + radius, y - cornergap); - gDPHudRectangle(gdl++, x + radius, y + cornergap, x + radius, y + radius); - gDPHudRectangle(gdl++, x - radius, y - radius, x - cornergap, y - radius); - gDPHudRectangle(gdl++, x + cornergap, y - radius, x + radius, y - radius); - gDPHudRectangle(gdl++, x - radius, y + radius, x - cornergap, y + radius); - gDPHudRectangle(gdl++, x + cornergap, y + radius, x + radius, y + radius); + gDPHudRectangleCentered(gdl++, x - radius, y - radius, x - radius, y - cornergap); + gDPHudRectangleCentered(gdl++, x - radius, y + cornergap, x - radius, y + radius); + gDPHudRectangleCentered(gdl++, x + radius, y - radius, x + radius, y - cornergap); + gDPHudRectangleCentered(gdl++, x + radius, y + cornergap, x + radius, y + radius); + gDPHudRectangleCentered(gdl++, x - radius, y - radius, x - cornergap, y - radius); + gDPHudRectangleCentered(gdl++, x + cornergap, y - radius, x + radius, y - radius); + gDPHudRectangleCentered(gdl++, x - radius, y + radius, x - cornergap, y + radius); + gDPHudRectangleCentered(gdl++, x + cornergap, y + radius, x + radius, y + radius); #ifndef PLATFORM_N64 gSPClearExtraGeometryModeEXT(gdl++, G_ASPECT_CENTER_EXT); @@ -908,7 +908,7 @@ Gfx *sightDrawClassic(Gfx *gdl, bool sighton) f32 spc4[2]; f32 spbc[2]; s32 x = g_Vars.currentplayer->crosspos[0]; - s32 y = g_Vars.currentplayer->crosspos[1]; + s32 y = g_Vars.currentplayer->crosspos[1] + 1; // Plus one, to align with the laser sight. s32 x1; s32 x2; s32 y1; @@ -1331,6 +1331,14 @@ Gfx *sightDrawZoom(Gfx *gdl, bool sighton) marginbottom = viewhalfheight - availablebelow * frac; margintop = viewhalfheight - availableabove * frac; + // Center-align the zoom range. + if (frac != 1.0f) { + viewleft += 1; + viewright += 1; + viewbottom += 1; + viewtop += 1; + } + #define BOXLEFT (viewleft + marginleft) #define BOXRIGHT (viewright - marginright) #define BOXBOTTOM (viewbottom - marginbottom) @@ -1349,40 +1357,40 @@ Gfx *sightDrawZoom(Gfx *gdl, bool sighton) #endif // Top left - gDPHudRectangle(gdl++, BOXLEFT + 1, BOXTOP, BOXLEFT + cornerwidth - 1, BOXTOP); - gDPHudRectangle(gdl++, BOXLEFT, BOXTOP, BOXLEFT, BOXTOP + cornerheight - 1); + gDPHudRectangleCentered(gdl++, BOXLEFT + 1, BOXTOP, BOXLEFT + cornerwidth - 1, BOXTOP); + gDPHudRectangleCentered(gdl++, BOXLEFT, BOXTOP, BOXLEFT, BOXTOP + cornerheight - 1); // Top right - gDPHudRectangle(gdl++, BOXRIGHT - cornerwidth + 2, BOXTOP, BOXRIGHT - 1, BOXTOP); - gDPHudRectangle(gdl++, BOXRIGHT, BOXTOP, BOXRIGHT, BOXTOP + cornerheight - 1); + gDPHudRectangleCentered(gdl++, BOXRIGHT - cornerwidth + 2, BOXTOP, BOXRIGHT - 1, BOXTOP); + gDPHudRectangleCentered(gdl++, BOXRIGHT, BOXTOP, BOXRIGHT, BOXTOP + cornerheight - 1); // Bottom left - gDPHudRectangle(gdl++, BOXLEFT + 1, BOXBOTTOM, BOXLEFT + cornerwidth - 1, BOXBOTTOM); - gDPHudRectangle(gdl++, BOXLEFT, BOXBOTTOM - cornerheight + 1, BOXLEFT, BOXBOTTOM); + gDPHudRectangleCentered(gdl++, BOXLEFT + 1, BOXBOTTOM, BOXLEFT + cornerwidth - 1, BOXBOTTOM); + gDPHudRectangleCentered(gdl++, BOXLEFT, BOXBOTTOM - cornerheight + 1, BOXLEFT, BOXBOTTOM); // Bottom right - gDPHudRectangle(gdl++, BOXRIGHT - cornerwidth + 2, BOXBOTTOM, BOXRIGHT - 1, BOXBOTTOM); - gDPHudRectangle(gdl++, BOXRIGHT, BOXBOTTOM - cornerheight + 1, BOXRIGHT, BOXBOTTOM); + gDPHudRectangleCentered(gdl++, BOXRIGHT - cornerwidth + 2, BOXBOTTOM, BOXRIGHT - 1, BOXBOTTOM); + gDPHudRectangleCentered(gdl++, BOXRIGHT, BOXBOTTOM - cornerheight + 1, BOXRIGHT, BOXBOTTOM); // Draw over the corners again, but only half as wide/high cornerwidth >>= 1; cornerheight >>= 1; // Top left - gDPHudRectangle(gdl++, BOXLEFT, BOXTOP, BOXLEFT + cornerwidth, BOXTOP); - gDPHudRectangle(gdl++, BOXLEFT, BOXTOP, BOXLEFT, BOXTOP + cornerheight); + gDPHudRectangleCentered(gdl++, BOXLEFT, BOXTOP, BOXLEFT + cornerwidth, BOXTOP); + gDPHudRectangleCentered(gdl++, BOXLEFT, BOXTOP, BOXLEFT, BOXTOP + cornerheight); // Top right - gDPHudRectangle(gdl++, BOXRIGHT - cornerwidth, BOXTOP, BOXRIGHT, BOXTOP); - gDPHudRectangle(gdl++, BOXRIGHT, BOXTOP, BOXRIGHT, BOXTOP + cornerheight); + gDPHudRectangleCentered(gdl++, BOXRIGHT - cornerwidth, BOXTOP, BOXRIGHT, BOXTOP); + gDPHudRectangleCentered(gdl++, BOXRIGHT, BOXTOP, BOXRIGHT, BOXTOP + cornerheight); // Bottom left - gDPHudRectangle(gdl++, BOXLEFT, BOXBOTTOM, BOXLEFT + cornerwidth, BOXBOTTOM); - gDPHudRectangle(gdl++, BOXLEFT, BOXBOTTOM - cornerheight, BOXLEFT, BOXBOTTOM); + gDPHudRectangleCentered(gdl++, BOXLEFT, BOXBOTTOM, BOXLEFT + cornerwidth, BOXBOTTOM); + gDPHudRectangleCentered(gdl++, BOXLEFT, BOXBOTTOM - cornerheight, BOXLEFT, BOXBOTTOM); // Bottom right - gDPHudRectangle(gdl++, BOXRIGHT - cornerwidth, BOXBOTTOM, BOXRIGHT, BOXBOTTOM); - gDPHudRectangle(gdl++, BOXRIGHT, BOXBOTTOM - cornerheight, BOXRIGHT, BOXBOTTOM); + gDPHudRectangleCentered(gdl++, BOXRIGHT - cornerwidth, BOXBOTTOM, BOXRIGHT, BOXBOTTOM); + gDPHudRectangleCentered(gdl++, BOXRIGHT, BOXBOTTOM - cornerheight, BOXRIGHT, BOXBOTTOM); #ifndef PLATFORM_N64 @@ -1490,10 +1498,10 @@ Gfx *sightDrawMaian(Gfx *gdl, bool sighton) gdl = textSetPrimColour(gdl, SIGHT_COLOUR); // Draw border over inner points - gDPHudRectangle(gdl++, x - 4, y - 4, x - 4, y + 4); // left - gDPHudRectangle(gdl++, x + 4, y - 4, x + 4, y + 4); // right - gDPHudRectangle(gdl++, x - 4, y - 4, x + 4, y - 4); // top - gDPHudRectangle(gdl++, x - 4, y + 4, x + 4, y + 4); // bottom + gDPHudRectangleCentered(gdl++, x - 4, y - 4, x - 4, y + 4); // left + gDPHudRectangleCentered(gdl++, x + 4, y - 4, x + 4, y + 4); // right + gDPHudRectangleCentered(gdl++, x - 4, y - 4, x + 4, y - 4); // top + gDPHudRectangleCentered(gdl++, x - 4, y + 4, x + 4, y + 4); // bottom gdl = text0f153838(gdl); @@ -1521,18 +1529,18 @@ Gfx *sightDrawTarget(Gfx *gdl) gSPSetExtraGeometryModeEXT(gdl++, G_ASPECT_CENTER_EXT); if (SIGHT_SCALE == 0) { // Draw single rectangle to preserve intended opacity - gDPHudRectangle(gdl++, x, y, x, y); + gDPHudRectangleCentered(gdl++, x, y, x, y); } else #endif { - gDPHudRectangle(gdl++, x + 1 * SIGHT_SCALE, y + 0 * SIGHT_SCALE, x + 3 * SIGHT_SCALE, y + 0 * SIGHT_SCALE); - gDPHudRectangle(gdl++, x + 1 * SIGHT_SCALE, y + 0 * SIGHT_SCALE, x + 2 * SIGHT_SCALE, y + 0 * SIGHT_SCALE); - gDPHudRectangle(gdl++, x - 3 * SIGHT_SCALE, y + 0 * SIGHT_SCALE, x - 1 * SIGHT_SCALE, y + 0 * SIGHT_SCALE); - gDPHudRectangle(gdl++, x - 2 * SIGHT_SCALE, y + 0 * SIGHT_SCALE, x - 1 * SIGHT_SCALE, y + 0 * SIGHT_SCALE); - gDPHudRectangle(gdl++, x + 0 * SIGHT_SCALE, y + 1 * SIGHT_SCALE, x + 0 * SIGHT_SCALE, y + 3 * SIGHT_SCALE); - gDPHudRectangle(gdl++, x + 0 * SIGHT_SCALE, y + 1 * SIGHT_SCALE, x + 0 * SIGHT_SCALE, y + 2 * SIGHT_SCALE); - gDPHudRectangle(gdl++, x + 0 * SIGHT_SCALE, y - 3 * SIGHT_SCALE, x + 0 * SIGHT_SCALE, y - 1 * SIGHT_SCALE); - gDPHudRectangle(gdl++, x + 0 * SIGHT_SCALE, y - 2 * SIGHT_SCALE, x + 0 * SIGHT_SCALE, y - 1 * SIGHT_SCALE); + gDPHudRectangleCentered(gdl++, x + 1 * SIGHT_SCALE, y + 0 * SIGHT_SCALE, x + 3 * SIGHT_SCALE, y + 0 * SIGHT_SCALE); + gDPHudRectangleCentered(gdl++, x + 1 * SIGHT_SCALE, y + 0 * SIGHT_SCALE, x + 2 * SIGHT_SCALE, y + 0 * SIGHT_SCALE); + gDPHudRectangleCentered(gdl++, x - 3 * SIGHT_SCALE, y + 0 * SIGHT_SCALE, x - 1 * SIGHT_SCALE, y + 0 * SIGHT_SCALE); + gDPHudRectangleCentered(gdl++, x - 2 * SIGHT_SCALE, y + 0 * SIGHT_SCALE, x - 1 * SIGHT_SCALE, y + 0 * SIGHT_SCALE); + gDPHudRectangleCentered(gdl++, x + 0 * SIGHT_SCALE, y + 1 * SIGHT_SCALE, x + 0 * SIGHT_SCALE, y + 3 * SIGHT_SCALE); + gDPHudRectangleCentered(gdl++, x + 0 * SIGHT_SCALE, y + 1 * SIGHT_SCALE, x + 0 * SIGHT_SCALE, y + 2 * SIGHT_SCALE); + gDPHudRectangleCentered(gdl++, x + 0 * SIGHT_SCALE, y - 3 * SIGHT_SCALE, x + 0 * SIGHT_SCALE, y - 1 * SIGHT_SCALE); + gDPHudRectangleCentered(gdl++, x + 0 * SIGHT_SCALE, y - 2 * SIGHT_SCALE, x + 0 * SIGHT_SCALE, y - 1 * SIGHT_SCALE); } #ifndef PLATFORM_N64 diff --git a/src/include/gbiex.h b/src/include/gbiex.h index 8cc1d50c6..c16107b87 100644 --- a/src/include/gbiex.h +++ b/src/include/gbiex.h @@ -184,18 +184,19 @@ /* Extended commands */ -#define G_SETFB_EXT 0x21 -#define G_SETTIMG_FB_EXT 0x23 -#define G_INVALTEXCACHE_EXT 0x34 -#define G_TEXRECT_WIDE_EXT 0x37 -#define G_FILLRECT_WIDE_EXT 0x38 -#define G_SETGRAYSCALE_EXT 0x39 -#define G_EXTRAGEOMETRYMODE_EXT 0x3a -#define G_SETINTENSITY_EXT 0x40 -#define G_COPYFB_EXT 0x41 -#define G_IMAGERECT_EXT 0x42 -#define G_RDPFLUSH_EXT 0x43 -#define G_CLEAR_DEPTH_EXT 0x44 +#define G_SETFB_EXT 0x21 +#define G_SETTIMG_FB_EXT 0x23 +#define G_INVALTEXCACHE_EXT 0x34 +#define G_TEXRECT_WIDE_EXT 0x37 +#define G_FILLRECT_WIDE_EXT 0x38 +#define G_SETGRAYSCALE_EXT 0x39 +#define G_EXTRAGEOMETRYMODE_EXT 0x3a +#define G_SETINTENSITY_EXT 0x40 +#define G_COPYFB_EXT 0x41 +#define G_IMAGERECT_EXT 0x42 +#define G_RDPFLUSH_EXT 0x43 +#define G_CLEAR_DEPTH_EXT 0x44 +#define G_FILLRECT_CENTERED_WIDE_EXT 0x45 /* G_EXTRAGEOMETRYMODE flags */ @@ -260,6 +261,16 @@ _g1->words.w1 = _SHIFTL((uly), 2, 22); \ } +#define gDPFillRectangleCenteredWideEXT(pkt, ulx, uly, lrx, lry) \ +{ \ + Gfx *_g0 = (Gfx*)(pkt), *_g1 = (Gfx*)(pkt); \ + \ + _g0->words.w0 = _SHIFTL(G_FILLRECT_CENTERED_WIDE_EXT, 24, 8) | _SHIFTL((lrx), 2, 22); \ + _g0->words.w1 = _SHIFTL((lry), 2, 22); \ + _g1->words.w0 = _SHIFTL((ulx), 2, 22); \ + _g1->words.w1 = _SHIFTL((uly), 2, 22); \ +} + #define gSPTextureRectangleWideEXT(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy, flip) \ { \ Gfx *_g0 = (Gfx*)(pkt), *_g1 = (Gfx*)(pkt), *_g2 = (Gfx*)(pkt); \ @@ -296,6 +307,7 @@ #define gSPClearExtraGeometryModeEXT(pkt, word) gSPExtraGeometryModeEXT((pkt), word, 0) #define gDPFillRectangleEXT gDPFillRectangleWideEXT +#define gDPFillRectangleCenteredEXT gDPFillRectangleCenteredWideEXT #define gSPTextureRectangleEXT(p, xl, yl, xh, yh, tile, s, t, ds, dt) gSPTextureRectangleWideEXT(p, xl, yl, xh, yh, tile, s, t, ds, dt, G_OFF) #define gSPTextureRectangleFlipEXT(p, xl, yl, xh, yh, tile, s, t, ds, dt) gSPTextureRectangleWideEXT(p, xl, yl, xh, yh, tile, s, t, ds, dt, G_ON) @@ -308,10 +320,12 @@ #undef gDPHudRectangle #define gDPHudRectangle(pkt, x1, y1, x2, y2) gDPFillRectangleEXT(pkt, (x1) * g_ScaleX, y1, ((x2 + 1)) * g_ScaleX, (y2) + 1) +#define gDPHudRectangleCentered(pkt, x1, y1, x2, y2) gDPFillRectangleCenteredEXT(pkt, (x1) * g_ScaleX, y1, ((x2 + 1)) * g_ScaleX, (y2) + 1) #else // PLATFORM_N64 #define gDPFillRectangleEXT gDPFillRectangle +#define gDPFillRectangleCenteredEXT gDPFillRectangle #define gSPTextureRectangleEXT gSPTextureRectangle #endif // PLATFORM_N64