diff --git a/src/gl/compatibility/gl_20.cpp b/src/gl/compatibility/gl_20.cpp index 66a7bc5f9..917963e48 100644 --- a/src/gl/compatibility/gl_20.cpp +++ b/src/gl/compatibility/gl_20.cpp @@ -47,6 +47,7 @@ #include "gl/system/gl_cvars.h" #include "gl/renderer/gl_renderstate.h" #include "gl/scene/gl_drawinfo.h" +#include "gl/scene/gl_scenedrawer.h" #include "gl/data/gl_vertexbuffer.h" @@ -756,7 +757,7 @@ void GLWall::RenderLightsCompat(int pass) // //========================================================================== -void FGLRenderer::RenderMultipassStuff() +void GLSceneDrawer::RenderMultipassStuff() { // First pass: empty background with sector light only @@ -790,7 +791,7 @@ void FGLRenderer::RenderMultipassStuff() // second pass: draw lights glDepthMask(false); - if (mLightCount && !gl_fixedcolormap) + if (GLRenderer->mLightCount && !gl_fixedcolormap) { if (gl_SetupLightTexture()) { diff --git a/src/gl/renderer/gl_renderer.h b/src/gl/renderer/gl_renderer.h index 4d8883205..4406b2d99 100644 --- a/src/gl/renderer/gl_renderer.h +++ b/src/gl/renderer/gl_renderer.h @@ -158,21 +158,12 @@ public: int ScreenToWindowX(int x); int ScreenToWindowY(int y); - angle_t FrustumAngle(); - void SetViewArea(); - void Set3DViewport(bool mainview); void Reset3DViewport(); sector_t *RenderViewpoint (AActor * camera, GL_IRECT * bounds, float fov, float ratio, float fovratio, bool mainview, bool toscreen); void RenderView(player_t *player); - void SetViewAngle(DAngle viewangle); - void SetupView(float viewx, float viewy, float viewz, DAngle viewangle, bool mirror, bool planemirror); void Initialize(int width, int height); - void RenderMultipassStuff(); - void RenderScene(int recursion); - void RenderTranslucent(); - void DrawScene(int drawmode); void DrawBlend(sector_t * viewsector); void DrawPSprite (player_t * player,DPSprite *psp,float sx, float sy, bool hudModelStep, int OverrideShader, bool alphatexture); @@ -208,10 +199,6 @@ public: void DrawPresentTexture(const GL_IRECT &box, bool applyGamma); void Flush(); - void SetProjection(float fov, float ratio, float fovratio); - void SetProjection(VSMatrix matrix); // raw matrix input from stereo 3d modes - void SetViewMatrix(float vx, float vy, float vz, bool mirror, bool planemirror); - void ProcessScene(bool toscreen = false); bool StartOffscreen(); void EndOffscreen(); diff --git a/src/gl/scene/gl_portal.cpp b/src/gl/scene/gl_portal.cpp index ebfad3d4d..1f8f521ed 100644 --- a/src/gl/scene/gl_portal.cpp +++ b/src/gl/scene/gl_portal.cpp @@ -328,7 +328,7 @@ inline void GLPortal::ClearClipper() } // and finally clip it to the visible area - angle_t a1 = GLRenderer->FrustumAngle(); + angle_t a1 = drawer->FrustumAngle(); if (a1 < ANGLE_180) drawer->clipper.SafeAddClipRangeRealAngles(r_viewpoint.Angles.Yaw.BAMs() + a1, r_viewpoint.Angles.Yaw.BAMs() - a1); // lock the parts that have just been clipped out. @@ -363,7 +363,7 @@ void GLPortal::End(bool usestencil) GLRenderer->mViewActor=savedviewactor; in_area=savedviewarea; if (r_viewpoint.camera != nullptr) r_viewpoint.camera->renderflags = (r_viewpoint.camera->renderflags & ~RF_MAYBEINVISIBLE) | savedvisibility; - GLRenderer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag & 1), !!(PlaneMirrorFlag & 1)); + drawer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag & 1), !!(PlaneMirrorFlag & 1)); { ScopedColorMask colorMask(0, 0, 0, 0); // glColorMask(0, 0, 0, 0); // no graphics @@ -422,7 +422,7 @@ void GLPortal::End(bool usestencil) GLRenderer->mViewActor=savedviewactor; in_area=savedviewarea; if (r_viewpoint.camera != nullptr) r_viewpoint.camera->renderflags |= savedvisibility; - GLRenderer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1)); + drawer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1)); // This draws a valid z-buffer into the stencil's contents to ensure it // doesn't get overwritten by the level's geometry. @@ -648,8 +648,8 @@ void GLSkyboxPortal::DrawContents() GLRenderer->mViewActor = origin; inskybox = true; - GLRenderer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag & 1), !!(PlaneMirrorFlag & 1)); - GLRenderer->SetViewArea(); + drawer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag & 1), !!(PlaneMirrorFlag & 1)); + drawer->SetViewArea(); ClearClipper(); int mapsection = R_PointInSubsector(r_viewpoint.Pos)->mapsection; @@ -657,7 +657,7 @@ void GLSkyboxPortal::DrawContents() SaveMapSection(); currentmapsection[mapsection >> 3] |= 1 << (mapsection & 7); - GLRenderer->DrawScene(DM_SKYPORTAL); + drawer->DrawScene(DM_SKYPORTAL); portal->mFlags &= ~PORTSF_INSKYBOX; inskybox = false; gl_RenderState.SetDepthClamp(oldclamp); @@ -744,7 +744,7 @@ void GLSectorStackPortal::DrawContents() // avoid recursions! if (origin->plane != -1) instack[origin->plane]++; - GLRenderer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1)); + drawer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1)); SaveMapSection(); SetupCoverage(); ClearClipper(); @@ -758,7 +758,7 @@ void GLSectorStackPortal::DrawContents() drawer->clipper.SetBlocked(true); } - GLRenderer->DrawScene(DM_PORTAL); + drawer->DrawScene(DM_PORTAL); RestoreMapSection(); if (origin->plane != -1) instack[origin->plane]--; @@ -801,11 +801,11 @@ void GLPlaneMirrorPortal::DrawContents() PlaneMirrorMode = origin->fC() < 0 ? -1 : 1; PlaneMirrorFlag++; - GLRenderer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag & 1), !!(PlaneMirrorFlag & 1)); + drawer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag & 1), !!(PlaneMirrorFlag & 1)); ClearClipper(); gl_RenderState.SetClipHeight(planez, PlaneMirrorMode < 0 ? -1.f : 1.f); - GLRenderer->DrawScene(DM_PORTAL); + drawer->DrawScene(DM_PORTAL); gl_RenderState.SetClipHeight(0.f, 0.f); PlaneMirrorFlag--; PlaneMirrorMode = old_pm; @@ -967,11 +967,11 @@ void GLMirrorPortal::DrawContents() GLRenderer->mViewActor = NULL; MirrorFlag++; - GLRenderer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1)); + drawer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1)); drawer->clipper.Clear(); - angle_t af = GLRenderer->FrustumAngle(); + angle_t af = drawer->FrustumAngle(); if (afclipper.SafeAddClipRangeRealAngles(r_viewpoint.Angles.Yaw.BAMs()+af, r_viewpoint.Angles.Yaw.BAMs()-af); angle_t a2 = linedef->v1->GetClipAngle(); @@ -980,7 +980,7 @@ void GLMirrorPortal::DrawContents() gl_RenderState.SetClipLine(linedef); gl_RenderState.EnableClipLine(true); - GLRenderer->DrawScene(DM_PORTAL); + drawer->DrawScene(DM_PORTAL); gl_RenderState.EnableClipLine(false); MirrorFlag--; @@ -1049,12 +1049,12 @@ void GLLineToLinePortal::DrawContents() } GLRenderer->mViewActor = nullptr; - GLRenderer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1)); + drawer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1)); ClearClipper(); gl_RenderState.SetClipLine(glport->lines[0]->mDestination); gl_RenderState.EnableClipLine(true); - GLRenderer->DrawScene(DM_PORTAL); + drawer->DrawScene(DM_PORTAL); gl_RenderState.EnableClipLine(false); RestoreMapSection(); } diff --git a/src/gl/scene/gl_scene.cpp b/src/gl/scene/gl_scene.cpp index 619f71cf4..0b704ad79 100644 --- a/src/gl/scene/gl_scene.cpp +++ b/src/gl/scene/gl_scene.cpp @@ -100,18 +100,18 @@ void gl_ParseDefs(); // R_FrustumAngle // //----------------------------------------------------------------------------- -angle_t FGLRenderer::FrustumAngle() +angle_t GLSceneDrawer::FrustumAngle() { - float tilt= fabs(mAngles.Pitch.Degrees); + float tilt = fabs(GLRenderer->mAngles.Pitch.Degrees); // If the pitch is larger than this you can look all around at a FOV of 90° - if (tilt>46.0f) return 0xffffffff; + if (tilt > 46.0f) return 0xffffffff; // ok, this is a gross hack that barely works... // but at least it doesn't overestimate too much... - double floatangle=2.0+(45.0+((tilt/1.9)))*mCurrentFoV*48.0/AspectMultiplier(r_viewwindow.WidescreenRatio)/90.0; + double floatangle = 2.0 + (45.0 + ((tilt / 1.9)))*GLRenderer->mCurrentFoV*48.0 / AspectMultiplier(r_viewwindow.WidescreenRatio) / 90.0; angle_t a1 = DAngle(floatangle).BAMs(); - if (a1>=ANGLE_180) return 0xffffffff; + if (a1 >= ANGLE_180) return 0xffffffff; return a1; } @@ -120,7 +120,7 @@ angle_t FGLRenderer::FrustumAngle() // Sets the area the camera is in // //----------------------------------------------------------------------------- -void FGLRenderer::SetViewArea() +void GLSceneDrawer::SetViewArea() { // The render_sector is better suited to represent the current position in GL r_viewpoint.sector = R_PointInSubsector(r_viewpoint.Pos)->render_sector; @@ -155,12 +155,12 @@ void FGLRenderer::Reset3DViewport() // //----------------------------------------------------------------------------- -void FGLRenderer::Set3DViewport(bool mainview) +void GLSceneDrawer::Set3DViewport(bool mainview) { - if (mainview && mBuffers->Setup(mScreenViewport.width, mScreenViewport.height, mSceneViewport.width, mSceneViewport.height)) + if (mainview && GLRenderer->mBuffers->Setup(GLRenderer->mScreenViewport.width, GLRenderer->mScreenViewport.height, GLRenderer->mSceneViewport.width, GLRenderer->mSceneViewport.height)) { bool useSSAO = (gl_ssao != 0); - mBuffers->BindSceneFB(useSSAO); + GLRenderer->mBuffers->BindSceneFB(useSSAO); gl_RenderState.SetPassType(useSSAO ? GBUFFER_PASS : NORMAL_PASS); gl_RenderState.EnableDrawBuffers(gl_RenderState.GetPassDrawBufferCount()); gl_RenderState.Apply(); @@ -170,10 +170,10 @@ void FGLRenderer::Set3DViewport(bool mainview) // This is faster on newer hardware because it allows the GPU to skip // reading from slower memory where the full buffers are stored. glDisable(GL_SCISSOR_TEST); - glClearColor(mSceneClearColor[0], mSceneClearColor[1], mSceneClearColor[2], 1.0f); + glClearColor(GLRenderer->mSceneClearColor[0], GLRenderer->mSceneClearColor[1], GLRenderer->mSceneClearColor[2], 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - const auto &bounds = mSceneViewport; + const auto &bounds = GLRenderer->mSceneViewport; glViewport(bounds.left, bounds.top, bounds.width, bounds.height); glScissor(bounds.left, bounds.top, bounds.width, bounds.height); @@ -192,12 +192,12 @@ void FGLRenderer::Set3DViewport(bool mainview) // //----------------------------------------------------------------------------- -void FGLRenderer::SetViewAngle(DAngle viewangle) +void GLSceneDrawer::SetViewAngle(DAngle viewangle) { - mAngles.Yaw = float(270.0-viewangle.Degrees); + GLRenderer->mAngles.Yaw = float(270.0-viewangle.Degrees); DVector2 v = r_viewpoint.Angles.Yaw.ToVector(); - mViewVector.X = v.X; - mViewVector.Y = v.Y; + GLRenderer->mViewVector.X = v.X; + GLRenderer->mViewVector.Y = v.Y; R_SetViewAngle(r_viewpoint, r_viewwindow); } @@ -210,15 +210,7 @@ void FGLRenderer::SetViewAngle(DAngle viewangle) // //----------------------------------------------------------------------------- -void FGLRenderer::SetProjection(float fov, float ratio, float fovratio) -{ - - float fovy = 2 * RAD2DEG(atan(tan(DEG2RAD(fov) / 2) / fovratio)); - gl_RenderState.mProjectionMatrix.perspective(fovy, ratio, GetZNear(), GetZFar()); -} - -// raw matrix input from stereo 3d modes -void FGLRenderer::SetProjection(VSMatrix matrix) +void GLSceneDrawer::SetProjection(VSMatrix matrix) { gl_RenderState.mProjectionMatrix.loadIdentity(); gl_RenderState.mProjectionMatrix.multMatrix(matrix); @@ -230,7 +222,7 @@ void FGLRenderer::SetProjection(VSMatrix matrix) // //----------------------------------------------------------------------------- -void FGLRenderer::SetViewMatrix(float vx, float vy, float vz, bool mirror, bool planemirror) +void GLSceneDrawer::SetViewMatrix(float vx, float vy, float vz, bool mirror, bool planemirror) { float mult = mirror? -1:1; float planemult = planemirror? -glset.pixelstretch : glset.pixelstretch; @@ -250,7 +242,7 @@ void FGLRenderer::SetViewMatrix(float vx, float vy, float vz, bool mirror, bool // Setup the view rotation matrix for the given viewpoint // //----------------------------------------------------------------------------- -void FGLRenderer::SetupView(float vx, float vy, float vz, DAngle va, bool mirror, bool planemirror) +void GLSceneDrawer::SetupView(float vx, float vy, float vz, DAngle va, bool mirror, bool planemirror) { SetViewAngle(va); SetViewMatrix(vx, vy, vz, mirror, planemirror); @@ -267,9 +259,8 @@ void FGLRenderer::SetupView(float vx, float vy, float vz, DAngle va, bool mirror void GLSceneDrawer::CreateScene() { - angle_t a1 = GLRenderer->FrustumAngle(); + angle_t a1 = FrustumAngle(); InitClipper(r_viewpoint.Angles.Yaw.BAMs() + a1, r_viewpoint.Angles.Yaw.BAMs() - a1); - GLPortal::drawer = this; // reset the portal manager GLPortal::StartFrame(); @@ -306,7 +297,7 @@ void GLSceneDrawer::CreateScene() // //----------------------------------------------------------------------------- -void FGLRenderer::RenderScene(int recursion) +void GLSceneDrawer::RenderScene(int recursion) { RenderAll.Clock(); @@ -329,7 +320,7 @@ void FGLRenderer::RenderScene(int recursion) // if we don't have a persistently mapped buffer, we have to process all the dynamic lights up front, // so that we don't have to do repeated map/unmap calls on the buffer. - bool haslights = mLightCount > 0 && gl_fixedcolormap == CM_DEFAULT && gl_lights; + bool haslights = GLRenderer->mLightCount > 0 && gl_fixedcolormap == CM_DEFAULT && gl_lights; if (gl.lightmethod == LM_DEFERRED && haslights) { GLRenderer->mLights->Begin(); @@ -358,7 +349,7 @@ void FGLRenderer::RenderScene(int recursion) { pass = GLPASS_ALL; } - else + else // GL 2.x legacy mode { // process everything that needs to handle textured dynamic lights. if (haslights) RenderMultipassStuff(); @@ -445,7 +436,7 @@ void FGLRenderer::RenderScene(int recursion) // //----------------------------------------------------------------------------- -void FGLRenderer::RenderTranslucent() +void GLSceneDrawer::RenderTranslucent() { RenderAll.Clock(); @@ -477,7 +468,7 @@ void FGLRenderer::RenderTranslucent() // //----------------------------------------------------------------------------- -void FGLRenderer::DrawScene(int drawmode) +void GLSceneDrawer::DrawScene(int drawmode) { static int recursion=0; static int ssao_portals_available = 0; @@ -498,17 +489,15 @@ void FGLRenderer::DrawScene(int drawmode) ssao_portals_available--; } - GLSceneDrawer drawer; - if (r_viewpoint.camera != nullptr) { ActorRenderFlags savedflags = r_viewpoint.camera->renderflags; - drawer.CreateScene(); + CreateScene(); r_viewpoint.camera->renderflags = savedflags; } else { - drawer.CreateScene(); + CreateScene(); } GLRenderer->mClipPortal = NULL; // this must be reset before any portal recursion takes place. @@ -517,8 +506,8 @@ void FGLRenderer::DrawScene(int drawmode) if (applySSAO && gl_RenderState.GetPassType() == GBUFFER_PASS) { gl_RenderState.EnableDrawBuffers(1); - AmbientOccludeScene(); - mBuffers->BindSceneFB(true); + GLRenderer->AmbientOccludeScene(); + GLRenderer->mBuffers->BindSceneFB(true); gl_RenderState.EnableDrawBuffers(gl_RenderState.GetPassDrawBufferCount()); gl_RenderState.Apply(); gl_RenderState.ApplyMatrices(); @@ -732,7 +721,7 @@ void FGLRenderer::EndDrawScene(sector_t * viewsector) // //----------------------------------------------------------------------------- -void FGLRenderer::ProcessScene(bool toscreen) +void GLSceneDrawer::ProcessScene(bool toscreen) { FDrawInfo::StartDrawInfo(); iter_dlightf = iter_dlight = draw_dlight = draw_dlightf = 0; @@ -800,12 +789,14 @@ void FGLRenderer::SetFixedColormap (player_t *player) sector_t * FGLRenderer::RenderViewpoint (AActor * camera, GL_IRECT * bounds, float fov, float ratio, float fovratio, bool mainview, bool toscreen) { + GLSceneDrawer drawer; + sector_t * lviewsector; mSceneClearColor[0] = 0.0f; mSceneClearColor[1] = 0.0f; mSceneClearColor[2] = 0.0f; R_SetupFrame (r_viewpoint, r_viewwindow, camera); - SetViewArea(); + drawer.SetViewArea(); // We have to scale the pitch to account for the pixel stretching, because the playsim doesn't know about this and treats it as 1:1. double radPitch = r_viewpoint.Angles.Pitch.Normalized180().Radians(); @@ -844,20 +835,20 @@ sector_t * FGLRenderer::RenderViewpoint (AActor * camera, GL_IRECT * bounds, flo const s3d::EyePose * eye = stereo3dMode.getEyePose(eye_ix); eye->SetUp(); SetOutputViewport(bounds); - Set3DViewport(mainview); + drawer.Set3DViewport(mainview); mDrawingScene2D = true; mCurrentFoV = fov; // Stereo mode specific perspective projection - SetProjection( eye->GetProjection(fov, ratio, fovratio) ); + drawer.SetProjection( eye->GetProjection(fov, ratio, fovratio) ); // SetProjection(fov, ratio, fovratio); // switch to perspective mode and set up clipper - SetViewAngle(r_viewpoint.Angles.Yaw); + drawer.SetViewAngle(r_viewpoint.Angles.Yaw); // Stereo mode specific viewpoint adjustment - temporarily shifts global ViewPos eye->GetViewShift(GLRenderer->mAngles.Yaw.Degrees, viewShift); s3d::ScopedViewShifter viewShifter(viewShift); - SetViewMatrix(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, false, false); + drawer.SetViewMatrix(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, false, false); gl_RenderState.ApplyMatrices(); - ProcessScene(toscreen); + drawer.ProcessScene(toscreen); if (mainview && toscreen) EndDrawScene(lviewsector); // do not call this for camera textures. if (mainview && FGLRenderBuffers::IsEnabled()) { diff --git a/src/gl/scene/gl_scenedrawer.h b/src/gl/scene/gl_scenedrawer.h index eb40ecb35..375a8bdc1 100644 --- a/src/gl/scene/gl_scenedrawer.h +++ b/src/gl/scene/gl_scenedrawer.h @@ -3,6 +3,7 @@ #include "r_defs.h" #include "m_fixed.h" #include "gl_clipper.h" +#include "gl_portal.h" class GLSceneDrawer { @@ -10,7 +11,9 @@ class GLSceneDrawer subsector_t *currentsubsector; // used by the line processing code. sector_t *currentsector; - + + void RenderMultipassStuff(); + void UnclipSubsector(subsector_t *sub); void AddLine (seg_t *seg, bool portalclip); void PolySubsector(subsector_t * sub); @@ -22,11 +25,29 @@ class GLSceneDrawer void DoSubsector(subsector_t * sub); void RenderBSPNode(void *node); -public: - Clipper clipper; - + void RenderScene(int recursion); + void RenderTranslucent(); + void CreateScene(); +public: + GLSceneDrawer() + { + GLPortal::drawer = this; + } + + Clipper clipper; + + angle_t FrustumAngle(); + void SetViewMatrix(float vx, float vy, float vz, bool mirror, bool planemirror); + void SetViewArea(); + void SetupView(float vx, float vy, float vz, DAngle va, bool mirror, bool planemirror); + void SetViewAngle(DAngle viewangle); + void SetProjection(VSMatrix matrix); + void Set3DViewport(bool mainview); + void DrawScene(int drawmode); + void ProcessScene(bool toscreen = false); + void InitClipper(angle_t a1, angle_t a2) { clipper.SafeAddClipRangeRealAngles(a1, a2); diff --git a/src/gl/scene/gl_skydome.cpp b/src/gl/scene/gl_skydome.cpp index a988bdfec..ea19c8ca3 100644 --- a/src/gl/scene/gl_skydome.cpp +++ b/src/gl/scene/gl_skydome.cpp @@ -68,6 +68,7 @@ #include "gl/renderer/gl_lightdata.h" #include "gl/renderer/gl_renderstate.h" #include "gl/scene/gl_drawinfo.h" +#include "gl/scene/gl_scenedrawer.h" #include "gl/scene/gl_portal.h" #include "gl/shaders/gl_shader.h" #include "gl/textures/gl_bitmap.h" @@ -519,7 +520,7 @@ void GLSkyPortal::DrawContents() bool oldClamp = gl_RenderState.SetDepthClamp(true); gl_MatrixStack.Push(gl_RenderState.mViewMatrix); - GLRenderer->SetupView(0, 0, 0, r_viewpoint.Angles.Yaw, !!(MirrorFlag & 1), !!(PlaneMirrorFlag & 1)); + drawer->SetupView(0, 0, 0, r_viewpoint.Angles.Yaw, !!(MirrorFlag & 1), !!(PlaneMirrorFlag & 1)); gl_RenderState.SetVertexBuffer(GLRenderer->mSkyVBO); if (origin->texture[0] && origin->texture[0]->tex->gl_info.bSkybox)