- removed gl dependencies from gl_sky.cpp by moving some data into other places.

This commit is contained in:
Christoph Oelckers 2018-04-28 00:18:49 +02:00
commit cc926dec1e
9 changed files with 21 additions and 24 deletions

View file

@ -33,9 +33,6 @@
#include "hwrenderer/utility/hw_lighting.h"
#include "hwrenderer/textures/hw_material.h"
#include "gl/renderer/gl_renderer.h"
#include "gl/scene/gl_portal.h"
CVAR(Bool,gl_noskyboxes, false, 0)
//==========================================================================
@ -76,7 +73,7 @@ void GLSkyInfo::init(int sky1, PalEntry FadeColor)
if (level.flags&LEVEL_DOUBLESKY)
{
texture[1] = FMaterial::ValidateTexture(sky1texture, false, true);
x_offset[1] = GLRenderer->mSky1Pos;
x_offset[1] = hw_sky1pos;
doublesky = true;
}
@ -86,13 +83,13 @@ void GLSkyInfo::init(int sky1, PalEntry FadeColor)
texture[0] = FMaterial::ValidateTexture(sky2texture, false, true);
skytexno1 = sky2texture;
sky2 = true;
x_offset[0] = GLRenderer->mSky2Pos;
x_offset[0] = hw_sky2pos;
}
else if (!doublesky)
{
texture[0] = FMaterial::ValidateTexture(sky1texture, false, true);
skytexno1 = sky1texture;
x_offset[0] = GLRenderer->mSky1Pos;
x_offset[0] = hw_sky1pos;
}
}
if (level.skyfog > 0)
@ -124,7 +121,8 @@ void GLWall::SkyPlane(HWDrawInfo *di, sector_t *sector, int plane, bool allowref
GLSkyInfo skyinfo;
skyinfo.init(sector->sky, Colormap.FadeColor);
ptype = PORTALTYPE_SKY;
sky = UniqueSkies.Get(&skyinfo);
sky = &skyinfo;
PutPortal(di, ptype);
}
else if (sportal != nullptr)
{
@ -139,7 +137,7 @@ void GLWall::SkyPlane(HWDrawInfo *di, sector_t *sector, int plane, bool allowref
{
if (sector->PortalBlocksView(plane)) return;
if (GLPortal::instack[1 - plane]) return;
if (screen->instack[1 - plane]) return;
ptype = PORTALTYPE_SECTORSTACK;
portal = glport;
}
@ -192,7 +190,7 @@ void GLWall::SkyLine(HWDrawInfo *di, sector_t *fs, line_t *line)
{
skyinfo.init(fs->sky, Colormap.FadeColor);
ptype = PORTALTYPE_SKY;
sky = UniqueSkies.Get(&skyinfo);
sky = &skyinfo;
}
ztop[0] = zceil[0];
ztop[1] = zceil[1];