From ca8f71b5612f13451d5f9a87e5a66edd88adf5f6 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Tue, 24 Jan 2017 04:19:43 +0100 Subject: [PATCH] Remove the need for RenderPlayerSprites::SetupSpriteScale --- src/swrenderer/scene/r_viewport.cpp | 3 --- src/swrenderer/things/r_playersprite.cpp | 11 ++++------- src/swrenderer/things/r_playersprite.h | 6 ------ 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/swrenderer/scene/r_viewport.cpp b/src/swrenderer/scene/r_viewport.cpp index c925094923..d2df38f221 100644 --- a/src/swrenderer/scene/r_viewport.cpp +++ b/src/swrenderer/scene/r_viewport.cpp @@ -113,9 +113,6 @@ namespace swrenderer WallTMapScale2 = IYaspectMul / CenterX; - // psprite scales - RenderPlayerSprites::Instance()->SetupSpriteScale(); - // thing clipping fillshort(screenheightarray, viewwidth, (short)viewheight); diff --git a/src/swrenderer/things/r_playersprite.cpp b/src/swrenderer/things/r_playersprite.cpp index 69da6b9477..649df88586 100644 --- a/src/swrenderer/things/r_playersprite.cpp +++ b/src/swrenderer/things/r_playersprite.cpp @@ -71,13 +71,6 @@ namespace swrenderer return &instance; } - void RenderPlayerSprites::SetupSpriteScale() - { - pspritexscale = centerxwide / 160.0; - pspriteyscale = pspritexscale * YaspectMul; - pspritexiscale = 1 / pspritexscale; - } - void RenderPlayerSprites::Render() { int i; @@ -248,6 +241,10 @@ namespace swrenderer sy += wy; } + double pspritexscale = centerxwide / 160.0; + double pspriteyscale = pspritexscale * YaspectMul; + double pspritexiscale = 1 / pspritexscale; + // calculate edges of the shape tx = sx - BASEXCENTER; diff --git a/src/swrenderer/things/r_playersprite.h b/src/swrenderer/things/r_playersprite.h index b12bbd8d35..7c821f7425 100644 --- a/src/swrenderer/things/r_playersprite.h +++ b/src/swrenderer/things/r_playersprite.h @@ -76,8 +76,6 @@ namespace swrenderer public: static RenderPlayerSprites *Instance(); - void SetupSpriteScale(); - void Render(); void RenderRemaining(); @@ -88,9 +86,5 @@ namespace swrenderer enum { BASEYCENTER = 100 }; TArray AcceleratedSprites; - - double pspritexscale = 0.0; - double pspritexiscale = 0.0; - double pspriteyscale = 0.0; }; }