mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-03-30 22:51:01 +00:00
Merged with latest master and made small change (zcenter -> center.Z) to hw_sprites.cpp. Now compiles and works.
This commit is contained in:
parent
e171f4eb6a
commit
c8a7507e8e
1 changed files with 28 additions and 28 deletions
|
@ -1,4 +1,4 @@
|
|||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright(C) 2002-2016 Christoph Oelckers
|
||||
|
@ -94,7 +94,7 @@ CUSTOM_CVAR(Int, gl_fuzztype, 0, CVAR_ARCHIVE)
|
|||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
|
@ -103,7 +103,7 @@ void HWSprite::DrawSprite(HWDrawInfo *di, FRenderState &state, bool translucent)
|
|||
bool additivefog = false;
|
||||
bool foglayer = false;
|
||||
int rel = fullbright ? 0 : getExtraLight();
|
||||
auto &vp = di->Viewpoint;
|
||||
auto &vp = di->Viewpoint;
|
||||
|
||||
if (translucent)
|
||||
{
|
||||
|
@ -336,7 +336,7 @@ void HWSprite::DrawSprite(HWDrawInfo *di, FRenderState &state, bool translucent)
|
|||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
|
@ -391,7 +391,7 @@ bool HWSprite::CalculateVertices(HWDrawInfo* di, FVector3* v, DVector3* vp)
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// [BB] Billboard stuff
|
||||
const bool drawWithXYBillboard = ((particle && gl_billboard_particles && !(particle->flags & SPF_NO_XY_BILLBOARD)) || (!(actor && actor->renderflags & RF_FORCEYBILLBOARD)
|
||||
//&& di->mViewActor != nullptr
|
||||
|
@ -453,7 +453,7 @@ bool HWSprite::CalculateVertices(HWDrawInfo* di, FVector3* v, DVector3* vp)
|
|||
float rollDegrees = doRoll ? Angles.Roll.Degrees() : 0;
|
||||
float angleRad = (FAngle::fromDeg(270.) - HWAngles.Yaw).Radians();
|
||||
|
||||
// [fgsfds] Rotate the sprite about the sight vector (roll)
|
||||
// [fgsfds] Rotate the sprite about the sight vector (roll)
|
||||
if (isWallSprite)
|
||||
{
|
||||
float yawvecX = Angles.Yaw.Cos();
|
||||
|
@ -477,9 +477,9 @@ bool HWSprite::CalculateVertices(HWDrawInfo* di, FVector3* v, DVector3* vp)
|
|||
// Rotate the sprite about the vector starting at the center of the sprite
|
||||
// triangle strip and with direction orthogonal to where the player is looking
|
||||
// in the x/y plane.
|
||||
if(r_isocam || (di->Level->flags3 & LEVEL3_ISOMETRICMODE)) mat.Translate(0.0, z2 - zcenter, 0.0);
|
||||
if(r_isocam || (di->Level->flags3 & LEVEL3_ISOMETRICMODE)) mat.Translate(0.0, z2 - center.Z, 0.0);
|
||||
mat.Rotate(-sin(angleRad), 0, cos(angleRad), -HWAngles.Pitch.Degrees());
|
||||
if(r_isocam || (di->Level->flags3 & LEVEL3_ISOMETRICMODE)) mat.Translate(0.0, zcenter - z2, 0.0);
|
||||
if(r_isocam || (di->Level->flags3 & LEVEL3_ISOMETRICMODE)) mat.Translate(0.0, center.Z - z2, 0.0);
|
||||
}
|
||||
|
||||
mat.Translate(-center.X, -center.Z, -center.Y); // retreat from sprite center
|
||||
|
@ -497,7 +497,7 @@ bool HWSprite::CalculateVertices(HWDrawInfo* di, FVector3* v, DVector3* vp)
|
|||
|
||||
if (!offset.isZero())
|
||||
HandleSpriteOffsets(&mat, &HWAngles, &offset, false);
|
||||
|
||||
|
||||
if (doRoll)
|
||||
{
|
||||
// Compute center of sprite
|
||||
|
@ -513,7 +513,7 @@ bool HWSprite::CalculateVertices(HWDrawInfo* di, FVector3* v, DVector3* vp)
|
|||
v[1] = mat * FVector3(x2, z1, y2);
|
||||
v[2] = mat * FVector3(x1, z2, y1);
|
||||
v[3] = mat * FVector3(x2, z2, y2);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -522,14 +522,14 @@ bool HWSprite::CalculateVertices(HWDrawInfo* di, FVector3* v, DVector3* vp)
|
|||
v[2] = FVector3(x1, z2, y1);
|
||||
v[3] = FVector3(x2, z2, y2);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
|
@ -554,7 +554,7 @@ inline void HWSprite::PutSprite(HWDrawInfo *di, bool translucent)
|
|||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
|
@ -579,7 +579,7 @@ void HWSprite::CreateVertices(HWDrawInfo *di)
|
|||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
|
@ -618,7 +618,7 @@ void HWSprite::SplitSprite(HWDrawInfo *di, sector_t * frontsector, bool transluc
|
|||
}
|
||||
|
||||
z1=copySprite.z2=lightbottom;
|
||||
vt=copySprite.vb=copySprite.vt+
|
||||
vt=copySprite.vb=copySprite.vt+
|
||||
(lightbottom-copySprite.z1)*(copySprite.vb-copySprite.vt)/(z2-copySprite.z1);
|
||||
copySprite.PutSprite(di, translucent);
|
||||
put=true;
|
||||
|
@ -628,7 +628,7 @@ void HWSprite::SplitSprite(HWDrawInfo *di, sector_t * frontsector, bool transluc
|
|||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
|
@ -713,7 +713,7 @@ void HWSprite::PerformSpriteClipAdjustment(AActor *thing, const DVector2 &thingp
|
|||
z1 -= difft;
|
||||
}
|
||||
}
|
||||
if (diffb <= (0 - (float)gl_sclipthreshold)) // such a large displacement can't be correct!
|
||||
if (diffb <= (0 - (float)gl_sclipthreshold)) // such a large displacement can't be correct!
|
||||
{
|
||||
// for living monsters standing on the floor allow a little more.
|
||||
if (!(thing->flags3&MF3_ISMONSTER) || (thing->flags&MF_NOGRAVITY) || (thing->flags&MF_CORPSE) || diffb < (-1.8*(float)gl_sclipthreshold))
|
||||
|
@ -728,7 +728,7 @@ void HWSprite::PerformSpriteClipAdjustment(AActor *thing, const DVector2 &thingp
|
|||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
|
@ -807,7 +807,7 @@ void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t
|
|||
if (thruportal == 1) vieworigin += di->Level->Displacements.getOffset(viewmaster->Sector->PortalGroup, sector->PortalGroup);
|
||||
if (fabs(vieworigin.X - vp.ActorPos.X) < 2 && fabs(vieworigin.Y - vp.ActorPos.Y) < 2) return;
|
||||
|
||||
// Necessary in order to prevent sprite pop-ins with viewpos and models.
|
||||
// Necessary in order to prevent sprite pop-ins with viewpos and models.
|
||||
auto* sec = viewmaster->Sector;
|
||||
if (sec && !sec->PortalBlocksMovement(sector_t::ceiling))
|
||||
{
|
||||
|
@ -1304,7 +1304,7 @@ void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t
|
|||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
|
@ -1330,7 +1330,7 @@ void HWSprite::ProcessParticle(HWDrawInfo *di, particle_t *particle, sector_t *s
|
|||
this->particle = particle;
|
||||
fullbright = particle->flags & SPF_FULLBRIGHT;
|
||||
|
||||
if (di->isFullbrightScene())
|
||||
if (di->isFullbrightScene())
|
||||
{
|
||||
Colormap.Clear();
|
||||
}
|
||||
|
@ -1389,7 +1389,7 @@ void HWSprite::ProcessParticle(HWDrawInfo *di, particle_t *particle, sector_t *s
|
|||
{
|
||||
bool has_texture = particle->texture.isValid();
|
||||
bool custom_animated_texture = (particle->flags & SPF_LOCAL_ANIM) && particle->animData.ok;
|
||||
|
||||
|
||||
int particle_style = has_texture ? 2 : gl_particles_style; // Treat custom texture the same as smooth particles
|
||||
|
||||
// [BB] Load the texture for round or smooth particles
|
||||
|
@ -1448,7 +1448,7 @@ void HWSprite::ProcessParticle(HWDrawInfo *di, particle_t *particle, sector_t *s
|
|||
float rvf = (particle->RollVel) * timefrac;
|
||||
Angles.Roll = TAngle<double>::fromDeg(particle->Roll + rvf);
|
||||
}
|
||||
|
||||
|
||||
float factor;
|
||||
if (particle_style == 1) factor = 1.3f / 7.f;
|
||||
else if (particle_style == 2) factor = 2.5f / 7.f;
|
||||
|
@ -1466,7 +1466,7 @@ void HWSprite::ProcessParticle(HWDrawInfo *di, particle_t *particle, sector_t *s
|
|||
z2=z+scalefac;
|
||||
|
||||
depth = (float)((x - vp.Pos.X) * vp.TanCos + (y - vp.Pos.Y) * vp.TanSin);
|
||||
|
||||
|
||||
// [BB] Translucent particles have to be rendered without the alpha test.
|
||||
if (particle_style != 2 && trans>=1.0f-FLT_EPSILON) hw_styleflags = STYLEHW_Solid;
|
||||
else hw_styleflags = STYLEHW_NoAlphaTest;
|
||||
|
@ -1482,7 +1482,7 @@ void HWSprite::ProcessParticle(HWDrawInfo *di, particle_t *particle, sector_t *s
|
|||
}
|
||||
|
||||
// [MC] VisualThinkers are to be rendered akin to actor sprites. The reason this whole system
|
||||
// is hitching a ride on particle_t is because of the large number of checks with
|
||||
// is hitching a ride on particle_t is because of the large number of checks with
|
||||
// HWSprite elsewhere in the draw lists.
|
||||
void HWSprite::AdjustVisualThinker(HWDrawInfo* di, DVisualThinker* spr, sector_t* sector)
|
||||
{
|
||||
|
@ -1493,7 +1493,7 @@ void HWSprite::AdjustVisualThinker(HWDrawInfo* di, DVisualThinker* spr, sector_t
|
|||
|
||||
if (paused || spr->isFrozen())
|
||||
timefrac = 0.;
|
||||
|
||||
|
||||
bool custom_anim = ((spr->PT.flags & SPF_LOCAL_ANIM) && spr->PT.animData.ok);
|
||||
|
||||
texture = TexMan.GetGameTexture(
|
||||
|
@ -1525,7 +1525,7 @@ void HWSprite::AdjustVisualThinker(HWDrawInfo* di, DVisualThinker* spr, sector_t
|
|||
auto r = spi.GetSpriteRect();
|
||||
r.Scale(spr->Scale.X, spr->Scale.Y);
|
||||
|
||||
if (spr->bXFlip)
|
||||
if (spr->bXFlip)
|
||||
{
|
||||
std::swap(ul,ur);
|
||||
r.left = -r.width - r.left; // mirror the sprite's x-offset
|
||||
|
@ -1552,7 +1552,7 @@ void HWSprite::AdjustVisualThinker(HWDrawInfo* di, DVisualThinker* spr, sector_t
|
|||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
|
|
Loading…
Reference in a new issue