mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- make distancecheck 3D and use the actual view position for calculation.
This commit is contained in:
parent
45cfea17f5
commit
d88a5ac353
3 changed files with 7 additions and 2 deletions
|
@ -731,7 +731,6 @@ void R_EnterPortal (PortalDrawseg* pds, int depth)
|
|||
viewy = FLOAT2FIXED((y1 + r * dy)*2 - y);
|
||||
}
|
||||
viewangle = pds->src->Delta().Angle().BAMs() - startang;
|
||||
ViewAngle = AngleToFloat(viewangle);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -763,6 +762,7 @@ void R_EnterPortal (PortalDrawseg* pds, int depth)
|
|||
}
|
||||
}
|
||||
ViewAngle = AngleToFloat(viewangle);
|
||||
ViewPos = { FIXED2DBL(viewx), FIXED2DBL(viewy), FIXED2DBL(viewz) };
|
||||
|
||||
viewsin = finesine[viewangle>>ANGLETOFINESHIFT];
|
||||
viewcos = finecosine[viewangle>>ANGLETOFINESHIFT];
|
||||
|
@ -845,6 +845,7 @@ void R_EnterPortal (PortalDrawseg* pds, int depth)
|
|||
ViewPath[0] = savedpath[0];
|
||||
ViewPath[1] = savedpath[1];
|
||||
ViewAngle = AngleToFloat(viewangle);
|
||||
ViewPos = { FIXED2DBL(viewx), FIXED2DBL(viewy), FIXED2DBL(viewz) };
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -1083,6 +1083,7 @@ void R_DrawHeightPlanes(fixed_t height)
|
|||
viewz = pl->viewz;
|
||||
viewangle = pl->viewangle;
|
||||
ViewAngle = AngleToFloat(viewangle);
|
||||
ViewPos = { FIXED2DBL(viewx), FIXED2DBL(viewy), FIXED2DBL(viewz) };
|
||||
MirrorFlags = pl->MirrorFlags;
|
||||
R_DrawSinglePlane (pl, pl->sky & 0x7FFFFFFF, pl->Additive, true);
|
||||
}
|
||||
|
@ -1094,6 +1095,7 @@ void R_DrawHeightPlanes(fixed_t height)
|
|||
viewz = oViewZ;
|
||||
viewangle = oViewAngle;
|
||||
ViewAngle = AngleToFloat(viewangle);
|
||||
ViewPos = { FIXED2DBL(viewx), FIXED2DBL(viewy), FIXED2DBL(viewz) };
|
||||
}
|
||||
|
||||
|
||||
|
@ -1256,6 +1258,7 @@ void R_DrawSkyBoxes ()
|
|||
viewangle = pl->viewangle;
|
||||
}
|
||||
ViewAngle = AngleToFloat(viewangle);
|
||||
ViewPos = { FIXED2DBL(viewx), FIXED2DBL(viewy), FIXED2DBL(viewz) };
|
||||
|
||||
sky->bInSkybox = true;
|
||||
if (mate != NULL) mate->bInSkybox = true;
|
||||
|
@ -1371,6 +1374,7 @@ void R_DrawSkyBoxes ()
|
|||
extralight = savedextralight;
|
||||
viewangle = savedangle;
|
||||
ViewAngle = AngleToFloat(viewangle);
|
||||
ViewPos = { FIXED2DBL(viewx), FIXED2DBL(viewy), FIXED2DBL(viewz) };
|
||||
R_SetViewAngle ();
|
||||
|
||||
CurrentPortalInSkybox = false;
|
||||
|
|
|
@ -1248,7 +1248,7 @@ void R_AddSprites (sector_t *sec, int lightlevel, int fakeside)
|
|||
FIntCVar *cvar = thing->GetClass()->distancecheck;
|
||||
if (cvar != NULL && *cvar >= 0)
|
||||
{
|
||||
double dist = thing->Distance2DSquared(camera);
|
||||
double dist = (thing->PosRelative(viewsector) - ViewPos).LengthSquared();
|
||||
double check = (double)**cvar;
|
||||
if (dist >= check * check)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue