From fb0b48be529dcd8901a295d5709dd4639d940080 Mon Sep 17 00:00:00 2001 From: Kyzentun Date: Wed, 21 Jan 2015 10:44:16 -0700 Subject: [PATCH] Changed screen width calculations to subtract 1 if the result is odd. --- src/ScreenDimensions.cpp | 6 +++++- src/StepMania.cpp | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ScreenDimensions.cpp b/src/ScreenDimensions.cpp index 77110ee0e3..d686569192 100644 --- a/src/ScreenDimensions.cpp +++ b/src/ScreenDimensions.cpp @@ -35,7 +35,11 @@ float ScreenDimensions::GetScreenWidth() if( fAspect > THEME_NATIVE_ASPECT ) fScale = fAspect / THEME_NATIVE_ASPECT; ASSERT( fScale >= 1 ); - return (float) ceilf(THEME_SCREEN_WIDTH * fScale); + // ceilf causes the width to come out odd when it shouldn't. + // 576 * 1.7778 = 1024.0128, which is rounded to 1025. -Kyz + int width= (int)ceilf(THEME_SCREEN_WIDTH * fScale); + width-= width % 2; + return (float)width; } float ScreenDimensions::GetScreenHeight() diff --git a/src/StepMania.cpp b/src/StepMania.cpp index eadf38dc42..98dbf12cde 100644 --- a/src/StepMania.cpp +++ b/src/StepMania.cpp @@ -88,6 +88,9 @@ void StepMania::GetPreferredVideoModeParams( VideoModeParams ¶msOut ) //float fRatio = PREFSMAN->m_iDisplayHeight; //iWidth = PREFSMAN->m_iDisplayHeight * fRatio; iWidth = static_cast(ceilf(PREFSMAN->m_iDisplayHeight * PREFSMAN->m_fDisplayAspectRatio)); + // ceilf causes the width to come out odd when it shouldn't. + // 576 * 1.7778 = 1024.0128, which is rounded to 1025. -Kyz + iWidth-= iWidth % 2; } paramsOut = VideoModeParams(