From 6e328a4e732f91af5e24ac677d76b6b438347480 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 4 Sep 2018 16:10:59 -0400 Subject: [PATCH] Misc camera fixes - Fixed remaining instances where camera position would scale with the player instead of the level; the camera should almost 100% certainly not change now when you get Grown/Shrunk - Reset camera when switching viewpoint, to make it not look *as* weird when switching after you've finished (needs tested) --- src/g_game.c | 1 + src/p_user.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index db686873..cacc12a9 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1857,6 +1857,7 @@ boolean G_Responder(event_t *ev) // tell who's the view CONS_Printf(M_GetText("Viewpoint: %s\n"), player_names[displayplayer]); + P_ResetCamera(&players[displayplayer], &camera); return true; } diff --git a/src/p_user.c b/src/p_user.c index 524d5f5c..13647313 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8233,8 +8233,8 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall mo = player->mo; - thiscam->radius = FixedMul(20*FRACUNIT, mo->scale); - thiscam->height = FixedMul(16*FRACUNIT, mo->scale); + thiscam->radius = FixedMul(20*FRACUNIT, mapheaderinfo[gamemap-1]->mobj_scale); + thiscam->height = FixedMul(16*FRACUNIT, mapheaderinfo[gamemap-1]->mobj_scale); if (!mo) return true; @@ -8408,7 +8408,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall x = mo->x - FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist); y = mo->y - FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist); - pviewheight = FixedMul(32<scale); pan = thiscam->pan + FixedMul(pan - thiscam->pan, camspeed/4); xpan = FixedMul(FINECOSINE(((angle+ANGLE_90)>>ANGLETOFINESHIFT) & FINEMASK), pan); @@ -8417,9 +8416,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall x += xpan; y += ypan; + pviewheight = FixedMul(32<mobj_scale); if (mo->eflags & MFE_VERTICALFLIP) - z = mo->z + mo->height - pviewheight - camheight; + z = mo->z + mobjinfo[mo->type].height - pviewheight - camheight; else z = mo->z + pviewheight + camheight;