diff --git a/src/doom/r_plane.c b/src/doom/r_plane.c index 869c729411..dd3d7bd483 100644 --- a/src/doom/r_plane.c +++ b/src/doom/r_plane.c @@ -263,8 +263,15 @@ R_FindPlane // [crispy] add support for MBF sky tranfers if (picnum == skyflatnum || picnum & PL_SKYFLAT) { - height = 0; // all skys map together - lightlevel = 0; + lightlevel = 0; // killough 7/19/98: most skies map together + + // haleyjd 05/06/08: but not all. If height > viewpoint.z, set height to 1 + // instead of 0, to keep ceilings mapping with ceilings, and floors mapping + // with floors. + if (height > viewz) + height = 1; + else + height = 0; } for (check=visplanes; checksidenum + sides; texture = texturetranslation[s->toptexture]; dc_texturemid = s->rowoffset - 28*FRACUNIT; - // [crispy] stretch sky - if (crispy->stretchsky) - { - dc_texturemid = dc_texturemid * (textureheight[texture]>>FRACBITS) / SKYSTRETCH_HEIGHT; - } flip = (l->special == 272) ? 0u : ~0u; an += s->textureoffset; } @@ -478,11 +480,15 @@ void R_DrawPlanes (void) // by INVUL inverse mapping. // [crispy] no brightmaps for sky dc_colormap[0] = dc_colormap[1] = colormaps; -// dc_texturemid = skytexturemid; dc_texheight = textureheight[texture]>>FRACBITS; // [crispy] Tutti-Frutti fix - // [crispy] stretch sky - if (crispy->stretchsky) + + // [crispy] stretch short skies + if (crispy->stretchsky && dc_texheight < 200) + { dc_iscale = dc_iscale * dc_texheight / SKYSTRETCH_HEIGHT; + dc_texturemid = dc_texturemid * dc_texheight / SKYSTRETCH_HEIGHT; + } + for (x=pl->minx ; x <= pl->maxx ; x++) { dc_yl = pl->top[x]; diff --git a/src/doom/r_sky.c b/src/doom/r_sky.c index 3812a87a9c..0389afe3d4 100644 --- a/src/doom/r_sky.c +++ b/src/doom/r_sky.c @@ -46,16 +46,21 @@ int skytexturemid; // void R_InitSkyMap (void) { - // skyflatnum = R_FlatNumForName ( SKYFLATNAME ); - // [crispy] stretch sky + int skyheight; + + // [crispy] stretch short skies if (skytexture == -1) { return; } - if ((crispy->stretchsky = crispy->freelook || crispy->mouselook || crispy->pitch)) - { - skytexturemid = -28*FRACUNIT * (textureheight[skytexture] >> FRACBITS) / SKYSTRETCH_HEIGHT; - } + + crispy->stretchsky = crispy->freelook || crispy->mouselook || crispy->pitch; + skyheight = textureheight[skytexture] >> FRACBITS; + + if (crispy->stretchsky && skyheight < 200) + skytexturemid = -28*FRACUNIT; + else if (skyheight >= 200) + skytexturemid = 200*FRACUNIT; else skytexturemid = ORIGHEIGHT/2*FRACUNIT; }