diff --git a/src/gl/scene/gl_drawinfo.h b/src/gl/scene/gl_drawinfo.h index 9327579b8..afdbb7185 100644 --- a/src/gl/scene/gl_drawinfo.h +++ b/src/gl/scene/gl_drawinfo.h @@ -14,6 +14,5 @@ struct FDrawInfo : public HWDrawInfo { void DrawScene(int drawmode) override; - void ProcessScene(bool toscreen = false); }; #endif diff --git a/src/gl/scene/gl_scene.cpp b/src/gl/scene/gl_scene.cpp index 607d2e836..f8b48d3ae 100644 --- a/src/gl/scene/gl_scene.cpp +++ b/src/gl/scene/gl_scene.cpp @@ -140,22 +140,6 @@ void FDrawInfo::DrawScene(int drawmode) RenderTranslucent(gl_RenderState); } -//----------------------------------------------------------------------------- -// -// R_RenderView - renders one view - either the screen or a camera texture -// -//----------------------------------------------------------------------------- - -void FDrawInfo::ProcessScene(bool toscreen) -{ - screen->mPortalState->BeginScene(); - - int mapsection = R_PointInSubsector(Viewpoint.Pos)->mapsection; - CurrentMapSections.Set(mapsection); - DrawScene(toscreen ? DM_MAINVIEW : DM_OFFSCREEN); - -} - //----------------------------------------------------------------------------- // // Renders one viewpoint in a scene @@ -186,7 +170,7 @@ sector_t * FGLRenderer::RenderViewpoint (FRenderViewpoint &mainvp, AActor * came } - FDrawInfo *di = static_cast(HWDrawInfo::StartDrawInfo(mainvp, nullptr)); + FDrawInfo *di = static_cast(HWDrawInfo::StartDrawInfo(nullptr, mainvp, nullptr)); auto &vp = di->Viewpoint; di->Set3DViewport(gl_RenderState); diff --git a/src/hwrenderer/scene/hw_drawinfo.cpp b/src/hwrenderer/scene/hw_drawinfo.cpp index f5d970e1d..5801bab8c 100644 --- a/src/hwrenderer/scene/hw_drawinfo.cpp +++ b/src/hwrenderer/scene/hw_drawinfo.cpp @@ -112,7 +112,7 @@ void FDrawInfoList::Release(HWDrawInfo * di) // //========================================================================== -HWDrawInfo *HWDrawInfo::StartDrawInfo(FRenderViewpoint &parentvp, HWViewpointUniforms *uniforms) +HWDrawInfo *HWDrawInfo::StartDrawInfo(HWDrawInfo *parent, FRenderViewpoint &parentvp, HWViewpointUniforms *uniforms) { HWDrawInfo *di = di_list.GetNew(); di->StartScene(parentvp, uniforms); @@ -581,7 +581,7 @@ void HWDrawInfo::RenderPortal(HWPortal *p, FRenderState &state, bool usestencil) { auto gp = static_cast(p); gp->SetupStencil(this, state, usestencil); - auto new_di = StartDrawInfo(Viewpoint, &VPUniforms); + auto new_di = StartDrawInfo(this, Viewpoint, &VPUniforms); new_di->mCurrentPortal = gp; state.SetLightIndex(-1); gp->DrawContents(new_di, state); @@ -668,3 +668,20 @@ void HWDrawInfo::Set3DViewport(FRenderState &state) state.SetStencil(0, SOP_Keep, SF_AllOn); } +//----------------------------------------------------------------------------- +// +// R_RenderView - renders one view - either the screen or a camera texture +// +//----------------------------------------------------------------------------- + +void HWDrawInfo::ProcessScene(bool toscreen) +{ + screen->mPortalState->BeginScene(); + + int mapsection = R_PointInSubsector(Viewpoint.Pos)->mapsection; + CurrentMapSections.Set(mapsection); + DrawScene(toscreen ? DM_MAINVIEW : DM_OFFSCREEN); + +} + + diff --git a/src/hwrenderer/scene/hw_drawinfo.h b/src/hwrenderer/scene/hw_drawinfo.h index 2fa6ee3b5..bb4cdb4c3 100644 --- a/src/hwrenderer/scene/hw_drawinfo.h +++ b/src/hwrenderer/scene/hw_drawinfo.h @@ -257,7 +257,7 @@ public: HWPortal * FindPortal(const void * src); void RenderBSPNode(void *node); - static HWDrawInfo *StartDrawInfo(FRenderViewpoint &parentvp, HWViewpointUniforms *uniforms); + static HWDrawInfo *StartDrawInfo(HWDrawInfo *parent, FRenderViewpoint &parentvp, HWViewpointUniforms *uniforms); void StartScene(FRenderViewpoint &parentvp, HWViewpointUniforms *uniforms); void ClearBuffers(); HWDrawInfo *EndDrawInfo(); @@ -271,6 +271,7 @@ public: void EndDrawScene(sector_t * viewsector, FRenderState &state); void DrawEndScene2D(sector_t * viewsector, FRenderState &state); void Set3DViewport(FRenderState &state); + void ProcessScene(bool toscreen); bool DoOneSectorUpper(subsector_t * subsec, float planez, area_t in_area); bool DoOneSectorLower(subsector_t * subsec, float planez, area_t in_area);