From d1bb33fbacadf3fa7c45b5dc645b33fbda4b9fbf Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Tue, 20 Apr 2010 18:24:14 +0000 Subject: Round up the game texture dimensions if the requested size is incompatible to the hardware. svn-id: r48751 --- backends/platform/wii/osystem_gfx.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'backends/platform') diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp index 8381e4b9c1..3d4e75883b 100644 --- a/backends/platform/wii/osystem_gfx.cpp +++ b/backends/platform/wii/osystem_gfx.cpp @@ -240,11 +240,24 @@ void OSystem_Wii::initSize(uint width, uint height, } #endif - if (_gameWidth != width || _gameHeight != height) { - assert((width <= 640) && (height <= 480)); + uint newWidth, newHeight; + if (_pfGame.bytesPerPixel > 1) { + newWidth = ROUNDUP(width, 4); + newHeight = ROUNDUP(height, 4); + } else { + newWidth = ROUNDUP(width, 8); + newHeight = ROUNDUP(height, 4); + } + + if (_gameWidth != newWidth || _gameHeight != newHeight) { + assert((newWidth <= 640) && (newHeight <= 480)); + + if (width != newWidth || height != newHeight) + printf("extending texture for compability: %ux%u -> %ux%u\n", + width, height, newWidth, newHeight); - _gameWidth = width; - _gameHeight = height; + _gameWidth = newWidth; + _gameHeight = newHeight; update = true; } -- cgit v1.2.3