mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-27 14:22:13 +00:00
- moved the current portal pointer to HWDrawInfo so that the portal managed does not need to save and restore a global variable for each portal.
This commit is contained in:
parent
282fdac660
commit
1cf3af9c41
7 changed files with 4 additions and 11 deletions
|
@ -86,7 +86,6 @@ extern bool NoInterpolateView;
|
|||
FGLRenderer::FGLRenderer(OpenGLFrameBuffer *fb)
|
||||
{
|
||||
framebuffer = fb;
|
||||
mCurrentPortal = nullptr;
|
||||
mMirrorCount = 0;
|
||||
mPlaneMirrorCount = 0;
|
||||
mVBO = nullptr;
|
||||
|
|
|
@ -66,8 +66,6 @@ class FGLRenderer
|
|||
public:
|
||||
|
||||
OpenGLFrameBuffer *framebuffer;
|
||||
//GLPortal *mClipPortal;
|
||||
GLPortal *mCurrentPortal;
|
||||
int mMirrorCount;
|
||||
int mPlaneMirrorCount;
|
||||
FShaderManager *mShaderManager;
|
||||
|
|
|
@ -213,14 +213,11 @@ bool GLPortal::Start(bool usestencil, bool doquery, HWDrawInfo *outer_di, HWDraw
|
|||
}
|
||||
}
|
||||
*pDi = FDrawInfo::StartDrawInfo(outer_di->Viewpoint, &outer_di->VPUniforms);
|
||||
(*pDi)->mCurrentPortal = this;
|
||||
|
||||
// save viewpoint
|
||||
savedvisibility = outer_di->Viewpoint.camera ? outer_di->Viewpoint.camera->renderflags & RF_MAYBEINVISIBLE : ActorRenderFlags::FromInt(0);
|
||||
|
||||
|
||||
PrevPortal = GLRenderer->mCurrentPortal;
|
||||
GLRenderer->mCurrentPortal = this;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -263,7 +260,6 @@ void GLPortal::End(HWDrawInfo *di, bool usestencil)
|
|||
bool needdepth = NeedDepthBuffer();
|
||||
|
||||
Clocker c(PortalAll);
|
||||
GLRenderer->mCurrentPortal = PrevPortal;
|
||||
|
||||
di = static_cast<FDrawInfo*>(di)->EndDrawInfo();
|
||||
di->ApplyVPUniforms();
|
||||
|
|
|
@ -53,7 +53,6 @@ private:
|
|||
void DrawPortalStencil();
|
||||
|
||||
ActorRenderFlags savedvisibility;
|
||||
GLPortal *PrevPortal;
|
||||
TArray<unsigned int> mPrimIndices;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -130,7 +130,7 @@ void FDrawInfo::CreateScene()
|
|||
PreparePlayerSprites(vp.sector, in_area);
|
||||
|
||||
// Process all the sprites on the current portal's back side which touch the portal.
|
||||
if (GLRenderer->mCurrentPortal != NULL) GLRenderer->mCurrentPortal->RenderAttached(this);
|
||||
if (mCurrentPortal != nullptr) mCurrentPortal->RenderAttached(this);
|
||||
Bsp.Unclock();
|
||||
|
||||
// And now the crappy hacks that have to be done to avoid rendering anomalies.
|
||||
|
@ -414,7 +414,6 @@ void FDrawInfo::ProcessScene(bool toscreen)
|
|||
|
||||
int mapsection = R_PointInSubsector(Viewpoint.Pos)->mapsection;
|
||||
CurrentMapSections.Set(mapsection);
|
||||
GLRenderer->mCurrentPortal = nullptr;
|
||||
DrawScene(toscreen ? DM_MAINVIEW : DM_OFFSCREEN);
|
||||
|
||||
}
|
||||
|
|
|
@ -95,6 +95,7 @@ void HWDrawInfo::ClearBuffers()
|
|||
memset(&no_renderflags[0], 0, level.nodes.Size() * sizeof(no_renderflags[0]));
|
||||
|
||||
mClipPortal = nullptr;
|
||||
mCurrentPortal = nullptr;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -99,6 +99,7 @@ struct HWDrawInfo
|
|||
int FullbrightFlags;
|
||||
std::atomic<int> spriteindex;
|
||||
IPortal *mClipPortal;
|
||||
IPortal *mCurrentPortal;
|
||||
//FRotator mAngles;
|
||||
IShadowMap *mShadowMap;
|
||||
Clipper *mClipper;
|
||||
|
|
Loading…
Reference in a new issue