- made CheckViewArea a global function.

This can be put into the common hwrenderer folder but for that it shouldn't be part of the scene drawer.
This commit is contained in:
Christoph Oelckers 2018-04-23 22:10:11 +02:00
parent 2aee68d215
commit 60567f207c
4 changed files with 5 additions and 6 deletions

View file

@ -246,6 +246,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);
struct TexFilter_s
{

View file

@ -146,7 +146,7 @@ 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
CheckViewArea(seg->v1, seg->v2, seg->frontsector, seg->backsector);
in_area = gl_CheckViewArea(in_area, seg->v1, seg->v2, seg->frontsector, seg->backsector);
backsector = gl_FakeFlat(seg->backsector, &bs, in_area, true);

View file

@ -159,7 +159,7 @@ bool gl_CheckClip(side_t * sidedef, sector_t * frontsector, sector_t * backsecto
//
//==========================================================================
void GLSceneDrawer::CheckViewArea(vertex_t *v1, vertex_t *v2, sector_t *frontsector, sector_t *backsector)
area_t gl_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)) &&
@ -174,9 +174,9 @@ void GLSceneDrawer::CheckViewArea(vertex_t *v1, vertex_t *v2, sector_t *frontsec
// allow some tolerance in case slopes are involved
if (cz1 <= fz1 + 1. / 100 && cz2 <= fz2 + 1. / 100)
in_area = area_below;
return area_below;
else
in_area = area_normal;
return area_normal;
}
}

View file

@ -73,8 +73,6 @@ public:
void DrawEndScene2D(sector_t * viewsector);
void RenderActorsInPortal(FLinePortalSpan *glport);
void CheckViewArea(vertex_t *v1, vertex_t *v2, sector_t *frontsector, sector_t *backsector);
sector_t *RenderViewpoint(AActor * camera, GL_IRECT * bounds, float fov, float ratio, float fovratio, bool mainview, bool toscreen);
void RenderView(player_t *player);
void WriteSavePic(player_t *player, FileWriter *file, int width, int height);