From 6e6249f896d4beda1b172eb0234fe1e98561cf9d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 31 Oct 2016 18:51:58 +0100 Subject: [PATCH] - reverted WEAPONTOP to its original value of 32 and made the added fudging bit part of the render side. This is needed so that 'offset(0,32)' does what it is supposed to do. --- src/g_shared/a_weapons.cpp | 1 + src/p_pspr.cpp | 3 +-- src/p_pspr.h | 8 +++----- src/r_things.cpp | 4 ++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/g_shared/a_weapons.cpp b/src/g_shared/a_weapons.cpp index edd250deb..b1ede0187 100644 --- a/src/g_shared/a_weapons.cpp +++ b/src/g_shared/a_weapons.cpp @@ -640,6 +640,7 @@ void AWeapon::PostMorphWeapon () pspr = Owner->player->GetPSprite(PSP_WEAPON); pspr->y = WEAPONBOTTOM; + pspr->ResetInterpolation(); pspr->SetState(GetUpState()); } diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index abbd2284e..2e591e20d 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -262,8 +262,7 @@ void DPSprite::NewTick() while (pspr) { pspr->processPending = true; - pspr->oldx = pspr->x; - pspr->oldy = pspr->y; + pspr->ResetInterpolation(); pspr = pspr->Next; } diff --git a/src/p_pspr.h b/src/p_pspr.h index ea03e109f..64a2702a3 100644 --- a/src/p_pspr.h +++ b/src/p_pspr.h @@ -29,11 +29,8 @@ #define WEAPONBOTTOM 128. -// [RH] +0x6000 helps it meet the screen bottom -// at higher resolutions while still being in -// the right spot at 320x200. -#define WEAPONTOP (32+6./16) - +#define WEAPONTOP 32. +#define WEAPON_FUDGE_Y 0.375 class AInventory; // @@ -77,6 +74,7 @@ public: DPSprite* GetNext() { return Next; } AActor* GetCaller() { return Caller; } void SetCaller(AActor *newcaller) { Caller = newcaller; } + void ResetInterpolation() { oldx = x; oldy = y; } double x, y; double oldx, oldy; diff --git a/src/r_things.cpp b/src/r_things.cpp index a15921cba..cad434fa5 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -1302,7 +1302,7 @@ void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double } sx = pspr->oldx + (pspr->x - pspr->oldx) * ticfrac; - sy = pspr->oldy + (pspr->y - pspr->oldy) * ticfrac; + sy = pspr->oldy + (pspr->y - pspr->oldy) * ticfrac + WEAPON_FUDGE_Y; if (pspr->Flags & PSPF_ADDBOB) { @@ -1610,7 +1610,7 @@ void R_DrawPlayerSprites () else { wx = weapon->oldx + (weapon->x - weapon->oldx) * r_TicFracF; - wy = weapon->oldy + (weapon->y - weapon->oldy) * r_TicFracF; + wy = weapon->oldy + (weapon->y - weapon->oldy) * r_TicFracF + WEAPON_FUDGE_Y; } } else