From d757efde96e08f69165a7b3d9b08c9563c489e78 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 24 Oct 2018 07:35:22 +0200 Subject: [PATCH] - renamed IPortal to HWPortal --- src/gl/scene/gl_drawinfo.cpp | 2 +- src/gl/scene/gl_drawinfo.h | 2 +- src/gl/scene/gl_portal.h | 4 ++-- src/gl/scene/gl_walls_draw.cpp | 2 +- src/hwrenderer/scene/hw_drawinfo.cpp | 2 +- src/hwrenderer/scene/hw_drawinfo.h | 10 +++++----- src/hwrenderer/scene/hw_portal.cpp | 8 ++++---- src/hwrenderer/scene/hw_portal.h | 14 +++++++------- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/gl/scene/gl_drawinfo.cpp b/src/gl/scene/gl_drawinfo.cpp index f1aa10d361..decbb8d2ce 100644 --- a/src/gl/scene/gl_drawinfo.cpp +++ b/src/gl/scene/gl_drawinfo.cpp @@ -312,7 +312,7 @@ void FDrawInfo::DrawHUDModel(HUDSprite *huds, FRenderState &state) renderer.RenderHUDModel(huds->weapon, huds->mx, huds->my); } -void FDrawInfo::RenderPortal(IPortal *p, bool usestencil) +void FDrawInfo::RenderPortal(HWPortal *p, bool usestencil) { auto gp = static_cast(p); gp->SetupStencil(this, gl_RenderState, usestencil); diff --git a/src/gl/scene/gl_drawinfo.h b/src/gl/scene/gl_drawinfo.h index 3706e24e60..f3816d3534 100644 --- a/src/gl/scene/gl_drawinfo.h +++ b/src/gl/scene/gl_drawinfo.h @@ -47,7 +47,7 @@ struct FDrawInfo : public HWDrawInfo void DrawIndexed(EDrawType dt, FRenderState &state, int index, int count, bool apply = true) override; void DrawModel(GLSprite *spr, FRenderState &state) override; void DrawHUDModel(HUDSprite *spr, FRenderState &state) override; - void RenderPortal(IPortal *p, bool stencil) override; + void RenderPortal(HWPortal *p, bool stencil) override; void SetDepthMask(bool on) override; void SetDepthFunc(int func) override; diff --git a/src/gl/scene/gl_portal.h b/src/gl/scene/gl_portal.h index e9adb4222c..cc0c4e0b14 100644 --- a/src/gl/scene/gl_portal.h +++ b/src/gl/scene/gl_portal.h @@ -46,7 +46,7 @@ struct GLEEHorizonPortal; -class GLPortal : public IPortal +class GLPortal : public HWPortal { private: @@ -70,7 +70,7 @@ public: protected: int level; - GLPortal(FPortalSceneState *state, bool local = false) : IPortal(state, local) { } + GLPortal(FPortalSceneState *state, bool local = false) : HWPortal(state, local) { } }; class GLScenePortal : public GLPortal diff --git a/src/gl/scene/gl_walls_draw.cpp b/src/gl/scene/gl_walls_draw.cpp index 83d09c6f06..fbb50d4eb6 100644 --- a/src/gl/scene/gl_walls_draw.cpp +++ b/src/gl/scene/gl_walls_draw.cpp @@ -101,7 +101,7 @@ void FDrawInfo::AddMirrorSurface(GLWall *w) void FDrawInfo::AddPortal(GLWall *wall, int ptype) { auto &pstate = GLRenderer->mPortalState; - IPortal * portal; + HWPortal * portal; wall->MakeVertices(this, false); switch (ptype) diff --git a/src/hwrenderer/scene/hw_drawinfo.cpp b/src/hwrenderer/scene/hw_drawinfo.cpp index fe6918f3a9..2b5a1a7a84 100644 --- a/src/hwrenderer/scene/hw_drawinfo.cpp +++ b/src/hwrenderer/scene/hw_drawinfo.cpp @@ -260,7 +260,7 @@ void HWDrawInfo::SetupView(float vx, float vy, float vz, bool mirror, bool plane // //----------------------------------------------------------------------------- -IPortal * HWDrawInfo::FindPortal(const void * src) +HWPortal * HWDrawInfo::FindPortal(const void * src) { int i = Portals.Size() - 1; diff --git a/src/hwrenderer/scene/hw_drawinfo.h b/src/hwrenderer/scene/hw_drawinfo.h index 0cf112c637..b4683a9199 100644 --- a/src/hwrenderer/scene/hw_drawinfo.h +++ b/src/hwrenderer/scene/hw_drawinfo.h @@ -54,7 +54,7 @@ struct particle_t; struct FDynLightData; struct HUDSprite; class Clipper; -class IPortal; +class HWPortal; class FFlatVertexGenerator; class IRenderQueue; class HWScenePortalBase; @@ -149,13 +149,13 @@ struct HWDrawInfo int FullbrightFlags; std::atomic spriteindex; HWScenePortalBase *mClipPortal; - IPortal *mCurrentPortal; + HWPortal *mCurrentPortal; //FRotator mAngles; IShadowMap *mShadowMap; Clipper *mClipper; FRenderViewpoint Viewpoint; HWViewpointUniforms VPUniforms; // per-viewpoint uniform state - TArray Portals; + TArray Portals; TArray Decals[2]; // the second slot is for mirrors which get rendered in a separate pass. TArray hudsprites; // These may just be stored by value. @@ -263,7 +263,7 @@ public: return (screen->hwcaps & RFL_NO_CLIP_PLANES) && VPUniforms.mClipLine.X > -1000000.f; } - IPortal * FindPortal(const void * src); + HWPortal * FindPortal(const void * src); void RenderBSPNode(void *node); void ClearBuffers(); @@ -338,7 +338,7 @@ public: virtual void DrawIndexed(EDrawType dt, FRenderState &state, int index, int count, bool apply = true) = 0; virtual void DrawModel(GLSprite *spr, FRenderState &state) = 0; virtual void DrawHUDModel(HUDSprite *spr, FRenderState &state) = 0; - virtual void RenderPortal(IPortal *p, bool usestencil) = 0; + virtual void RenderPortal(HWPortal *p, bool usestencil) = 0; // Immediate render state change commands. These only change infrequently and should not clutter the render state. diff --git a/src/hwrenderer/scene/hw_portal.cpp b/src/hwrenderer/scene/hw_portal.cpp index 8980588ca2..51641c3fc3 100644 --- a/src/hwrenderer/scene/hw_portal.cpp +++ b/src/hwrenderer/scene/hw_portal.cpp @@ -75,7 +75,7 @@ static FString indent; void FPortalSceneState::EndFrame(HWDrawInfo *di) { - IPortal * p; + HWPortal * p; if (gl_portalinfo) { @@ -115,8 +115,8 @@ void FPortalSceneState::EndFrame(HWDrawInfo *di) //----------------------------------------------------------------------------- bool FPortalSceneState::RenderFirstSkyPortal(int recursion, HWDrawInfo *outer_di) { - IPortal * p; - IPortal * best = nullptr; + HWPortal * p; + HWPortal * best = nullptr; unsigned bestindex = 0; // Find the one with the highest amount of lines. @@ -150,7 +150,7 @@ bool FPortalSceneState::RenderFirstSkyPortal(int recursion, HWDrawInfo *outer_di } -void FPortalSceneState::RenderPortal(IPortal *p, bool usestencil, HWDrawInfo *outer_di) +void FPortalSceneState::RenderPortal(HWPortal *p, bool usestencil, HWDrawInfo *outer_di) { if (gl_portals) outer_di->RenderPortal(p, usestencil); } diff --git a/src/hwrenderer/scene/hw_portal.h b/src/hwrenderer/scene/hw_portal.h index 2d4c492999..49c13104ac 100644 --- a/src/hwrenderer/scene/hw_portal.h +++ b/src/hwrenderer/scene/hw_portal.h @@ -37,15 +37,15 @@ struct GLHorizonInfo struct FPortalSceneState; -class IPortal +class HWPortal { friend struct FPortalSceneState; public: FPortalSceneState * mState; TArray lines; - IPortal(FPortalSceneState *s, bool local); - virtual ~IPortal() {} + HWPortal(FPortalSceneState *s, bool local); + virtual ~HWPortal() {} virtual void * GetSource() const = 0; // GetSource MUST be implemented! virtual const char *GetName() = 0; virtual bool IsSky() { return false; } @@ -92,10 +92,10 @@ struct FPortalSceneState void StartFrame(); bool RenderFirstSkyPortal(int recursion, HWDrawInfo *outer_di); void EndFrame(HWDrawInfo *outer_di); - void RenderPortal(IPortal *p, bool usestencil, HWDrawInfo *outer_di); + void RenderPortal(HWPortal *p, bool usestencil, HWDrawInfo *outer_di); }; -inline IPortal::IPortal(FPortalSceneState *s, bool local) : mState(s) +inline HWPortal::HWPortal(FPortalSceneState *s, bool local) : mState(s) { //if (!local) s->portals.Push(this); } @@ -104,11 +104,11 @@ inline IPortal::IPortal(FPortalSceneState *s, bool local) : mState(s) class HWScenePortalBase { protected: - IPortal *mOwner; + HWPortal *mOwner; public: HWScenePortalBase() {} virtual ~HWScenePortalBase() {} - void SetOwner(IPortal *p) { mOwner = p; } + void SetOwner(HWPortal *p) { mOwner = p; } void ClearClipper(HWDrawInfo *di, Clipper *clipper); virtual int ClipSeg(seg_t *seg, const DVector3 &viewpos) { return PClip_Inside; }