fix portal interp view positioning

This commit is contained in:
Eidolon 2022-08-20 13:00:37 -05:00
parent a37ae53ff7
commit a3bc32f7a0

View file

@ -1175,11 +1175,11 @@ static void R_PortalFrame(line_t *start, line_t *dest, portal_pair *portal)
#endif #endif
//R_SetupFrame(player, false); //R_SetupFrame(player, false);
newview->x = portal->viewx; viewx = portal->viewx;
newview->y = portal->viewy; viewy = portal->viewy;
newview->z = portal->viewz; viewz = portal->viewz;
newview->angle = portal->viewangle; viewangle = portal->viewangle;
// newview->sin = FINESINE(newview->angle>>ANGLETOFINESHIFT); // newview->sin = FINESINE(newview->angle>>ANGLETOFINESHIFT);
// newview->cos = FINECOSINE(newview->angle>>ANGLETOFINESHIFT); // newview->cos = FINECOSINE(newview->angle>>ANGLETOFINESHIFT);
@ -1207,13 +1207,13 @@ static void R_PortalFrame(line_t *start, line_t *dest, portal_pair *portal)
if (dangle == 0) if (dangle == 0)
#endif #endif
{ // the entrance goes straight opposite the exit, so we just need to mess with the offset. { // the entrance goes straight opposite the exit, so we just need to mess with the offset.
newview->x += dest_c.x - start_c.x; viewx += dest_c.x - start_c.x;
newview->y += dest_c.y - start_c.y; viewy += dest_c.y - start_c.y;
return; return;
} }
#ifdef ANGLED_PORTALS #ifdef ANGLED_PORTALS
newview->angle += dangle; viewangle += dangle;
// newview->sin = FINESINE(newview->angle>>ANGLETOFINESHIFT); // newview->sin = FINESINE(newview->angle>>ANGLETOFINESHIFT);
// newview->cos = FINECOSINE(newview->angle>>ANGLETOFINESHIFT); // newview->cos = FINECOSINE(newview->angle>>ANGLETOFINESHIFT);
//CONS_Printf("dangle == %u\n", AngleFixed(dangle)>>FRACBITS); //CONS_Printf("dangle == %u\n", AngleFixed(dangle)>>FRACBITS);
@ -1227,8 +1227,8 @@ static void R_PortalFrame(line_t *start, line_t *dest, portal_pair *portal)
angtopoint = R_PointToAngle2(start_c.x, start_c.y, newview->x, newview->y); angtopoint = R_PointToAngle2(start_c.x, start_c.y, newview->x, newview->y);
angtopoint += dangle; angtopoint += dangle;
newview->x = dest_c.x+FixedMul(FINECOSINE(angtopoint>>ANGLETOFINESHIFT), disttopoint); viewx = dest_c.x+FixedMul(FINECOSINE(angtopoint>>ANGLETOFINESHIFT), disttopoint);
newview->y = dest_c.y+FixedMul(FINESINE(angtopoint>>ANGLETOFINESHIFT), disttopoint); viewy = dest_c.y+FixedMul(FINESINE(angtopoint>>ANGLETOFINESHIFT), disttopoint);
} }
#endif #endif
} }