From 3d74c8a9fd2f3c69ab2026ef080b2306de0a9bd8 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 11 Nov 2012 17:56:57 +0000 Subject: [PATCH] Fix viewing through moving cameras. It's still not pretty though since there's no interpolation from G_DrawRooms(). git-svn-id: https://svn.eduke32.com/eduke32@3149 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/player.c | 14 ++++++++++++++ polymer/eduke32/source/player.h | 1 + polymer/eduke32/source/sector.c | 8 +------- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 362cbffed..db25c0f10 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -4359,6 +4359,19 @@ static void getzsofslope_player(int16_t sectnum, int32_t dax, int32_t day, int32 } #endif +void P_UpdatePosWhenViewingCam(DukePlayer_t *p) +{ + int32_t i = p->newowner; + + p->pos.x = SX; + p->pos.y = SY; + p->pos.z = SZ; + p->ang = SA; + p->vel.x = p->vel.y = sprite[p->i].xvel = 0; + p->look_ang = 0; + p->rotscrnang = 0; +} + void P_ProcessInput(int32_t snum) { DukePlayer_t *const p = g_player[snum].ps; @@ -4577,6 +4590,7 @@ void P_ProcessInput(int32_t snum) if (p->newowner >= 0) { + P_UpdatePosWhenViewingCam(p); P_DoCounters(p); if (*aplWeaponWorksLike[p->curr_weapon] == HANDREMOTE_WEAPON) diff --git a/polymer/eduke32/source/player.h b/polymer/eduke32/source/player.h index a373a5a4b..28dee910e 100644 --- a/polymer/eduke32/source/player.h +++ b/polymer/eduke32/source/player.h @@ -308,6 +308,7 @@ void P_DropWeapon(DukePlayer_t *p); int32_t P_FindOtherPlayer(int32_t p,int32_t *d); void P_FireWeapon(DukePlayer_t *p); void P_FragPlayer(int32_t snum); +void P_UpdatePosWhenViewingCam(DukePlayer_t *p); void P_ProcessInput(int32_t snum); void P_ProcessWeapon(int32_t snum); void P_QuickKill(DukePlayer_t *p); diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index 825d27398..884421b14 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -3278,13 +3278,7 @@ void P_CheckSectors(int32_t snum) // parallaxtype = 2; p->newowner = i; - p->pos.x = SX; - p->pos.y = SY; - p->pos.z = SZ; - p->ang = SA; - p->vel.x = p->vel.y = sprite[p->i].xvel = 0; - p->look_ang = 0; - p->rotscrnang = 0; + P_UpdatePosWhenViewingCam(p); return; }