Coordinates are floats, but our maximum resolutions should always be

integers.

In 640x480 (4:3), with a 16:10 display, we were getting a 767.999939 width,
instead of 768, which truncated to 767.  Round the value consistently, so
we always get 768x480.
This commit is contained in:
Glenn Maynard
2006-03-17 02:52:00 +00:00
parent 2002bf820b
commit adae68f5f3
+2 -2
View File
@@ -39,7 +39,7 @@ float ScreenDimensions::GetScreenWidth()
if( fAspect > THEME_NATIVE_ASPECT )
fScale = fAspect / THEME_NATIVE_ASPECT;
ASSERT( fScale >= 1 );
return THEME_SCREEN_WIDTH * fScale;
return (float) lrintf(THEME_SCREEN_WIDTH * fScale);
}
float ScreenDimensions::GetScreenHeight()
@@ -49,7 +49,7 @@ float ScreenDimensions::GetScreenHeight()
if( fAspect < THEME_NATIVE_ASPECT )
fScale = THEME_NATIVE_ASPECT / fAspect;
ASSERT( fScale >= 1 );
return THEME_SCREEN_HEIGHT * fScale;
return (float) lrintf(THEME_SCREEN_HEIGHT * fScale);
}
void ScreenDimensions::ReloadScreenDimensions()