- fixed: The view path for checking whether the player sprite should be drawn during a portal transition was never set properly in the portal transitioning case.

This commit is contained in:
Christoph Oelckers 2016-05-09 23:16:06 +02:00
parent 2e4b8dd416
commit 966e6797e4
3 changed files with 14 additions and 3 deletions

View file

@ -58,6 +58,7 @@
#include "v_font.h" #include "v_font.h"
#include "r_data/colormaps.h" #include "r_data/colormaps.h"
#include "farchive.h" #include "farchive.h"
#include "p_maputl.h"
// MACROS ------------------------------------------------------------------ // MACROS ------------------------------------------------------------------
@ -687,7 +688,7 @@ void R_EnterPortal (PortalDrawseg* pds, int depth)
P_TranslatePortalXY(pds->src, ViewPath[0].X, ViewPath[0].Y); P_TranslatePortalXY(pds->src, ViewPath[0].X, ViewPath[0].Y);
P_TranslatePortalXY(pds->src, ViewPath[1].X, ViewPath[1].Y); P_TranslatePortalXY(pds->src, ViewPath[1].X, ViewPath[1].Y);
if (!r_showviewer && camera) if (!r_showviewer && camera && P_PointOnLineSidePrecise(ViewPath[0], pds->dst) != P_PointOnLineSidePrecise(ViewPath[1], pds->dst))
{ {
double distp = (ViewPath[0] - ViewPath[1]).Length(); double distp = (ViewPath[0] - ViewPath[1]).Length();
if (distp > EQUAL_EPSILON) if (distp > EQUAL_EPSILON)

View file

@ -433,14 +433,14 @@ void R_InterpolateView (player_t *player, double Frac, InterpolationViewer *ivie
} }
InterpolationPath.Pop(); InterpolationPath.Pop();
ViewPath[0] = iview->Old.Pos; ViewPath[0] = iview->Old.Pos;
ViewPath[1] = ViewPath[0] + (InterpolationPath[0].pos - ViewPath[0]).XY().MakeResize(pathlen);
} }
} }
else else
{ {
DVector2 disp = Displacements.getOffset(oldgroup, newgroup); DVector2 disp = Displacements.getOffset(oldgroup, newgroup);
ViewPos = iview->Old.Pos + (iview->New.Pos - iview->Old.Pos - disp) * Frac; ViewPos = iview->Old.Pos + (iview->New.Pos - iview->Old.Pos - disp) * Frac;
ViewPath[1] = iview->New.Pos; ViewPath[0] = ViewPath[1] = iview->New.Pos;
ViewPath[0] = iview->Old.Pos;
} }
} }
else else

View file

@ -260,6 +260,16 @@ struct TVector2
return len; return len;
} }
// Resizes this vector to be the specified length (if it is not 0)
TVector2 &MakeResize(double len)
{
double scale = len / Length();
X = vec_t(X * scale);
Y = vec_t(Y * scale);
return *this;
}
// Dot product // Dot product
double operator | (const TVector2 &other) const double operator | (const TVector2 &other) const
{ {