From 6161702703b681d6625b5fe05d99628c4d7d2eae Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 15 Nov 2009 08:11:14 +0000 Subject: [PATCH] - fixed: The sky baseline position needs to take texture scaling into account. SVN r1982 (trunk) --- docs/rh-log.txt | 3 +++ src/r_plane.cpp | 2 +- src/r_sky.cpp | 1 + src/textures/texture.cpp | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 4e778bb49..11928da78 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,6 @@ +November 15, 2009 (Changes by Graf Zahl) +- fixed: The sky baseline position needs to take texture scaling into account. + November 14, 2009 - Do not squash skies taller than 200 into square pixels. diff --git a/src/r_plane.cpp b/src/r_plane.cpp index 54f68799f..7fb98e4fc 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -1313,7 +1313,7 @@ void R_DrawSkyPlane (visplane_t *pl) } frontskytex = TexMan(s->GetTexture(pos)); - if (frontskytex->UseType == FTexture::TEX_Null) + if (frontskytex == NULL || frontskytex->UseType == FTexture::TEX_Null) { // [RH] The blank texture: Use normal sky instead. goto sky1; } diff --git a/src/r_sky.cpp b/src/r_sky.cpp index e10a43f91..544c1ded9 100644 --- a/src/r_sky.cpp +++ b/src/r_sky.cpp @@ -110,6 +110,7 @@ void R_InitSkyMap () { skytexturemid = (200 - skyheight) << FRACBITS; } + skytexturemid = FixedMul(skytexturemid, skytex1->yScale); if (viewwidth != 0 && viewheight != 0) { diff --git a/src/textures/texture.cpp b/src/textures/texture.cpp index 690a59421..88acefb47 100644 --- a/src/textures/texture.cpp +++ b/src/textures/texture.cpp @@ -144,7 +144,7 @@ FTexture::FTexture (const char *name, int lumpnum) WidthBits(0), HeightBits(0), xScale(FRACUNIT), yScale(FRACUNIT), SourceLump(lumpnum), UseType(TEX_Any), bNoDecals(false), bNoRemap0(false), bWorldPanning(false), bMasked(true), bAlphaTexture(false), bHasCanvas(false), bWarped(0), bComplex(false), - Rotations(0xFFFF), Width(0), Height(0), WidthMask(0), Native(NULL) + Rotations(0xFFFF), SkyOffset(0), Width(0), Height(0), WidthMask(0), Native(NULL) { id.SetInvalid(); if (name != NULL)