mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- floatified the automap.
This commit is contained in:
parent
fb8e03d5eb
commit
8e13d13916
6 changed files with 283 additions and 266 deletions
|
@ -737,7 +737,12 @@ public:
|
|||
|
||||
inline bool IsNoClip2() const;
|
||||
void CheckPortalTransition(bool islinked);
|
||||
fixedvec3 GetPortalTransition(fixed_t byoffset, sector_t **pSec = NULL);
|
||||
fixedvec3 _f_GetPortalTransition(fixed_t byoffset, sector_t **pSec = NULL);
|
||||
DVector3 GetPortalTransition(double byoffset, sector_t **pSec = NULL)
|
||||
{
|
||||
fixedvec3 pos = _f_GetPortalTransition(FLOAT2FIXED(byoffset), pSec);
|
||||
return{ FIXED2FLOAT(pos.x), FIXED2FLOAT(pos.y),FIXED2FLOAT(pos.z) };
|
||||
}
|
||||
|
||||
// What species am I?
|
||||
virtual FName GetSpecies();
|
||||
|
|
490
src/am_map.cpp
490
src/am_map.cpp
File diff suppressed because it is too large
Load diff
|
@ -5087,7 +5087,7 @@ void P_UseLines(player_t *player)
|
|||
bool foundline = false;
|
||||
|
||||
// If the player is transitioning a portal, use the group that is at its vertical center.
|
||||
fixedvec2 start = player->mo->GetPortalTransition(player->mo->_f_height() / 2);
|
||||
fixedvec2 start = player->mo->_f_GetPortalTransition(player->mo->_f_height() / 2);
|
||||
// [NS] Now queries the Player's UseRange.
|
||||
fixedvec2 end = start + Vec2Angle(FLOAT2FIXED(player->mo->UseRange), player->mo->_f_angle());
|
||||
|
||||
|
|
|
@ -3249,7 +3249,7 @@ void AActor::SetRoll(DAngle r, bool interpolate)
|
|||
}
|
||||
|
||||
|
||||
fixedvec3 AActor::GetPortalTransition(fixed_t byoffset, sector_t **pSec)
|
||||
fixedvec3 AActor::_f_GetPortalTransition(fixed_t byoffset, sector_t **pSec)
|
||||
{
|
||||
bool moved = false;
|
||||
sector_t *sec = Sector;
|
||||
|
|
44
src/r_defs.h
44
src/r_defs.h
|
@ -626,6 +626,11 @@ struct sector_t
|
|||
return planes[pos].xform.xoffs;
|
||||
}
|
||||
|
||||
double GetXOffsetF(int pos) const
|
||||
{
|
||||
return FIXED2DBL(planes[pos].xform.xoffs);
|
||||
}
|
||||
|
||||
void SetYOffset(int pos, fixed_t o)
|
||||
{
|
||||
planes[pos].xform.yoffs = o;
|
||||
|
@ -648,6 +653,18 @@ struct sector_t
|
|||
}
|
||||
}
|
||||
|
||||
double GetYOffsetF(int pos, bool addbase = true) const
|
||||
{
|
||||
if (!addbase)
|
||||
{
|
||||
return FIXED2DBL(planes[pos].xform.yoffs);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FIXED2DBL(planes[pos].xform.yoffs + planes[pos].xform.base_yoffs);
|
||||
}
|
||||
}
|
||||
|
||||
void SetXScale(int pos, fixed_t o)
|
||||
{
|
||||
planes[pos].xform.xscale = o;
|
||||
|
@ -658,6 +675,11 @@ struct sector_t
|
|||
return planes[pos].xform.xscale;
|
||||
}
|
||||
|
||||
double GetXScaleF(int pos) const
|
||||
{
|
||||
return FIXED2DBL(planes[pos].xform.xscale);
|
||||
}
|
||||
|
||||
void SetYScale(int pos, fixed_t o)
|
||||
{
|
||||
planes[pos].xform.yscale = o;
|
||||
|
@ -668,6 +690,11 @@ struct sector_t
|
|||
return planes[pos].xform.yscale;
|
||||
}
|
||||
|
||||
double GetYScaleF(int pos) const
|
||||
{
|
||||
return FIXED2DBL(planes[pos].xform.yscale);
|
||||
}
|
||||
|
||||
void SetAngle(int pos, angle_t o)
|
||||
{
|
||||
planes[pos].xform.angle = o;
|
||||
|
@ -685,6 +712,18 @@ struct sector_t
|
|||
}
|
||||
}
|
||||
|
||||
DAngle GetAngleF(int pos, bool addbase = true) const
|
||||
{
|
||||
if (!addbase)
|
||||
{
|
||||
return ANGLE2DBL(planes[pos].xform.angle);
|
||||
}
|
||||
else
|
||||
{
|
||||
return ANGLE2DBL(planes[pos].xform.angle + planes[pos].xform.base_angle);
|
||||
}
|
||||
}
|
||||
|
||||
void SetBase(int pos, fixed_t y, angle_t o)
|
||||
{
|
||||
planes[pos].xform.base_yoffs = y;
|
||||
|
@ -1344,6 +1383,11 @@ inline sector_t *P_PointInSector(const DVector2 &pos)
|
|||
return P_PointInSubsector(FLOAT2FIXED(pos.X), FLOAT2FIXED(pos.Y))->sector;
|
||||
}
|
||||
|
||||
inline sector_t *P_PointInSector(double X, double Y)
|
||||
{
|
||||
return P_PointInSubsector(FLOAT2FIXED(X), FLOAT2FIXED(Y))->sector;
|
||||
}
|
||||
|
||||
inline fixedvec3 AActor::_f_PosRelative(int portalgroup) const
|
||||
{
|
||||
return _f_Pos() + Displacements._f_getOffset(Sector->PortalGroup, portalgroup);
|
||||
|
|
|
@ -724,7 +724,7 @@ static void CalcPosVel(int type, const AActor *actor, const sector_t *sector,
|
|||
|
||||
if ((chanflags & CHAN_LISTENERZ) && players[consoleplayer].camera != NULL)
|
||||
{
|
||||
y = players[consoleplayer].camera != NULL ? players[consoleplayer].camera->SoundZ() : 0;
|
||||
y = players[consoleplayer].camera != NULL ? FLOAT2FIXED(players[consoleplayer].camera->SoundPos().Z) : 0;
|
||||
}
|
||||
pos->X = FIXED2FLOAT(x);
|
||||
pos->Y = FIXED2FLOAT(y);
|
||||
|
@ -1952,7 +1952,7 @@ static void S_SetListener(SoundListener &listener, AActor *listenactor)
|
|||
{
|
||||
if (listenactor != NULL)
|
||||
{
|
||||
listener.angle = ToRadians(listenactor->Angles.Yaw);
|
||||
listener.angle = (float)ToRadians(listenactor->Angles.Yaw);
|
||||
/*
|
||||
listener.velocity.X = listenactor->vel.x * (TICRATE/65536.f);
|
||||
listener.velocity.Y = listenactor->vel.z * (TICRATE/65536.f);
|
||||
|
|
Loading…
Reference in a new issue