diff options
| author | quarrel07 <178681861+quarrel07@users.noreply.github.com> | 2026-07-26 21:29:12 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-26 22:29:12 -0600 |
| commit | 24ac81951ea9b40a431b07a3c6395beab636cd97 (patch) | |
| tree | 8a4f6bf92ad1574e98219862114462bee6f9b272 | |
| parent | 9ffdb8342375c5642bed38d30cae4a209df70fe5 (diff) | |
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>
| -rw-r--r-- | src/engine/sky/Sky.cpp | 21 |
1 files 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; |
