diff --git a/src/g_level.h b/src/g_level.h index 6274c22b03..1fadcee3a7 100644 --- a/src/g_level.h +++ b/src/g_level.h @@ -148,7 +148,7 @@ enum ELevelFlags : unsigned int LEVEL_MONSTERSTELEFRAG = 0x00000400, LEVEL_ACTOWNSPECIAL = 0x00000800, LEVEL_SNDSEQTOTALCTRL = 0x00001000, - LEVEL_FORCENOSKYSTRETCH = 0x00002000, + LEVEL_FORCETILEDSKY = 0x00002000, LEVEL_CROUCH_NO = 0x00004000, LEVEL_JUMP_NO = 0x00008000, diff --git a/src/g_mapinfo.cpp b/src/g_mapinfo.cpp index 3fab0bd0d6..bb641b23bb 100644 --- a/src/g_mapinfo.cpp +++ b/src/g_mapinfo.cpp @@ -1228,8 +1228,8 @@ MapFlagHandlers[] = { "smoothlighting", MITYPE_SETFLAG2, LEVEL2_SMOOTHLIGHTING, 0 }, { "noautosequences", MITYPE_SETFLAG, LEVEL_SNDSEQTOTALCTRL, 0 }, { "autosequences", MITYPE_CLRFLAG, LEVEL_SNDSEQTOTALCTRL, 0 }, - { "forcenoskystretch", MITYPE_SETFLAG, LEVEL_FORCENOSKYSTRETCH, 0 }, - { "skystretch", MITYPE_CLRFLAG, LEVEL_FORCENOSKYSTRETCH, 0 }, + { "forcenoskystretch", MITYPE_SETFLAG, LEVEL_FORCETILEDSKY, 0 }, + { "skystretch", MITYPE_CLRFLAG, LEVEL_FORCETILEDSKY, 0 }, { "allowfreelook", MITYPE_SCFLAGS, LEVEL_FREELOOK_YES, ~LEVEL_FREELOOK_NO }, { "nofreelook", MITYPE_SCFLAGS, LEVEL_FREELOOK_NO, ~LEVEL_FREELOOK_YES }, { "allowjump", MITYPE_CLRFLAG, LEVEL_JUMP_NO, 0 }, diff --git a/src/gl/scene/gl_skydome.cpp b/src/gl/scene/gl_skydome.cpp index 015b420163..1d9cf9b3b9 100644 --- a/src/gl/scene/gl_skydome.cpp +++ b/src/gl/scene/gl_skydome.cpp @@ -60,7 +60,7 @@ #include "w_wad.h" #include "r_state.h" #include "r_utility.h" -//#include "gl/gl_intern.h" +#include "g_levellocals.h" #include "gl/system/gl_interface.h" #include "gl/data/gl_data.h" @@ -381,7 +381,13 @@ void RenderDome(FMaterial * tex, float x_offset, float y_offset, bool mirror, in float xscale = texw < 1024.f ? floor(1024.f / float(texw)) : 1.f; float yscale = 1.f; - if (texh < 128) + if (texh <= 128 && (level.flags & LEVEL_FORCETILEDSKY)) + { + gl_RenderState.mModelMatrix.translate(0.f, (-40 + tex->tex->SkyOffset + skyoffset)*skyoffsetfactor, 0.f); + gl_RenderState.mModelMatrix.scale(1.f, 1.2f * 1.17f, 1.f); + yscale = 240.f / texh; + } + else 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); diff --git a/src/r_plane.cpp b/src/r_plane.cpp index c57a6ac5ba..1018f27f6e 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -842,7 +842,7 @@ static void R_DrawCapSky(visplane_t *pl) static void R_DrawSky (visplane_t *pl) { - if (r_skymode == 2) + if (r_skymode == 2 && !(level.flags & LEVEL_FORCETILEDSKY)) { R_DrawCapSky(pl); return; diff --git a/src/r_sky.cpp b/src/r_sky.cpp index 89a2bc44cb..f2804bad77 100644 --- a/src/r_sky.cpp +++ b/src/r_sky.cpp @@ -120,12 +120,12 @@ void R_InitSkyMap () skystretch = (r_skymode == 1 && skyheight >= 128 && level.IsFreelookAllowed() - && !(level.flags & LEVEL_FORCENOSKYSTRETCH)) ? 1 : 0; + && !(level.flags & LEVEL_FORCETILEDSKY)) ? 1 : 0; skytexturemid = -28; } else if (skyheight > 200) { - skytexturemid = (200 - skyheight) * skytex1->Scale.Y +(r_skymode == 2 ? skytex1->SkyOffset + testskyoffset : 0); + skytexturemid = (200 - skyheight) * skytex1->Scale.Y +((r_skymode == 2 && !(level.flags & LEVEL_FORCETILEDSKY)) ? skytex1->SkyOffset + testskyoffset : 0); } if (viewwidth != 0 && viewheight != 0)