- moved ProcessScene to hwrenderer

This commit is contained in:
Christoph Oelckers 2018-10-29 12:25:41 +01:00
parent 8991537e57
commit 325d2126ec
4 changed files with 22 additions and 21 deletions

View file

@ -14,6 +14,5 @@
struct FDrawInfo : public HWDrawInfo
{
void DrawScene(int drawmode) override;
void ProcessScene(bool toscreen = false);
};
#endif

View file

@ -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<FDrawInfo*>(HWDrawInfo::StartDrawInfo(mainvp, nullptr));
FDrawInfo *di = static_cast<FDrawInfo*>(HWDrawInfo::StartDrawInfo(nullptr, mainvp, nullptr));
auto &vp = di->Viewpoint;
di->Set3DViewport(gl_RenderState);

View file

@ -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<HWPortal *>(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);
}

View file

@ -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);