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 <MegaMech@users.noreply.github.com>
This commit is contained in:
quarrel07
2026-07-26 21:29:12 -07:00
committed by GitHub
parent 9ffdb83423
commit 24ac81951e
+11 -8
View File
@@ -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);
// +/-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);
vtx[5].v.ob[0] = OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH);
vtx[6].v.ob[0] = OTRGetRectDimensionFromLeftEdge(0);
vtx[7].v.ob[0] = OTRGetRectDimensionFromLeftEdge(0);
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;