From 92a3fc49eb3c247aa148a998b0d8023104a9cc00 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sat, 24 Apr 2004 07:54:18 +0000 Subject: [PATCH] add m_bHalveTextureHeight for 8:3 displays --- stepmania/src/PrefsManager.cpp | 3 +++ stepmania/src/PrefsManager.h | 5 +++++ stepmania/src/RageBitmapTexture.cpp | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index d679223563..af8db5cf07 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -218,6 +218,7 @@ PrefsManager::PrefsManager() m_bHideDefaultNoteSkin = false; m_iMaxHighScoresPerList = 10; m_fPadStickSeconds = 0; + m_bHalveTextureHeight = false; g_bAutoRestart = false; m_bSignProfileData = false; @@ -506,6 +507,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk() ini.GetValue( "Options", "HideDefaultNoteSkin", m_bHideDefaultNoteSkin ); ini.GetValue( "Options", "MaxHighScoresPerList", m_iMaxHighScoresPerList ); ini.GetValue( "Options", "PadStickSeconds", m_fPadStickSeconds ); + ini.GetValue( "Options", "HalveTextureHeight", m_bHalveTextureHeight ); ini.GetValue( "Options", "AutoRestart", g_bAutoRestart ); ini.GetValue( "Options", "SignProfileData", m_bSignProfileData ); @@ -725,6 +727,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() const ini.SetValue( "Options", "HideDefaultNoteSkin", m_bHideDefaultNoteSkin ); ini.SetValue( "Options", "MaxHighScoresPerList", m_iMaxHighScoresPerList ); ini.SetValue( "Options", "PadStickSeconds", m_fPadStickSeconds ); + ini.SetValue( "Options", "HalveTextureHeight", m_bHalveTextureHeight ); ini.SetValue( "Options", "AutoRestart", g_bAutoRestart ); ini.SetValue( "Options", "SignProfileData", m_bSignProfileData ); diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index 966f635673..ecce8ead90 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -198,6 +198,11 @@ public: // after pressed. float m_fPadStickSeconds; + // For 8:3 displays (640x240 arcade monitors), every odd line of texels + // doesn't get drawn. This makes text look really ugly. So, squash all + // textures to half height to match the aspect ratio of the display. + float m_bHalveTextureHeight; + // If true, then signatures created when writing profile data // and verified when reading profile data. Leave this false if // you want to use a profile on different machines that don't diff --git a/stepmania/src/RageBitmapTexture.cpp b/stepmania/src/RageBitmapTexture.cpp index 217161df2d..627e445862 100644 --- a/stepmania/src/RageBitmapTexture.cpp +++ b/stepmania/src/RageBitmapTexture.cpp @@ -19,6 +19,7 @@ #include "RageDisplay.h" #include "RageTypes.h" #include "arch/ArchHooks/ArchHooks.h" +#include "PrefsManager.h" #include "SDL.h" #include "SDL_endian.h" @@ -178,6 +179,9 @@ apply_color_key: m_iImageWidth = min( m_iSourceWidth, actualID.iMaxSize ); m_iImageHeight = min( m_iSourceHeight, actualID.iMaxSize ); + if( PREFSMAN->m_bHalveTextureHeight ) + m_iImageHeight /= 2; + /* Texture dimensions need to be a power of two; jump to the next. */ m_iTextureWidth = power_of_two(m_iImageWidth); m_iTextureHeight = power_of_two(m_iImageHeight);