- let 'forcenoskystretch' also apply to sky mode 2 and OpenGL, to reflect its true meaning the internal flag has been renamed to FORCETILEDSKY which it always was about.

This commit is contained in:
Christoph Oelckers 2017-01-13 11:11:14 +01:00
parent 4001e7e6bd
commit 6cbc0a80e8
5 changed files with 14 additions and 8 deletions

View file

@ -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,

View file

@ -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 },

View file

@ -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);

View file

@ -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;

View file

@ -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)