From 8d62ebd2f4ac06a0c19615a18677645ccee62747 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 24 Apr 2018 17:52:35 +0200 Subject: [PATCH] - renamed the functions in hw_fakeflat.cpp --- src/gl/renderer/gl_renderer.h | 1 - src/gl/scene/gl_bsp.cpp | 10 +++++----- src/gl/scene/gl_drawinfo.cpp | 8 ++++---- src/gl/scene/gl_sprite.cpp | 4 ++-- src/gl/scene/gl_weapon.cpp | 2 +- src/hwrenderer/scene/hw_drawinfo.h | 8 +------- src/hwrenderer/scene/hw_fakeflat.cpp | 7 +++---- src/hwrenderer/scene/hw_fakeflat.h | 8 ++++---- src/hwrenderer/scene/hw_renderhacks.cpp | 22 +++++++++++----------- 9 files changed, 31 insertions(+), 39 deletions(-) diff --git a/src/gl/renderer/gl_renderer.h b/src/gl/renderer/gl_renderer.h index f94c14195..571793253 100644 --- a/src/gl/renderer/gl_renderer.h +++ b/src/gl/renderer/gl_renderer.h @@ -223,7 +223,6 @@ public: static float GetZFar() { return 65536.f; } }; -enum area_t : int; #include "hwrenderer/scene/hw_fakeflat.h" struct TexFilter_s diff --git a/src/gl/scene/gl_bsp.cpp b/src/gl/scene/gl_bsp.cpp index a6101fad6..41f8fd7ae 100644 --- a/src/gl/scene/gl_bsp.cpp +++ b/src/gl/scene/gl_bsp.cpp @@ -140,11 +140,11 @@ void GLSceneDrawer::AddLine (seg_t *seg, bool portalclip) else { // clipping checks are only needed when the backsector is not the same as the front sector - in_area = gl_CheckViewArea(in_area, seg->v1, seg->v2, seg->frontsector, seg->backsector); + in_area = hw_CheckViewArea(in_area, seg->v1, seg->v2, seg->frontsector, seg->backsector); - backsector = gl_FakeFlat(seg->backsector, &bs, in_area, true); + backsector = hw_FakeFlat(seg->backsector, &bs, in_area, true); - if (gl_CheckClip(seg->sidedef, currentsector, backsector)) + if (hw_CheckClip(seg->sidedef, currentsector, backsector)) { clipper.SafeAddClipRange(startAngle, endAngle); } @@ -428,7 +428,7 @@ void GLSceneDrawer::DoSubsector(subsector_t * sub) } if (clipper.IsBlocked()) return; // if we are inside a stacked sector portal which hasn't unclipped anything yet. - fakesector=gl_FakeFlat(sector, &fake, in_area, false); + fakesector=hw_FakeFlat(sector, &fake, in_area, false); if (GLRenderer->mClipPortal) { @@ -495,7 +495,7 @@ void GLSceneDrawer::DoSubsector(subsector_t * sub) sector = sub->render_sector; // the planes of this subsector are faked to belong to another sector // This means we need the heightsec parts and light info of the render sector, not the actual one. - fakesector = gl_FakeFlat(sector, &fake, in_area, false); + fakesector = hw_FakeFlat(sector, &fake, in_area, false); } uint8_t &srf = gl_drawinfo->sectorrenderflags[sub->render_sector->sectornum]; diff --git a/src/gl/scene/gl_drawinfo.cpp b/src/gl/scene/gl_drawinfo.cpp index 7f512ad94..a67e9d12b 100644 --- a/src/gl/scene/gl_drawinfo.cpp +++ b/src/gl/scene/gl_drawinfo.cpp @@ -1206,8 +1206,8 @@ void FDrawInfo::FloodUpperGap(seg_t * seg) { wallseg ws; sector_t ffake, bfake; - sector_t * fakefsector = gl_FakeFlat(seg->frontsector, &ffake, mDrawer->in_area, true); - sector_t * fakebsector = gl_FakeFlat(seg->backsector, &bfake, mDrawer->in_area, false); + sector_t * fakefsector = hw_FakeFlat(seg->frontsector, &ffake, mDrawer->in_area, true); + sector_t * fakebsector = hw_FakeFlat(seg->backsector, &bfake, mDrawer->in_area, false); vertex_t * v1, * v2; @@ -1258,8 +1258,8 @@ void FDrawInfo::FloodLowerGap(seg_t * seg) { wallseg ws; sector_t ffake, bfake; - sector_t * fakefsector = gl_FakeFlat(seg->frontsector, &ffake, mDrawer->in_area, true); - sector_t * fakebsector = gl_FakeFlat(seg->backsector, &bfake, mDrawer->in_area, false); + sector_t * fakefsector = hw_FakeFlat(seg->frontsector, &ffake, mDrawer->in_area, true); + sector_t * fakebsector = hw_FakeFlat(seg->backsector, &bfake, mDrawer->in_area, false); vertex_t * v1, * v2; diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index a73b59f9f..ee677582b 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -780,7 +780,7 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal) if (sector->sectornum != thing->Sector->sectornum && !thruportal) { - rendersector = gl_FakeFlat(thing->Sector, &rs, mDrawer->in_area, false); + rendersector = hw_FakeFlat(thing->Sector, &rs, mDrawer->in_area, false); } else { @@ -1320,7 +1320,7 @@ void GLSceneDrawer::RenderActorsInPortal(FLinePortalSpan *glport) th->Prev += newpos - savedpos; GLSprite spr(this); - spr.Process(th, gl_FakeFlat(th->Sector, &fakesector, in_area, false), 2); + spr.Process(th, hw_FakeFlat(th->Sector, &fakesector, in_area, false), 2); th->Angles.Yaw = savedangle; th->SetXYZ(savedpos); th->Prev -= newpos - savedpos; diff --git a/src/gl/scene/gl_weapon.cpp b/src/gl/scene/gl_weapon.cpp index 673e1fce1..a4d99e41e 100644 --- a/src/gl/scene/gl_weapon.cpp +++ b/src/gl/scene/gl_weapon.cpp @@ -272,7 +272,7 @@ void GLSceneDrawer::DrawPlayerSprites(sector_t * viewsector, bool hudModelStep) } else { - fakesec = gl_FakeFlat(viewsector, &fs, in_area, false); + fakesec = hw_FakeFlat(viewsector, &fs, in_area, false); // calculate light level for weapon sprites lightlevel = gl_ClampLight(fakesec->lightlevel); diff --git a/src/hwrenderer/scene/hw_drawinfo.h b/src/hwrenderer/scene/hw_drawinfo.h index 2bf3c0639..cd4f201d9 100644 --- a/src/hwrenderer/scene/hw_drawinfo.h +++ b/src/hwrenderer/scene/hw_drawinfo.h @@ -15,13 +15,7 @@ struct gl_subsectorrendernode subsector_t * sub; }; -enum area_t : int -{ - area_normal, - area_below, - area_above, - area_default -}; +enum area_t : int; enum SectorRenderFlags { diff --git a/src/hwrenderer/scene/hw_fakeflat.cpp b/src/hwrenderer/scene/hw_fakeflat.cpp index 1c8c302bd..c2695a7bc 100644 --- a/src/hwrenderer/scene/hw_fakeflat.cpp +++ b/src/hwrenderer/scene/hw_fakeflat.cpp @@ -38,9 +38,8 @@ // Check whether the player can look beyond this line // //========================================================================== -CVAR(Bool, gltest_slopeopt, false, 0) -bool gl_CheckClip(side_t * sidedef, sector_t * frontsector, sector_t * backsector) +bool hw_CheckClip(side_t * sidedef, sector_t * frontsector, sector_t * backsector) { line_t *linedef = sidedef->linedef; double bs_floorheight1; @@ -158,7 +157,7 @@ bool gl_CheckClip(side_t * sidedef, sector_t * frontsector, sector_t * backsecto // //========================================================================== -area_t gl_CheckViewArea(area_t in_area, vertex_t *v1, vertex_t *v2, sector_t *frontsector, sector_t *backsector) +area_t hw_CheckViewArea(area_t in_area, vertex_t *v1, vertex_t *v2, sector_t *frontsector, sector_t *backsector) { if (in_area == area_default && (backsector->heightsec && !(backsector->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC)) && @@ -186,7 +185,7 @@ area_t gl_CheckViewArea(area_t in_area, vertex_t *v1, vertex_t *v2, sector_t *fr // by hardware rendering // //========================================================================== -sector_t * gl_FakeFlat(sector_t * sec, sector_t * dest, area_t in_area, bool back) +sector_t * hw_FakeFlat(sector_t * sec, sector_t * dest, area_t in_area, bool back) { if (!sec->heightsec || sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC || sec->heightsec==sec) { diff --git a/src/hwrenderer/scene/hw_fakeflat.h b/src/hwrenderer/scene/hw_fakeflat.h index a33e00549..e402627ad 100644 --- a/src/hwrenderer/scene/hw_fakeflat.h +++ b/src/hwrenderer/scene/hw_fakeflat.h @@ -1,6 +1,6 @@ #pragma once -enum area_t +enum area_t : int { area_normal, area_below, @@ -10,7 +10,7 @@ enum area_t // Global functions. Make them members of GLRenderer later? -bool gl_CheckClip(side_t * sidedef, sector_t * frontsector, sector_t * backsector); -sector_t * gl_FakeFlat(sector_t * sec, sector_t * dest, area_t in_area, bool back); -area_t gl_CheckViewArea(area_t in_area, vertex_t *v1, vertex_t *v2, sector_t *frontsector, sector_t *backsector); +bool hw_CheckClip(side_t * sidedef, sector_t * frontsector, sector_t * backsector); +sector_t * hw_FakeFlat(sector_t * sec, sector_t * dest, area_t in_area, bool back); +area_t hw_CheckViewArea(area_t in_area, vertex_t *v1, vertex_t *v2, sector_t *frontsector, sector_t *backsector); diff --git a/src/hwrenderer/scene/hw_renderhacks.cpp b/src/hwrenderer/scene/hw_renderhacks.cpp index 6a1b5ceea..442327e4c 100644 --- a/src/hwrenderer/scene/hw_renderhacks.cpp +++ b/src/hwrenderer/scene/hw_renderhacks.cpp @@ -33,7 +33,7 @@ #include "hwrenderer/scene/hw_drawinfo.h" #include "gl/utility/gl_clock.h" -sector_t * gl_FakeFlat(sector_t * sec, sector_t * dest, area_t in_area, bool back); +sector_t * hw_FakeFlat(sector_t * sec, sector_t * dest, area_t in_area, bool back); // This is for debugging maps. @@ -280,7 +280,7 @@ bool HWDrawInfo::DoOneSectorUpper(subsector_t * subsec, float Planez, area_t in_ // Note: if this is a real line between sectors // we can be sure that render_sector is the real sector! - sector_t * sec = gl_FakeFlat(seg->backsector, &fakesec, in_area, true); + sector_t * sec = hw_FakeFlat(seg->backsector, &fakesec, in_area, true); // Don't bother with slopes if (sec->ceilingplane.isSlope()) return false; @@ -338,7 +338,7 @@ bool HWDrawInfo::DoOneSectorLower(subsector_t * subsec, float Planez, area_t in_ // Note: if this is a real line between sectors // we can be sure that render_sector is the real sector! - sector_t * sec = gl_FakeFlat(seg->backsector, &fakesec, in_area, true); + sector_t * sec = hw_FakeFlat(seg->backsector, &fakesec, in_area, true); // Don't bother with slopes if (sec->floorplane.isSlope()) return false; @@ -397,7 +397,7 @@ bool HWDrawInfo::DoFakeBridge(subsector_t * subsec, float Planez, area_t in_area // Note: if this is a real line between sectors // we can be sure that render_sector is the real sector! - sector_t * sec = gl_FakeFlat(seg->backsector, &fakesec, in_area, true); + sector_t * sec = hw_FakeFlat(seg->backsector, &fakesec, in_area, true); // Don't bother with slopes if (sec->floorplane.isSlope()) return false; @@ -450,7 +450,7 @@ bool HWDrawInfo::DoFakeCeilingBridge(subsector_t * subsec, float Planez, area_t // Note: if this is a real line between sectors // we can be sure that render_sector is the real sector! - sector_t * sec = gl_FakeFlat(seg->backsector, &fakesec, in_area, true); + sector_t * sec = hw_FakeFlat(seg->backsector, &fakesec, in_area, true); // Don't bother with slopes if (sec->ceilingplane.isSlope()) return false; @@ -539,7 +539,7 @@ void HWDrawInfo::HandleMissingTextures(area_t in_area) { // It isn't a hole. Now check whether it might be a fake bridge - sector_t * fakesector = gl_FakeFlat(MissingUpperTextures[i].seg->frontsector, &fake, in_area, false); + sector_t * fakesector = hw_FakeFlat(MissingUpperTextures[i].seg->frontsector, &fake, in_area, false); float planez = (float)fakesector->GetPlaneTexZ(sector_t::ceiling); backsub->validcount = validcount; @@ -610,7 +610,7 @@ void HWDrawInfo::HandleMissingTextures(area_t in_area) { // It isn't a hole. Now check whether it might be a fake bridge - sector_t * fakesector = gl_FakeFlat(MissingLowerTextures[i].seg->frontsector, &fake, in_area, false); + sector_t * fakesector = hw_FakeFlat(MissingLowerTextures[i].seg->frontsector, &fake, in_area, false); float planez = (float)fakesector->GetPlaneTexZ(sector_t::floor); backsub->validcount = validcount; @@ -1033,7 +1033,7 @@ void HWDrawInfo::CollectSectorStacksCeiling(subsector_t * sub, sector_t * anchor if (sub->numlines>2 && !(ss_renderflags[sub->Index()]&SSRF_PROCESSED)) return; // Must be the exact same visplane - sector_t * me = gl_FakeFlat(sub->render_sector, &fakesec, in_area, false); + sector_t * me = hw_FakeFlat(sub->render_sector, &fakesec, in_area, false); if (me->GetTexture(sector_t::ceiling) != anchor->GetTexture(sector_t::ceiling) || me->ceilingplane != anchor->ceilingplane || me->GetCeilingLight() != anchor->GetCeilingLight() || @@ -1077,7 +1077,7 @@ void HWDrawInfo::CollectSectorStacksFloor(subsector_t * sub, sector_t * anchor, if (sub->numlines>2 && !(ss_renderflags[sub->Index()]&SSRF_PROCESSED)) return; // Must be the exact same visplane - sector_t * me = gl_FakeFlat(sub->render_sector, &fakesec, in_area, false); + sector_t * me = hw_FakeFlat(sub->render_sector, &fakesec, in_area, false); if (me->GetTexture(sector_t::floor) != anchor->GetTexture(sector_t::floor) || me->floorplane != anchor->floorplane || me->GetFloorLight() != anchor->GetFloorLight() || @@ -1116,7 +1116,7 @@ void HWDrawInfo::ProcessSectorStacks(area_t in_area) validcount++; for (i=0;iGetPortalGroup(sector_t::ceiling); if (portal != NULL) for(int k=0;ksubsectorcount;k++) { @@ -1160,7 +1160,7 @@ void HWDrawInfo::ProcessSectorStacks(area_t in_area) validcount++; for (i=0;iGetPortalGroup(sector_t::floor); if (portal != NULL) for(int k=0;ksubsectorcount;k++) {