mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 13:41:05 +00:00
- cleanup of hw_bsp.cpp.
This commit is contained in:
parent
48bc5550d7
commit
1be1470d47
1 changed files with 20 additions and 46 deletions
|
@ -175,7 +175,7 @@ RenderJobQueue jobQueue;
|
||||||
|
|
||||||
void WorkerThread(HWDrawInfo *di)
|
void WorkerThread(HWDrawInfo *di)
|
||||||
{
|
{
|
||||||
sector_t fakefront, fakeback;
|
sector_t fakefront, fakeback, *front, *back;
|
||||||
|
|
||||||
isWorkerThread = true; // for adding asserts in GL API code. The worker thread may never call any GL API.
|
isWorkerThread = true; // for adding asserts in GL API code. The worker thread may never call any GL API.
|
||||||
while (true)
|
while (true)
|
||||||
|
@ -204,25 +204,37 @@ void WorkerThread(HWDrawInfo *di)
|
||||||
case RenderJob::WallJob:
|
case RenderJob::WallJob:
|
||||||
{
|
{
|
||||||
GLWall wall;
|
GLWall wall;
|
||||||
|
SetupWall.Clock();
|
||||||
wall.sub = job->sub;
|
wall.sub = job->sub;
|
||||||
wall.Process(di, job->seg, job->sub->render_sector, job->seg->PartnerSeg ? job->seg->PartnerSeg->Subsector->render_sector : nullptr);
|
front = hw_FakeFlat(job->sub->render_sector, &fakefront, di->in_area, false);
|
||||||
|
back = job->seg->PartnerSeg ? hw_FakeFlat(job->seg->PartnerSeg->Subsector->render_sector, &fakeback, di->in_area, true) : nullptr;
|
||||||
|
wall.Process(di, job->seg, front, back);
|
||||||
rendered_lines++;
|
rendered_lines++;
|
||||||
|
SetupWall.Unclock();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case RenderJob::FlatJob:
|
case RenderJob::FlatJob:
|
||||||
{
|
{
|
||||||
GLFlat flat;
|
GLFlat flat;
|
||||||
flat.ProcessSector(di, job->sub->render_sector);
|
SetupFlat.Clock();
|
||||||
|
front = hw_FakeFlat(job->sub->render_sector, &fakefront, di->in_area, false);
|
||||||
|
flat.ProcessSector(di, front);
|
||||||
|
SetupFlat.Unclock();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case RenderJob::SpriteJob:
|
case RenderJob::SpriteJob:
|
||||||
di->RenderThings(job->sub, job->sub->render_sector);
|
SetupSprite.Clock();
|
||||||
|
front = hw_FakeFlat(job->sub->render_sector, &fakefront, di->in_area, false);
|
||||||
|
di->RenderThings(job->sub, front);
|
||||||
|
SetupSprite.Unclock();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RenderJob::ParticleJob:
|
case RenderJob::ParticleJob:
|
||||||
{
|
{
|
||||||
|
SetupSprite.Clock();
|
||||||
|
front = hw_FakeFlat(job->sub->render_sector, &fakefront, di->in_area, false);
|
||||||
for (int i = ParticlesInSubsec[job->sub->Index()]; i != NO_PARTICLE; i = Particles[i].snext)
|
for (int i = ParticlesInSubsec[job->sub->Index()]; i != NO_PARTICLE; i = Particles[i].snext)
|
||||||
{
|
{
|
||||||
if (di->mClipPortal)
|
if (di->mClipPortal)
|
||||||
|
@ -232,9 +244,9 @@ void WorkerThread(HWDrawInfo *di)
|
||||||
}
|
}
|
||||||
|
|
||||||
GLSprite sprite;
|
GLSprite sprite;
|
||||||
sprite.ProcessParticle(di, &Particles[i], job->sub->render_sector);
|
sprite.ProcessParticle(di, &Particles[i], front);
|
||||||
}
|
}
|
||||||
|
SetupSprite.Unclock();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -375,17 +387,7 @@ void HWDrawInfo::AddLine (seg_t *seg, bool portalclip)
|
||||||
|
|
||||||
if (gl_render_walls)
|
if (gl_render_walls)
|
||||||
{
|
{
|
||||||
SetupWall.Clock();
|
|
||||||
jobQueue.AddJob(RenderJob::WallJob, seg->Subsector, seg);
|
jobQueue.AddJob(RenderJob::WallJob, seg->Subsector, seg);
|
||||||
|
|
||||||
/*
|
|
||||||
GLWall wall;
|
|
||||||
wall.sub = currentsubsector;
|
|
||||||
wall.Process(this, seg, currentsector, backsector);
|
|
||||||
rendered_lines++;
|
|
||||||
*/
|
|
||||||
|
|
||||||
SetupWall.Unclock();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -616,7 +618,6 @@ void HWDrawInfo::RenderThings(subsector_t * sub, sector_t * sector)
|
||||||
|
|
||||||
void HWDrawInfo::DoSubsector(subsector_t * sub)
|
void HWDrawInfo::DoSubsector(subsector_t * sub)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
|
||||||
sector_t * sector;
|
sector_t * sector;
|
||||||
sector_t * fakesector;
|
sector_t * fakesector;
|
||||||
sector_t fake;
|
sector_t fake;
|
||||||
|
@ -669,29 +670,11 @@ void HWDrawInfo::DoSubsector(subsector_t * sub)
|
||||||
|
|
||||||
// [RH] Add particles
|
// [RH] Add particles
|
||||||
//int shade = LIGHT2SHADE((floorlightlevel + ceilinglightlevel)/2 + r_actualextralight);
|
//int shade = LIGHT2SHADE((floorlightlevel + ceilinglightlevel)/2 + r_actualextralight);
|
||||||
#if 0
|
|
||||||
if (gl_render_things && ParticlesInSubsec[sub->Index()] != NO_PARTICLE)
|
if (gl_render_things && ParticlesInSubsec[sub->Index()] != NO_PARTICLE)
|
||||||
{
|
{
|
||||||
SetupSprite.Clock();
|
|
||||||
jobQueue.AddJob(RenderJob::ParticleJob, sub, nullptr);
|
jobQueue.AddJob(RenderJob::ParticleJob, sub, nullptr);
|
||||||
|
|
||||||
/*
|
|
||||||
for (i = ParticlesInSubsec[sub->Index()]; i != NO_PARTICLE; i = Particles[i].snext)
|
|
||||||
{
|
|
||||||
if (mClipPortal)
|
|
||||||
{
|
|
||||||
int clipres = mClipPortal->ClipPoint(Particles[i].Pos);
|
|
||||||
if (clipres == PClip_InFront) continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GLSprite sprite;
|
|
||||||
sprite.ProcessParticle(this, &Particles[i], fakesector);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
SetupSprite.Unclock();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
AddLines(sub, fakesector);
|
AddLines(sub, fakesector);
|
||||||
|
|
||||||
// BSP is traversed by subsector.
|
// BSP is traversed by subsector.
|
||||||
|
@ -702,15 +685,12 @@ void HWDrawInfo::DoSubsector(subsector_t * sub)
|
||||||
{
|
{
|
||||||
// Well, now it will be done.
|
// Well, now it will be done.
|
||||||
sector->validcount = validcount;
|
sector->validcount = validcount;
|
||||||
|
sector->MoreFlags |= SECMF_DRAWN;
|
||||||
|
|
||||||
if (gl_render_things)
|
if (gl_render_things)
|
||||||
{
|
{
|
||||||
SetupSprite.Clock();
|
|
||||||
jobQueue.AddJob(RenderJob::SpriteJob, sub, nullptr);
|
jobQueue.AddJob(RenderJob::SpriteJob, sub, nullptr);
|
||||||
//RenderThings(sub, fakesector);
|
|
||||||
SetupSprite.Unclock();
|
|
||||||
}
|
}
|
||||||
sector->MoreFlags |= SECMF_DRAWN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gl_render_flats)
|
if (gl_render_flats)
|
||||||
|
@ -737,13 +717,7 @@ void HWDrawInfo::DoSubsector(subsector_t * sub)
|
||||||
{
|
{
|
||||||
srf |= SSRF_PROCESSED;
|
srf |= SSRF_PROCESSED;
|
||||||
|
|
||||||
SetupFlat.Clock();
|
|
||||||
jobQueue.AddJob(RenderJob::FlatJob, sub);
|
jobQueue.AddJob(RenderJob::FlatJob, sub);
|
||||||
/*
|
|
||||||
GLFlat flat;
|
|
||||||
flat.ProcessSector(this, fakesector);
|
|
||||||
*/
|
|
||||||
SetupFlat.Unclock();
|
|
||||||
}
|
}
|
||||||
// mark subsector as processed - but mark for rendering only if it has an actual area.
|
// mark subsector as processed - but mark for rendering only if it has an actual area.
|
||||||
ss_renderflags[sub->Index()] =
|
ss_renderflags[sub->Index()] =
|
||||||
|
|
Loading…
Reference in a new issue