From 7957cc956e8bf66bd6f7a588d70150de70ef8917 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 20 Feb 2012 18:36:23 +0100 Subject: IPHONE: Use render buffer size instead of application frame size for video size calculations. These match as far as I can tell, but in case they don't match, the render buffer size should be the correct thing to use. --- backends/platform/iphone/iphone_video.m | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'backends') diff --git a/backends/platform/iphone/iphone_video.m b/backends/platform/iphone/iphone_video.m index 49c66a6a7d..a27234bc41 100644 --- a/backends/platform/iphone/iphone_video.m +++ b/backends/platform/iphone/iphone_video.m @@ -584,17 +584,17 @@ static void setFilterModeForTexture(GLuint tex, GraphicsModes mode) { _visibleHeight = _renderBufferHeight; _visibleWidth = _renderBufferWidth; - float ratioDifference = ((float)_height / (float)_width) / ((float)_fullWidth / (float)_fullHeight); + float ratioDifference = ((float)_height / (float)_width) / ((float)_renderBufferWidth / (float)_renderBufferHeight); int rectWidth, rectHeight; if (ratioDifference < 1.0f) { - rectWidth = _fullWidth * ratioDifference; - rectHeight = _fullHeight; - _widthOffset = (_fullWidth - rectWidth) / 2; + rectWidth = _renderBufferWidth * ratioDifference; + rectHeight = _renderBufferHeight; + _widthOffset = (_renderBufferWidth - rectWidth) / 2; _heightOffset = 0; } else { - rectWidth = _fullWidth; - rectHeight = _fullHeight / ratioDifference; - _heightOffset = (_fullHeight - rectHeight) / 2; + rectWidth = _renderBufferWidth; + rectHeight = _renderBufferHeight / ratioDifference; + _heightOffset = (_renderBufferHeight - rectHeight) / 2; _widthOffset = 0; } @@ -603,9 +603,9 @@ static void setFilterModeForTexture(GLuint tex, GraphicsModes mode) { _overlayPortraitRatio = 1.0f; } else { float ratio = (float)_height / (float)_width; - int height = _fullWidth * ratio; - //printf("Making rect (%u, %u)\n", _fullWidth, height); - _gameScreenRect = CGRectMake(0, 0, _fullWidth - 1, height - 1); + int height = _renderBufferWidth * ratio; + //printf("Making rect (%u, %u)\n", _renderBufferWidth, height); + _gameScreenRect = CGRectMake(0, 0, _renderBufferWidth - 1, height - 1); _visibleHeight = height; _visibleWidth = _renderBufferWidth; -- cgit v1.2.3