From efe0d57fca267a155512c1c2b625ba370b3a986f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 27 Mar 2021 13:26:11 +0100 Subject: [PATCH] - removed all the decal stubs. Build has wall sprite for decals so this is redundant and ultimately not usable. --- source/core/rendering/scene/hw_drawinfo.cpp | 18 --------- source/core/rendering/scene/hw_drawinfo.h | 5 --- .../core/rendering/scene/hw_drawlistadd.cpp | 11 +----- source/core/rendering/scene/hw_drawstructs.h | 37 ------------------- source/core/rendering/scene/hw_walls.cpp | 16 -------- 5 files changed, 1 insertion(+), 86 deletions(-) diff --git a/source/core/rendering/scene/hw_drawinfo.cpp b/source/core/rendering/scene/hw_drawinfo.cpp index 233e82845..48119969c 100644 --- a/source/core/rendering/scene/hw_drawinfo.cpp +++ b/source/core/rendering/scene/hw_drawinfo.cpp @@ -188,8 +188,6 @@ HWDrawInfo *HWDrawInfo::EndDrawInfo() void HWDrawInfo::ClearBuffers() { spriteindex = 0; - Decals[0].Clear(); - Decals[1].Clear(); mClipPortal = nullptr; mCurrentPortal = nullptr; } @@ -272,17 +270,6 @@ HWPortal * HWDrawInfo::FindPortal(const void * src) // //----------------------------------------------------------------------------- -HWDecal* HWDrawInfo::AddDecal(bool onmirror) -{ -#if 0 - auto decal = (HWDecal*)RenderDataAllocator.Alloc(sizeof(HWDecal)); - Decals[onmirror ? 1 : 0].Push(decal); - return decal; -#else - return nullptr; -#endif -} - void HWDrawInfo::DispatchSprites() { for (int i = 0; i < spritesortcnt; i++) @@ -482,12 +469,7 @@ void HWDrawInfo::RenderScene(FRenderState &state) state.SetRenderStyle(STYLE_Translucent); - // Part 4: Draw decals (not a real pass) state.SetDepthFunc(DF_LEqual); -#if 0 - DrawDecals(state, Decals[0]); -#endif - RenderAll.Unclock(); } diff --git a/source/core/rendering/scene/hw_drawinfo.h b/source/core/rendering/scene/hw_drawinfo.h index ea52a6857..f6376f5d0 100644 --- a/source/core/rendering/scene/hw_drawinfo.h +++ b/source/core/rendering/scene/hw_drawinfo.h @@ -23,7 +23,6 @@ struct FFlatVertex; class HWWall; class HWFlat; class HWSprite; -struct HWDecal; class IShadowMap; struct FDynLightData; class Clipper; @@ -107,7 +106,6 @@ struct HWDrawInfo FRenderViewpoint Viewpoint; HWViewpointUniforms VPUniforms; // per-viewpoint uniform state TArray Portals; - TArray Decals[2]; // the second slot is for mirrors which get rendered in a separate pass. // This is needed by the BSP traverser. bool multithread; @@ -171,7 +169,6 @@ public: void SetupView(FRenderState &state, float vx, float vy, float vz, bool mirror, bool planemirror); angle_t FrustumAngle(); - void DrawDecals(FRenderState &state, TArray &decals); void DrawPlayerSprites(bool hudModelStep, FRenderState &state); //void AddSubsectorToPortal(FSectorPortalGroup *portal, sectortype *sub); @@ -182,8 +179,6 @@ public: void AddSprite(HWSprite *sprite, bool translucent); - HWDecal *AddDecal(bool onmirror); - bool isSoftwareLighting() const { return true;// lightmode == ELightMode::ZDoomSoftware || lightmode == ELightMode::DoomSoftware || lightmode == ELightMode::Build; diff --git a/source/core/rendering/scene/hw_drawlistadd.cpp b/source/core/rendering/scene/hw_drawlistadd.cpp index 6be42533d..e70e0e04d 100644 --- a/source/core/rendering/scene/hw_drawlistadd.cpp +++ b/source/core/rendering/scene/hw_drawlistadd.cpp @@ -80,16 +80,7 @@ void HWDrawInfo::AddMirrorSurface(HWWall *w) tcs[HWWall::LOLFT].u = tcs[HWWall::LORGT].u = tcs[HWWall::UPLFT].u = tcs[HWWall::UPRGT].u = v.X; tcs[HWWall::LOLFT].v = tcs[HWWall::LORGT].v = tcs[HWWall::UPLFT].v = tcs[HWWall::UPRGT].v = v.Z; newwall->MakeVertices(this, false); - -#if 0 - bool hasDecals = newwall->seg->sidedef && newwall->seg->sidedef->AttachedDecals; - if (hasDecals && Level->HasDynamicLights && !isFullbrightScene()) - { - newwall->SetupLights(this, lightdata); - } - newwall->ProcessDecals(this); -#endif - newwall->dynlightindex = -1; // the environment map should not be affected by lights - only the decals. + newwall->dynlightindex = -1; // the environment map should not be affected by lights. } //========================================================================== diff --git a/source/core/rendering/scene/hw_drawstructs.h b/source/core/rendering/scene/hw_drawstructs.h index 530c6cfea..4af22c671 100644 --- a/source/core/rendering/scene/hw_drawstructs.h +++ b/source/core/rendering/scene/hw_drawstructs.h @@ -25,7 +25,6 @@ struct FDynLightData; class VSMatrix; struct FSpriteModelFrame; class FRenderState; -struct HWDecal; struct HWSectorPlane { @@ -215,9 +214,6 @@ public: float fch1, float fch2, float ffh1, float ffh2, float bch1, float bch2, float bfh1, float bfh2); - //void ProcessDecal(HWDrawInfo *di, DBaseDecal *decal, const FVector3 &normal); - //void ProcessDecals(HWDrawInfo *di); - int CreateVertices(FFlatVertex *&ptr, bool nosplit); //int CountVertices(); @@ -339,44 +335,11 @@ public: - -struct DecalVertex -{ - float x, y, z; - float u, v; -}; - -/* -struct HWDecal -{ - FGameTexture *texture; - TArray *lightlist; - DBaseDecal *decal; - DecalVertex dv[4]; - float zcenter; - unsigned int vertindex; - - FRenderStyle renderstyle; - int lightlevel; - int rellight; - float alpha; - FColormap Colormap; - int dynlightindex; - sectortype *frontsector; - FVector3 Normal; - - void DrawDecal(HWDrawInfo *di, FRenderState &state); - -}; -*/ - - inline float Dist2(float x1,float y1,float x2,float y2) { return sqrtf((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); } -bool hw_SetPlaneTextureRotation(const HWSectorPlane * secplane, FGameTexture * gltexture, VSMatrix &mat); void hw_GetDynModelLight(AActor *self, FDynLightData &modellightdata); extern const float LARGE_VALUE; diff --git a/source/core/rendering/scene/hw_walls.cpp b/source/core/rendering/scene/hw_walls.cpp index cdd942b0f..88b04f5e1 100644 --- a/source/core/rendering/scene/hw_walls.cpp +++ b/source/core/rendering/scene/hw_walls.cpp @@ -406,22 +406,6 @@ void HWWall::PutWall(HWDrawInfo *di, bool translucent) MakeVertices(di, translucent); } - /* - bool hasDecals = type != RENDERWALL_M2S && seg->sidedef->AttachedDecals; - if (hasDecals) - { - // If we want to use the light infos for the decal we cannot delay the creation until the render pass. - if (screen->BuffersArePersistent()) - { - if (di->Level->HasDynamicLights && !di->isFullbrightScene() && texture != nullptr) - { - SetupLights(di, lightdata); - } - } - ProcessDecals(di); - } - */ - di->AddWall(this); // make sure that following parts of the same linedef do not get this one's vertex and lighting info. vertcount = 0;