diff options
author | Andre Heider | 2008-08-11 22:43:00 +0000 |
---|---|---|
committer | Andre Heider | 2008-08-11 22:43:00 +0000 |
commit | 15ca9704989347a65c8c883f7d6a9337e5d8e7d5 (patch) | |
tree | ab9efe3bd61d0374043f680ae3998693f784b82a /backends/platform/wii/osystem_gfx.cpp | |
parent | 36e0d2eab8bc920d337d8e6f1436e057049ffac6 (diff) | |
download | scummvm-rg350-15ca9704989347a65c8c883f7d6a9337e5d8e7d5.tar.gz scummvm-rg350-15ca9704989347a65c8c883f7d6a9337e5d8e7d5.tar.bz2 scummvm-rg350-15ca9704989347a65c8c883f7d6a9337e5d8e7d5.zip |
video mode polishing:
* proper fullscreen video mode
* multiple graphic modes with different overscan values
* "fullscreen mode" stretches the picture on 16:9 displays
* fixed broken sword 1/2 gfx garbage
* support for setShakePos()
svn-id: r33787
Diffstat (limited to 'backends/platform/wii/osystem_gfx.cpp')
-rw-r--r-- | backends/platform/wii/osystem_gfx.cpp | 75 |
1 files changed, 59 insertions, 16 deletions
diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp index 1e54233c93..faad41d5f0 100644 --- a/backends/platform/wii/osystem_gfx.cpp +++ b/backends/platform/wii/osystem_gfx.cpp @@ -27,7 +27,12 @@ #define MAX_FPS 30 enum GraphicModeID { - GM_DEFAULT + GM_DEFAULT = 0, + GM_OVERSCAN1, + GM_OVERSCAN2, + GM_OVERSCAN3, + GM_OVERSCAN4, + GM_OVERSCAN5 }; void OSystem_Wii::initGfx() { @@ -42,6 +47,11 @@ void OSystem_Wii::initGfx() { _overlayWidth = 640; _overlayHeight = 480; +#ifndef GAMECUBE + if (CONF_GetAspectRatio() && _fullscreen) + _overlayHeight = 360; +#endif + _overlaySize = _overlayWidth * _overlayHeight * 2; _overlayPixels = (OverlayColor *) memalign(32, _overlaySize); @@ -51,17 +61,32 @@ void OSystem_Wii::initGfx() { _cursorPalette = (u16 *) memalign(32, 256 * 2); memset(_cursorPalette, 0, 256 * 2); - _supportedGraphicsModes = new OSystem::GraphicsMode[2]; - _supportedGraphicsModes[0].name = strdup("gx"); - _supportedGraphicsModes[0].description = strdup("wii hardware scaler"); + _supportedGraphicsModes = new OSystem::GraphicsMode[7]; + _supportedGraphicsModes[0].name = strdup("standard"); + _supportedGraphicsModes[0].description = strdup("standard"); _supportedGraphicsModes[0].id = GM_DEFAULT; - _supportedGraphicsModes[1].name = 0; - _supportedGraphicsModes[1].description = 0; - _supportedGraphicsModes[1].id = 0; - - _texture = (u16 *) memalign(32, _overlaySize); - - GX_Start(_overlayWidth, _overlayHeight, 320, 240); + _supportedGraphicsModes[1].name = strdup("overscan1"); + _supportedGraphicsModes[1].description = strdup("overscan 1"); + _supportedGraphicsModes[1].id = GM_OVERSCAN1; + _supportedGraphicsModes[2].name = strdup("overscan2"); + _supportedGraphicsModes[2].description = strdup("overscan 2"); + _supportedGraphicsModes[2].id = GM_OVERSCAN2; + _supportedGraphicsModes[3].name = strdup("overscan3"); + _supportedGraphicsModes[3].description = strdup("overscan 3"); + _supportedGraphicsModes[3].id = GM_OVERSCAN3; + _supportedGraphicsModes[4].name = strdup("overscan4"); + _supportedGraphicsModes[4].description = strdup("overscan 4"); + _supportedGraphicsModes[4].id = GM_OVERSCAN4; + _supportedGraphicsModes[5].name = strdup("overscan5"); + _supportedGraphicsModes[5].description = strdup("overscan 5"); + _supportedGraphicsModes[5].id = GM_OVERSCAN5; + _supportedGraphicsModes[6].name = 0; + _supportedGraphicsModes[6].description = 0; + _supportedGraphicsModes[6].id = 0; + + _texture = (u16 *) memalign(32, 640 * 480 * 2); + + setGraphicsMode(_activeGraphicsMode); } void OSystem_Wii::deinitGfx() { @@ -111,13 +136,24 @@ int OSystem_Wii::getDefaultGraphicsMode() const { return GM_DEFAULT; } -bool OSystem_Wii::setGraphicsMode(const char *mode) { - setGraphicsMode(GM_DEFAULT); +bool OSystem_Wii::setGraphicsMode(int mode) { + s16 xar, yar; - return true; -} + printf("setGraphicsMode %d\n", mode); + + xar = vmode->viWidth / 2; + yar = vmode->xfbHeight / 2; + +#ifndef GAMECUBE + if (CONF_GetAspectRatio() && !_fullscreen) + xar /= 1.33f; +#endif + + GX_SetCamPosZ(400 - mode * 10); + GX_Start(640, 480, xar, yar); + + _activeGraphicsMode = mode; -bool OSystem_Wii::setGraphicsMode(int mode) { return true; } @@ -129,6 +165,8 @@ void OSystem_Wii::initSize(uint width, uint height) { if (_gameWidth != width || _gameHeight != height) { printf("initSize %u %u\n", width, height); + assert((width <= 640) && (height <= 480)); + _gameWidth = width; _gameHeight = height; @@ -136,12 +174,15 @@ void OSystem_Wii::initSize(uint width, uint height) { free(_gamePixels); _gamePixels = (u8 *) memalign(32, _gameWidth * _gameHeight); + memset(_gamePixels, 0, _gameWidth * _gameHeight); if (!_overlayVisible) { _currentWidth = _gameWidth; _currentHeight = _gameHeight; updateEventScreenResolution(); } + + setGraphicsMode(_activeGraphicsMode); } } @@ -320,6 +361,8 @@ void OSystem_Wii::unlockScreen() { } void OSystem_Wii::setShakePos(int shakeOffset) { + GX_SetTexTrans(0, (float) -shakeOffset * ((float) vmode->efbHeight / + (float) _currentHeight)); } void OSystem_Wii::showOverlay() { |