diff --git a/src/gl/scene/gl_drawinfo.h b/src/gl/scene/gl_drawinfo.h index 4129f92c5..f64c1ef48 100644 --- a/src/gl/scene/gl_drawinfo.h +++ b/src/gl/scene/gl_drawinfo.h @@ -1,7 +1,7 @@ #ifndef __GL_DRAWINFO_H #define __GL_DRAWINFO_H -#include "hwrenderer/scene/hw_drawlist.h" +#include "hwrenderer/scene/hw_drawinfo.h" #include "hwrenderer/scene/hw_weapon.h" #include "hwrenderer/scene/hw_viewpointuniforms.h" @@ -11,29 +11,9 @@ #pragma warning(disable:4244) #endif -enum DrawListType -{ - GLDL_PLAINWALLS, - GLDL_PLAINFLATS, - GLDL_MASKEDWALLS, - GLDL_MASKEDFLATS, - GLDL_MASKEDWALLSOFS, - GLDL_MODELS, - - GLDL_TRANSLUCENT, - GLDL_TRANSLUCENTBORDER, - - GLDL_TYPES, -}; - - struct FDrawInfo : public HWDrawInfo { - HWDrawList drawlists[GLDL_TYPES]; - int vpIndex; - void ApplyVPUniforms() override; - void AddWall(GLWall *wall) override; void AddMirrorSurface(GLWall *w) override; void AddFlat(GLFlat *flat, bool fog) override; diff --git a/src/gl/scene/gl_scene.cpp b/src/gl/scene/gl_scene.cpp index 3e9072afb..45fde2ad1 100644 --- a/src/gl/scene/gl_scene.cpp +++ b/src/gl/scene/gl_scene.cpp @@ -75,13 +75,6 @@ EXTERN_CVAR (Float, r_visibility) EXTERN_CVAR (Bool, r_drawvoxels) -void FDrawInfo::ApplyVPUniforms() -{ - VPUniforms.CalcDependencies(); - vpIndex = screen->mViewpoints->SetViewpoint(this, &VPUniforms); -} - - //----------------------------------------------------------------------------- // // CreateScene diff --git a/src/hwrenderer/scene/hw_drawinfo.cpp b/src/hwrenderer/scene/hw_drawinfo.cpp index 40219a00a..8cd126d9f 100644 --- a/src/hwrenderer/scene/hw_drawinfo.cpp +++ b/src/hwrenderer/scene/hw_drawinfo.cpp @@ -31,12 +31,12 @@ #include "d_player.h" #include "g_levellocals.h" #include "hw_fakeflat.h" -#include "hw_drawinfo.h" #include "hw_portal.h" #include "hw_renderstate.h" -#include "hw_drawlist.h" +#include "hw_drawinfo.h" #include "hwrenderer/utility/hw_clock.h" #include "hwrenderer/utility/hw_cvars.h" +#include "hwrenderer/data/hw_viewpointbuffer.h" EXTERN_CVAR(Float, r_visibility) CVAR(Bool, gl_bandedswlight, false, CVAR_ARCHIVE) @@ -252,7 +252,8 @@ void HWDrawInfo::SetupView(float vx, float vy, float vz, bool mirror, bool plane vp.SetViewAngle(r_viewwindow); SetViewMatrix(vp.HWAngles, vx, vy, vz, mirror, planemirror); SetCameraPos(vp.Pos); - ApplyVPUniforms(); + VPUniforms.CalcDependencies(); + vpIndex = screen->mViewpoints->SetViewpoint(this, &VPUniforms); } //----------------------------------------------------------------------------- diff --git a/src/hwrenderer/scene/hw_drawinfo.h b/src/hwrenderer/scene/hw_drawinfo.h index ae8c09e78..1a2f3e2eb 100644 --- a/src/hwrenderer/scene/hw_drawinfo.h +++ b/src/hwrenderer/scene/hw_drawinfo.h @@ -7,6 +7,7 @@ #include "hw_viewpointuniforms.h" #include "v_video.h" #include "hw_weapon.h" +#include "hw_drawlist.h" enum EDrawMode { @@ -115,6 +116,21 @@ enum EPortalClip PClip_Behind, }; +enum DrawListType +{ + GLDL_PLAINWALLS, + GLDL_PLAINFLATS, + GLDL_MASKEDWALLS, + GLDL_MASKEDFLATS, + GLDL_MASKEDWALLSOFS, + GLDL_MODELS, + + GLDL_TRANSLUCENT, + GLDL_TRANSLUCENTBORDER, + + GLDL_TYPES, +}; + struct HWDrawInfo { @@ -159,6 +175,9 @@ struct HWDrawInfo bool isNightvision() const { return !!(FullbrightFlags & Nightvision); } bool isStealthVision() const { return !!(FullbrightFlags & StealthVision); } + HWDrawList drawlists[GLDL_TYPES]; + int vpIndex; + HWDrawInfo * outer = nullptr; int FullbrightFlags; std::atomic spriteindex; @@ -337,7 +356,6 @@ public: virtual void AddFlat(GLFlat *flat, bool fog) = 0; virtual void AddSprite(GLSprite *sprite, bool translucent) = 0; - virtual void ApplyVPUniforms() = 0; virtual bool SetDepthClamp(bool on) = 0; GLDecal *AddDecal(bool onmirror); diff --git a/src/hwrenderer/scene/hw_drawlist.cpp b/src/hwrenderer/scene/hw_drawlist.cpp index 2224d7740..5342510d4 100644 --- a/src/hwrenderer/scene/hw_drawlist.cpp +++ b/src/hwrenderer/scene/hw_drawlist.cpp @@ -35,6 +35,7 @@ #include "hwrenderer/data/flatvertices.h" #include "hwrenderer/utility/hw_clock.h" #include "hw_renderstate.h" +#include "hw_drawinfo.h" FMemArena RenderDataAllocator(1024*1024); // Use large blocks to reduce allocation time. diff --git a/src/hwrenderer/scene/hw_drawlist.h b/src/hwrenderer/scene/hw_drawlist.h index 8975b1a14..303da06fb 100644 --- a/src/hwrenderer/scene/hw_drawlist.h +++ b/src/hwrenderer/scene/hw_drawlist.h @@ -1,10 +1,14 @@ #pragma once -#include "hwrenderer/scene/hw_drawinfo.h" #include "memarena.h" extern FMemArena RenderDataAllocator; void ResetRenderDataAllocator(); +struct HWDrawInfo; +class GLWall; +class GLFlat; +class GLSprite; +class FRenderState; //========================================================================== //