aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Heider2010-04-20 18:24:14 +0000
committerAndre Heider2010-04-20 18:24:14 +0000
commitd1bb33fbacadf3fa7c45b5dc645b33fbda4b9fbf (patch)
tree709af7281b006e848883325b476efe764cbc4be0
parentdfc4f6ff08195625c1d664a25f47b6305819d87f (diff)
downloadscummvm-rg350-d1bb33fbacadf3fa7c45b5dc645b33fbda4b9fbf.tar.gz
scummvm-rg350-d1bb33fbacadf3fa7c45b5dc645b33fbda4b9fbf.tar.bz2
scummvm-rg350-d1bb33fbacadf3fa7c45b5dc645b33fbda4b9fbf.zip
Round up the game texture dimensions if the requested size is incompatible to the hardware.
svn-id: r48751
-rw-r--r--backends/platform/wii/osystem_gfx.cpp21
1 files changed, 17 insertions, 4 deletions
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;
}