- use the quad drawer for skybox-flagged sectors.

This commit is contained in:
Christoph Oelckers 2016-08-26 00:02:32 +02:00
parent b83c2056a8
commit 6755cb2a25

View file

@ -64,6 +64,7 @@
#include "gl/utility/gl_clock.h" #include "gl/utility/gl_clock.h"
#include "gl/utility/gl_convert.h" #include "gl/utility/gl_convert.h"
#include "gl/utility/gl_templates.h" #include "gl/utility/gl_templates.h"
#include "gl/renderer/gl_quaddrawer.h"
#ifdef _DEBUG #ifdef _DEBUG
CVAR(Int, gl_breaksec, -1, 0) CVAR(Int, gl_breaksec, -1, 0)
@ -318,7 +319,6 @@ void GLFlat::DrawSubsectors(int pass, bool processlights, bool istrans)
void GLFlat::DrawSkyboxSector(int pass, bool processlights) void GLFlat::DrawSkyboxSector(int pass, bool processlights)
{ {
FFlatVertex *ptr = GLRenderer->mVBO->GetBuffer();
float minx = FLT_MAX, miny = FLT_MAX; float minx = FLT_MAX, miny = FLT_MAX;
float maxx = -FLT_MAX, maxy = -FLT_MAX; float maxx = -FLT_MAX, maxy = -FLT_MAX;
@ -345,36 +345,13 @@ void GLFlat::DrawSkyboxSector(int pass, bool processlights)
static float vvals[] = { 1, 0, 0, 1 }; static float vvals[] = { 1, 0, 0, 1 };
int rot = -xs_FloorToInt(plane.Angle / 90.f); int rot = -xs_FloorToInt(plane.Angle / 90.f);
FQuadDrawer qd;
ptr->x = minx; qd.Set(0, minx, z, miny, uvals[rot & 3], vvals[rot & 3]);
ptr->z = z; qd.Set(1, minx, z, maxy, uvals[(rot + 1) & 3], vvals[(rot + 1) & 3]);
ptr->y = miny; qd.Set(2, maxx, z, maxy, uvals[(rot + 2) & 3], vvals[(rot + 2) & 3]);
ptr->u = uvals[rot & 3]; qd.Set(3, maxx, z, miny, uvals[(rot + 3) & 3], vvals[(rot + 3) & 3]);
ptr->v = vvals[rot & 3]; qd.Render(GL_TRIANGLE_FAN);
ptr++;
ptr->x = minx;
ptr->z = z;
ptr->y = maxy;
ptr->u = uvals[(rot + 1) & 3];
ptr->v = vvals[(rot + 1) & 3];
ptr++;
ptr->x = maxx;
ptr->z = z;
ptr->y = maxy;
ptr->u = uvals[(rot + 2) & 3];
ptr->v = vvals[(rot + 2) & 3];
ptr++;
ptr->x = maxx;
ptr->z = z;
ptr->y = miny;
ptr->u = uvals[(rot + 3) & 3];
ptr->v = vvals[(rot + 3) & 3];
ptr++;
GLRenderer->mVBO->RenderCurrent(ptr, GL_TRIANGLE_FAN);
flatvertices += 4; flatvertices += 4;
flatprimitives++; flatprimitives++;