- moved global variable definitions to the top of a few files.

Most of these are not critical because they only get used in non-multithreaded contexts but it's definitely easier to look them up this way.
This commit is contained in:
Christoph Oelckers 2018-04-02 23:42:45 +02:00
parent 821c2ec4c7
commit 2f96d3c61a
5 changed files with 24 additions and 18 deletions

View file

@ -48,6 +48,7 @@
#include "gl/renderer/gl_quaddrawer.h"
FDrawInfo * gl_drawinfo;
FDrawInfoList di_list;
//==========================================================================
//
@ -987,8 +988,6 @@ void FDrawInfoList::Release(FDrawInfo * di)
mList.Push(di);
}
static FDrawInfoList di_list;
//==========================================================================
//
//

View file

@ -87,6 +87,8 @@ UniqueList<GLHorizonInfo> UniqueHorizons;
UniqueList<secplane_t> UniquePlaneMirrors;
UniqueList<FLinePortalSpan> UniqueLineToLines;
int skyboxrecursion = 0;
//==========================================================================
//
//
@ -460,7 +462,7 @@ void GLPortal::StartFrame()
//-----------------------------------------------------------------------------
//
// Portal info
// printing portal info
//
//-----------------------------------------------------------------------------
@ -471,7 +473,7 @@ CCMD(gl_portalinfo)
gl_portalinfo = true;
}
FString indent;
static FString indent;
//-----------------------------------------------------------------------------
//
@ -610,7 +612,7 @@ void GLPortal::RestoreMapSection()
// GLSkyboxPortal::DrawContents
//
//-----------------------------------------------------------------------------
static int skyboxrecursion=0;
void GLSkyboxPortal::DrawContents()
{
int old_pm = PlaneMirrorMode;

View file

@ -44,9 +44,16 @@
// profiling data
static int totalupper, totallower;
static int lowershcount, uppershcount;
static glcycle_t totalms, showtotalms;
static glcycle_t totalssms;
static sector_t fakesec;
static glcycle_t totalms, showtotalms, totalssms;
static sector_t fakesec; // this is static because it gets used in recursively called functions.
// Having this static doesn't really matter here because the hack code is not multithreading-capable anyway.
static bool inview;
static subsector_t * viewsubsector;
static TArray<seg_t *> lowersegs;
void FDrawInfo::ClearBuffers()
{
@ -760,9 +767,6 @@ bool FDrawInfo::CheckAnchorFloor(subsector_t * sub)
// Collect connected subsectors that have to be rendered with the same plane
//
//==========================================================================
static bool inview;
static subsector_t * viewsubsector;
static TArray<seg_t *> lowersegs;
bool FDrawInfo::CollectSubsectorsFloor(subsector_t * sub, sector_t * anchor)
{
@ -1117,12 +1121,11 @@ void FDrawInfo::CollectSectorStacksFloor(subsector_t * sub, sector_t * anchor)
void FDrawInfo::ProcessSectorStacks()
{
unsigned int i;
sector_t fake;
validcount++;
for (i=0;i<CeilingStacks.Size (); i++)
{
sector_t *sec = gl_FakeFlat(CeilingStacks[i], &fake, mDrawer->in_area, false);
sector_t *sec = gl_FakeFlat(CeilingStacks[i], &fakesec, mDrawer->in_area, false);
auto portal = sec->GetPortalGroup(sector_t::ceiling);
if (portal != NULL) for(int k=0;k<sec->subsectorcount;k++)
{
@ -1166,7 +1169,7 @@ void FDrawInfo::ProcessSectorStacks()
validcount++;
for (i=0;i<FloorStacks.Size (); i++)
{
sector_t *sec = gl_FakeFlat(FloorStacks[i], &fake, mDrawer->in_area, false);
sector_t *sec = gl_FakeFlat(FloorStacks[i], &fakesec, mDrawer->in_area, false);
auto portal = sec->GetPortalGroup(sector_t::floor);
if (portal != NULL) for(int k=0;k<sec->subsectorcount;k++)
{

View file

@ -86,8 +86,7 @@ EXTERN_CVAR (Bool, r_drawvoxels)
extern bool NoInterpolateView;
area_t in_area;
int camtexcount;
int camtexcount; // used to decide how VSync is done. It just counts the number of camera textures per frame.
//-----------------------------------------------------------------------------
//
@ -273,7 +272,9 @@ void GLSceneDrawer::CreateScene()
if (GLRenderer->mCurrentPortal != NULL) GLRenderer->mCurrentPortal->RenderAttached();
Bsp.Unclock();
// And now the crappy hacks that have to be done to avoid rendering anomalies:
// And now the crappy hacks that have to be done to avoid rendering anomalies.
// These cannot be multithreaded when the time comes because all these depend
// on the global 'validcount' variable.
gl_drawinfo->HandleMissingTextures(); // Missing upper/lower textures
gl_drawinfo->HandleHackedSubsectors(); // open sector hacks for deep water

View file

@ -56,6 +56,7 @@ public:
int FixedColormap;
area_t in_area;
BitArray CurrentMapSections; // this cannot be a single number, because a group of portals with the same displacement may link different sections.
FDrawInfo * gl_drawinfo;
angle_t FrustumAngle();
void SetViewMatrix(float vx, float vy, float vz, bool mirror, bool planemirror);