summaryrefslogtreecommitdiff
path: root/src/engine/sky/Sky.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/sky/Sky.cpp')
-rw-r--r--src/engine/sky/Sky.cpp21
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;