mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 15:22:15 +00:00
- render sproites through sector portals.
This commit is contained in:
parent
741f054601
commit
573d80f144
5 changed files with 35 additions and 17 deletions
|
@ -170,10 +170,10 @@ void FGLRenderer::ProcessLowerMiniseg(seg_t *seg, sector_t * frontsector, sector
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void FGLRenderer::ProcessSprite(AActor *thing, sector_t *sector)
|
||||
void FGLRenderer::ProcessSprite(AActor *thing, sector_t *sector, bool thruportal)
|
||||
{
|
||||
GLSprite glsprite;
|
||||
glsprite.Process(thing, sector);
|
||||
glsprite.Process(thing, sector, thruportal);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
|
@ -118,7 +118,7 @@ public:
|
|||
void Clear(int left, int top, int right, int bottom, int palcolor, uint32 color);
|
||||
|
||||
void ProcessLowerMiniseg(seg_t *seg, sector_t * frontsector, sector_t * backsector);
|
||||
void ProcessSprite(AActor *thing, sector_t *sector);
|
||||
void ProcessSprite(AActor *thing, sector_t *sector, bool thruportal);
|
||||
void ProcessParticle(particle_t *part, sector_t *sector);
|
||||
void ProcessSector(sector_t *fakesector);
|
||||
void FlushTextures();
|
||||
|
|
|
@ -368,24 +368,37 @@ static inline void RenderThings(subsector_t * sub, sector_t * sector)
|
|||
|
||||
SetupSprite.Clock();
|
||||
sector_t * sec=sub->sector;
|
||||
if (sec->thinglist != NULL)
|
||||
// Handle all things in sector.
|
||||
for (AActor * thing = sec->thinglist; thing; thing = thing->snext)
|
||||
{
|
||||
// Handle all things in sector.
|
||||
for (AActor * thing = sec->thinglist; thing; thing = thing->snext)
|
||||
FIntCVar *cvar = thing->GetClass()->distancecheck;
|
||||
if (cvar != NULL && *cvar >= 0)
|
||||
{
|
||||
FIntCVar *cvar = thing->GetClass()->distancecheck;
|
||||
if (cvar != NULL && *cvar >= 0)
|
||||
double dist = (thing->Pos() - ViewPos).LengthSquared();
|
||||
double check = (double)**cvar;
|
||||
if (dist >= check * check)
|
||||
{
|
||||
double dist = (thing->Pos() - ViewPos).LengthSquared();
|
||||
double check = (double)**cvar;
|
||||
if (dist >= check * check)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
GLRenderer->ProcessSprite(thing, sector);
|
||||
}
|
||||
|
||||
GLRenderer->ProcessSprite(thing, sector, false);
|
||||
}
|
||||
for (msecnode_t *node = sec->render_thinglist; node; node = node->m_snext)
|
||||
{
|
||||
AActor *thing = node->m_thing;
|
||||
FIntCVar *cvar = thing->GetClass()->distancecheck;
|
||||
if (cvar != NULL && *cvar >= 0)
|
||||
{
|
||||
double dist = (thing->Pos() - ViewPos).LengthSquared();
|
||||
double check = (double)**cvar;
|
||||
if (dist >= check * check)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
GLRenderer->ProcessSprite(thing, sector, true);
|
||||
}
|
||||
SetupSprite.Unclock();
|
||||
}
|
||||
|
|
|
@ -504,10 +504,11 @@ void GLSprite::Process(AActor* thing, sector_t * sector, bool thruportal)
|
|||
}
|
||||
|
||||
// If this thing is in a map section that's not in view it can't possibly be visible
|
||||
if (!(currentmapsection[thing->subsector->mapsection >> 3] & (1 << (thing->subsector->mapsection & 7)))) return;
|
||||
if (!thruportal && !(currentmapsection[thing->subsector->mapsection >> 3] & (1 << (thing->subsector->mapsection & 7)))) return;
|
||||
|
||||
// [RH] Interpolate the sprite's position to make it look smooth
|
||||
DVector3 thingpos = thing->InterpolatedPosition(r_TicFracF);
|
||||
if (thruportal) thingpos += Displacements.getOffset(thing->Sector->PortalGroup, sector->PortalGroup);
|
||||
|
||||
// Too close to the camera. This doesn't look good if it is a sprite.
|
||||
if (fabs(thingpos.X - ViewPos.X) < 2 && fabs(thingpos.Y - ViewPos.Y) < 2)
|
||||
|
|
|
@ -308,6 +308,7 @@ void FTraceInfo::Setup3DFloors()
|
|||
{
|
||||
Results->Crossed3DWater = rover;
|
||||
Results->Crossed3DWaterPos = Results->HitPos;
|
||||
Results->Distance = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -444,6 +445,7 @@ bool FTraceInfo::LineCheck(intercept_t *in, double dist, DVector3 hit)
|
|||
{
|
||||
Results->CrossedWater = §ors[CurSector->sectornum];
|
||||
Results->CrossedWaterPos = Results->HitPos;
|
||||
Results->Distance = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -747,6 +749,7 @@ bool FTraceInfo::TraceTraverse (int ptflags)
|
|||
{
|
||||
Results->Crossed3DWater = rover;
|
||||
Results->Crossed3DWaterPos = Results->HitPos;
|
||||
Results->Distance = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -835,6 +838,7 @@ bool FTraceInfo::TraceTraverse (int ptflags)
|
|||
{
|
||||
Results->CrossedWater = §ors[CurSector->sectornum];
|
||||
Results->CrossedWaterPos = Results->HitPos;
|
||||
Results->Distance = 0;
|
||||
}
|
||||
Results = res;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue