mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-24 00:02:43 +02:00
Move subpixel offset code & fix radar UV map
The subpixel offset code has been moved into the draw_rectangle function, so it can be applied to more than just the fill_rectangle function. The radar texture was displaced along its V component and has been corrected. It has also been subpixel-adjusted to align with the player's radar dot.
This commit is contained in:
2 files changed
+8
-6
No files matched your search
@@ -1985,6 +1985,11 @@ static void gfx_draw_rectangle(int32_t ulx, int32_t uly, int32_t lrx, int32_t lr
|
||||
rdp.other_mode_h = (rdp.other_mode_h & ~(3U << G_MDSFT_TEXTFILT)) | G_TF_POINT;
|
||||
}
|
||||
|
||||
ulx += rdp.subpixel_ofs_x;
|
||||
lrx += rdp.subpixel_ofs_x;
|
||||
uly += rdp.subpixel_ofs_y;
|
||||
lry += rdp.subpixel_ofs_y;
|
||||
|
||||
// U10.2 coordinates
|
||||
float ulxf = ulx;
|
||||
float ulyf = uly;
|
||||
@@ -2188,11 +2193,6 @@ static void gfx_dp_fill_rectangle(int32_t ulx, int32_t uly, int32_t lrx, int32_t
|
||||
gfx_dp_set_combine_mode(color_comb(0, 0, 0, G_CCMUX_SHADE), alpha_comb(0, 0, 0, G_ACMUX_SHADE), 0, 0);
|
||||
}
|
||||
|
||||
ulx += rdp.subpixel_ofs_x;
|
||||
lrx += rdp.subpixel_ofs_x;
|
||||
uly += rdp.subpixel_ofs_y;
|
||||
lry += rdp.subpixel_ofs_y;
|
||||
|
||||
gfx_draw_rectangle(ulx, uly, lrx, lry);
|
||||
rdp.combine_mode = saved_combine_mode;
|
||||
}
|
||||
|
||||
+3
-1
@@ -80,7 +80,7 @@ Gfx *radarRenderBackground(Gfx *gdl, struct textureconfig *tconfig, s32 arg2, s3
|
||||
|
||||
texSelect(&gdl, tconfig, 2, 0, 0, 1, NULL);
|
||||
func0f0b278c(&gdl, spb0, spa8, tconfig->width, tconfig->height,
|
||||
0, 0, 1, 0, 0xff, 0, 40, tconfig->level > 0, 0);
|
||||
0, 0, 0, 0, 0xff, 0, 40, tconfig->level > 0, 0);
|
||||
|
||||
gDPPipeSync(gdl++);
|
||||
gDPSetColorDither(gdl++, G_CD_BAYER);
|
||||
@@ -329,6 +329,7 @@ Gfx *radarRender(Gfx *gdl)
|
||||
}
|
||||
#ifndef PLATFORM_N64
|
||||
gSPExtraGeometryModeEXT(gdl++, G_ASPECT_MODE_EXT, g_HudAlignModeR);
|
||||
gDPSetSubpixelOffsetEXT(gdl++, -2, 2);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -337,6 +338,7 @@ Gfx *radarRender(Gfx *gdl)
|
||||
|
||||
// Draw dots for human players
|
||||
#ifndef PLATFORM_N64
|
||||
gDPSetSubpixelOffsetEXT(gdl++, 0, 0);
|
||||
if (!(g_MpSetup.options & MPOPTION_NOPLAYERONRADAR)) {
|
||||
#endif
|
||||
for (i = 0; i < playercount; i++) {
|
||||
|
||||
Reference in new issue
Block a user