From 224e805fe4e7a4d5366b228072834674f77fa0ba Mon Sep 17 00:00:00 2001 From: Fire-Head Date: Tue, 29 Dec 2020 20:24:16 +0300 Subject: Sprite Scaling option --- src/render/Sprite.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/render/Sprite.cpp') diff --git a/src/render/Sprite.cpp b/src/render/Sprite.cpp index 9ec7b002..4be64ef2 100644 --- a/src/render/Sprite.cpp +++ b/src/render/Sprite.cpp @@ -5,6 +5,10 @@ #include "Camera.h" #include "Sprite.h" +#ifdef ASPECT_RATIO_SCALE +#include "Frontend.h" +#endif + float CSprite::m_f2DNearScreenZ; float CSprite::m_f2DFarScreenZ; float CSprite::m_fRecipNearClipPlane; @@ -35,6 +39,11 @@ CSprite::CalcScreenCoors(const RwV3d &in, RwV3d *out, float *outw, float *outh, *outw = fovScale * SCREEN_SCALE_AR(recip) * SCREEN_WIDTH; *outh = fovScale * recip * SCREEN_HEIGHT; + +#ifdef ASPECT_RATIO_SCALE + if ( CMenuManager::m_PrefsSpriteScalingMode==SCL_AUTO ) + *outw = fovScale * recip * SCREEN_HEIGHT; +#endif return true; } -- cgit v1.2.3 From 11de714d9dbeabb59129d29acb9e433c538ba4ba Mon Sep 17 00:00:00 2001 From: Fire-Head Date: Tue, 5 Jan 2021 04:17:18 +0300 Subject: remake --- src/render/Sprite.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/render/Sprite.cpp') diff --git a/src/render/Sprite.cpp b/src/render/Sprite.cpp index 4be64ef2..390737f3 100644 --- a/src/render/Sprite.cpp +++ b/src/render/Sprite.cpp @@ -41,7 +41,7 @@ CSprite::CalcScreenCoors(const RwV3d &in, RwV3d *out, float *outw, float *outh, *outh = fovScale * recip * SCREEN_HEIGHT; #ifdef ASPECT_RATIO_SCALE - if ( CMenuManager::m_PrefsSpriteScalingMode==SCL_AUTO ) + if ( CDraw::ms_bFixSprites ) *outw = fovScale * recip * SCREEN_HEIGHT; #endif -- cgit v1.2.3 From 368d2f3279b474056e888dcccea234f32614b506 Mon Sep 17 00:00:00 2001 From: Fire-Head Date: Fri, 8 Jan 2021 19:31:48 +0300 Subject: bb .ini hello defines --- src/render/Sprite.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/render/Sprite.cpp') diff --git a/src/render/Sprite.cpp b/src/render/Sprite.cpp index 390737f3..c31c75d2 100644 --- a/src/render/Sprite.cpp +++ b/src/render/Sprite.cpp @@ -37,13 +37,12 @@ CSprite::CalcScreenCoors(const RwV3d &in, RwV3d *out, float *outw, float *outh, // this is used to scale correctly if you zoom in with sniper rifle float fovScale = fov / CDraw::GetFOV(); +#ifdef FIX_SPRITES + *outw = fovScale * recip * SCREEN_HEIGHT; +#else *outw = fovScale * SCREEN_SCALE_AR(recip) * SCREEN_WIDTH; - *outh = fovScale * recip * SCREEN_HEIGHT; - -#ifdef ASPECT_RATIO_SCALE - if ( CDraw::ms_bFixSprites ) - *outw = fovScale * recip * SCREEN_HEIGHT; #endif + *outh = fovScale * recip * SCREEN_HEIGHT; return true; } -- cgit v1.2.3