- renamed the functions in hw_fakeflat.cpp

This commit is contained in:
Christoph Oelckers 2018-04-24 17:52:35 +02:00
parent 0dcc6ec6d3
commit 8d62ebd2f4
9 changed files with 31 additions and 39 deletions

View file

@ -223,7 +223,6 @@ public:
static float GetZFar() { return 65536.f; }
};
enum area_t : int;
#include "hwrenderer/scene/hw_fakeflat.h"
struct TexFilter_s

View file

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

View file

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

View file

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

View file

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

View file

@ -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
{

View file

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

View file

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

View file

@ -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;i<CeilingStacks.Size (); i++)
{
sector_t *sec = gl_FakeFlat(CeilingStacks[i], &fakesec, in_area, false);
sector_t *sec = hw_FakeFlat(CeilingStacks[i], &fakesec, in_area, false);
auto portal = sec->GetPortalGroup(sector_t::ceiling);
if (portal != NULL) for(int k=0;k<sec->subsectorcount;k++)
{
@ -1160,7 +1160,7 @@ void HWDrawInfo::ProcessSectorStacks(area_t in_area)
validcount++;
for (i=0;i<FloorStacks.Size (); i++)
{
sector_t *sec = gl_FakeFlat(FloorStacks[i], &fakesec, in_area, false);
sector_t *sec = hw_FakeFlat(FloorStacks[i], &fakesec, in_area, false);
auto portal = sec->GetPortalGroup(sector_t::floor);
if (portal != NULL) for(int k=0;k<sec->subsectorcount;k++)
{