Fix a rounding bug that effected screenshots and resolutions.

Previously, you may have gotten values like 639x480 (4:3) or 853x480 (16:9).
These are due to rounding errors caused by lrintf; ceilf does what we really want.

[RageDisplay.cpp] modified screenshot function
[ScreenDimensions] modified SCREEN_WIDTH and SCREEN_HEIGHT algorithms (no longer do you need to SCREEN_WIDTH+1 for 16:9 support)
[StepMania.cpp] modified windowed mode width calculation
This commit is contained in:
AJ Kelly
2010-03-21 17:02:42 -05:00
parent e79835ee78
commit 54b6dffb75
3 changed files with 43 additions and 46 deletions
+3 -5
View File
@@ -103,11 +103,9 @@ void StepMania::GetPreferredVideoModeParams( VideoModeParams &paramsOut )
int iWidth = PREFSMAN->m_iDisplayWidth;
if( PREFSMAN->m_bWindowed )
{
/*
float fRatio = PREFSMAN->m_iDisplayWidth / PREFSMAN->m_iDisplayHeight;
iWidth = PREFSMAN->m_iDisplayHeight * fRatio;
*/
iWidth = PREFSMAN->m_iDisplayHeight * PREFSMAN->m_fDisplayAspectRatio;
//float fRatio = PREFSMAN->m_iDisplayWidth / PREFSMAN->m_iDisplayHeight;
//iWidth = PREFSMAN->m_iDisplayHeight * fRatio;
iWidth = ceilf(PREFSMAN->m_iDisplayHeight * PREFSMAN->m_fDisplayAspectRatio);
}
paramsOut = VideoModeParams(