From 24ac81951ea9b40a431b07a3c6395beab636cd97 Mon Sep 17 00:00:00 2001 From: quarrel07 <178681861+quarrel07@users.noreply.github.com> Date: Sun, 26 Jul 2026 21:29:12 -0700 Subject: Sky: paint the full window width (#717) The gradient quad's projection path does not preserve the outward rounding of the Rect edge getters, which can leave the last window column unpainted at some aspect ratios (visible as a black strip at the screen edge that only sky sprites drew into). Overshoot the quad a few virtual pixels past both edges; the excess clips at the window. Co-authored-by: MegaMech --- src/engine/sky/Sky.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/engine/sky/Sky.cpp b/src/engine/sky/Sky.cpp index 5e1afc1a7..d9a9a1112 100644 --- a/src/engine/sky/Sky.cpp +++ b/src/engine/sky/Sky.cpp @@ -184,15 +184,18 @@ void Sky::Draw(ScreenContext* screen) { // func_802A4A0C(Vtx* vtx, ScreenContext this->SetColours(vtx); //func_802A450C(vtx); // Widescreen skybox // Note that this is the correct fit for each screen due to how the viewport works - vtx[0].v.ob[0] = OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH); - vtx[1].v.ob[0] = OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH); - vtx[2].v.ob[0] = OTRGetRectDimensionFromLeftEdge(0); - vtx[3].v.ob[0] = OTRGetRectDimensionFromLeftEdge(0); - - vtx[4].v.ob[0] = OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH); - vtx[5].v.ob[0] = OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH); - vtx[6].v.ob[0] = OTRGetRectDimensionFromLeftEdge(0); - vtx[7].v.ob[0] = OTRGetRectDimensionFromLeftEdge(0); + // +/-8: overshoot the gradient past both edges; this quad's projection + // path does not preserve the Rect getters' outward rounding, which left + // the last window column unpainted at some aspect ratios. + vtx[0].v.ob[0] = OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH) + 8; + vtx[1].v.ob[0] = OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH) + 8; + vtx[2].v.ob[0] = OTRGetRectDimensionFromLeftEdge(0) - 8; + vtx[3].v.ob[0] = OTRGetRectDimensionFromLeftEdge(0) - 8; + + vtx[4].v.ob[0] = OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH) + 8; + vtx[5].v.ob[0] = OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH) + 8; + vtx[6].v.ob[0] = OTRGetRectDimensionFromLeftEdge(0) - 8; + vtx[7].v.ob[0] = OTRGetRectDimensionFromLeftEdge(0) - 8; sp5C[0] = 0.0f; sp5C[1] = 0.0f; -- cgit v1.2.3