From fad3a54100fb216f512b4aeef06468afedd91f14 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 15 Mar 2015 12:10:22 +0100 Subject: [PATCH] - fixed positioning for sky textures that are less than 128 pixels tall. --- src/gl/scene/gl_skydome.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gl/scene/gl_skydome.cpp b/src/gl/scene/gl_skydome.cpp index e6f9efd38..59b0f634d 100644 --- a/src/gl/scene/gl_skydome.cpp +++ b/src/gl/scene/gl_skydome.cpp @@ -278,7 +278,14 @@ void RenderDome(FMaterial * tex, float x_offset, float y_offset, bool mirror, in float xscale = 1024.f / float(texw); float yscale = 1.f; - if (texh < 200) + if (texh < 128) + { + // smaller sky textures must be tiled. We restrict it to 128 sky pixels, though + gl_RenderState.mModelMatrix.translate(0.f, -1250.f, 0.f); + gl_RenderState.mModelMatrix.scale(1.f, 128/230.f, 1.f); + yscale = 128 / texh; // intentionally left as integer. + } + else if (texh < 200) { gl_RenderState.mModelMatrix.translate(0.f, -1250.f, 0.f); gl_RenderState.mModelMatrix.scale(1.f, texh/230.f, 1.f);