Sanity check for SdlVideoResizeKeepAspect.

This commit is contained in:
Sergii Pylypenko
2013-11-20 23:22:56 +02:00
parent c2c958c91c
commit 784ddc3520
7 changed files with 8 additions and 7 deletions

View File

@@ -47,7 +47,7 @@ SwVideoMode=y
SdlVideoResize=y
# Application resizing will keep 4:3 aspect ratio, with black bars at sides (y)/(n)
SdlVideoResizeKeepAspect=n
SdlVideoResizeKeepAspect=y
CompatibilityHacksProperUsageOfSDL_UpdateRects=y

View File

@@ -26,7 +26,7 @@
----------------------------------------------------------*/
#define SCREEN_W 640
#define SCREEN_H 480
#define SCREEN_H 256
#define BALLS 300

View File

@@ -388,7 +388,8 @@ SDL_Surface *ANDROID_SetVideoMode(_THIS, SDL_Surface *current,
SDL_ANDROID_sWindowHeight = SDL_ANDROID_sRealWindowHeight;
SDL_ANDROID_ForceClearScreenRectAmount = 0;
if( SDL_ANDROID_ScreenKeep43Ratio )
if( SDL_ANDROID_ScreenKeep43Ratio &&
(float)width / (float)height < (float)SDL_ANDROID_sWindowWidth / (float)SDL_ANDROID_sWindowHeight )
{
SDL_ANDROID_sWindowWidth = (SDL_ANDROID_sFakeWindowWidth * SDL_ANDROID_sRealWindowHeight) / SDL_ANDROID_sFakeWindowHeight;
SDL_ANDROID_TouchscreenCalibrationWidth = SDL_ANDROID_sWindowWidth;