diff options
author | rsn8887 | 2018-01-03 12:43:09 -0600 |
---|---|---|
committer | rsn8887 | 2018-01-03 14:14:36 -0600 |
commit | 231407206d91829980da18bfab2d0ae28b3fc9ad (patch) | |
tree | 94130d319d1ffa0e42577e11a6dd4b0542fb76df /backends/platform/psp | |
parent | 50d79c5f265aad592ae7f17209653ccbb1fde488 (diff) | |
download | scummvm-rg350-231407206d91829980da18bfab2d0ae28b3fc9ad.tar.gz scummvm-rg350-231407206d91829980da18bfab2d0ae28b3fc9ad.tar.bz2 scummvm-rg350-231407206d91829980da18bfab2d0ae28b3fc9ad.zip |
PSP: Use aspect correction checkbox instead of extra graphics modes
Diffstat (limited to 'backends/platform/psp')
-rw-r--r-- | backends/platform/psp/display_manager.cpp | 37 | ||||
-rw-r--r-- | backends/platform/psp/display_manager.h | 7 | ||||
-rw-r--r-- | backends/platform/psp/osys_psp.cpp | 3 |
3 files changed, 22 insertions, 25 deletions
diff --git a/backends/platform/psp/display_manager.cpp b/backends/platform/psp/display_manager.cpp index f8be51e4e9..3476e9f848 100644 --- a/backends/platform/psp/display_manager.cpp +++ b/backends/platform/psp/display_manager.cpp @@ -35,6 +35,8 @@ #include "backends/platform/psp/pspkeyboard.h" #include "backends/platform/psp/image_viewer.h" +#include "common/config-manager.h" + #define USE_DISPLAY_CALLBACK // to use callback for finishing the render #include "backends/platform/psp/display_manager.h" @@ -54,9 +56,8 @@ uint32 __attribute__((aligned(16))) MasterGuRenderer::_displayList[2048]; const OSystem::GraphicsMode DisplayManager::_supportedModes[] = { { "Original Resolution", "Original Resolution", ORIGINAL_RESOLUTION }, - { "Keep Aspect Ratio", "Keep Aspect Ratio", KEEP_ASPECT_RATIO }, - { "4:3 Aspect Ratio", "4:3 Aspect Ratio", ASPECT_RATIO_CORRECTION }, - { "Stretched Full Screen", "Stretched Full Screen", STRETCHED_FULL_SCREEN }, + { "Fit to Screen", "Fit to Screen", FIT_TO_SCREEN }, + { "Stretch to Screen", "Stretch to Screen", STRETCH_TO_SCREEN }, {0, 0, 0} }; @@ -365,32 +366,26 @@ void DisplayManager::calculateScaleParams() { _displayParams.screenOutput.height = _displayParams.screenSource.height; break; } - // else revert to keep aspect ratio - case KEEP_ASPECT_RATIO: { // maximize the height while keeping aspect ratio - float aspectRatio = (float)_displayParams.screenSource.width / (float)_displayParams.screenSource.height; + // else revert to fit to screen + case FIT_TO_SCREEN: { // maximize the height while keeping aspect ratio + float aspectRatio; + + if (ConfMan.getBool("aspect_ratio")) { + aspectRatio = 4.0f / 3.0f; + } else { + aspectRatio = (float)_displayParams.screenSource.width / (float)_displayParams.screenSource.height; + } - _displayParams.screenOutput.height = PSP_SCREEN_HEIGHT; // always full height + _displayParams.screenOutput.height = PSP_SCREEN_HEIGHT; // always full height _displayParams.screenOutput.width = (uint32)(PSP_SCREEN_HEIGHT * aspectRatio); if (_displayParams.screenOutput.width > PSP_SCREEN_WIDTH) { // shrink if wider than screen - _displayParams.screenOutput.height = (uint32) (((float) PSP_SCREEN_HEIGHT * (float) PSP_SCREEN_WIDTH) / (float) _displayParams.screenOutput.width); - _displayParams.screenOutput.width = PSP_SCREEN_WIDTH; - } - } - break; - case ASPECT_RATIO_CORRECTION: { // maximize the height while forcing 4:3 aspect ratio - float aspectRatio = 4.0f / 3.0f; - - _displayParams.screenOutput.height = PSP_SCREEN_HEIGHT; // always full height - _displayParams.screenOutput.width = (uint32)(PSP_SCREEN_HEIGHT * aspectRatio); - - if (_displayParams.screenOutput.width > PSP_SCREEN_WIDTH) { // // shrink if wider than screen - _displayParams.screenOutput.height = (uint32) (((float) PSP_SCREEN_HEIGHT * (float) PSP_SCREEN_WIDTH) / (float) _displayParams.screenOutput.width); + _displayParams.screenOutput.height = (uint32)(((float)PSP_SCREEN_HEIGHT * (float)PSP_SCREEN_WIDTH) / (float)_displayParams.screenOutput.width); _displayParams.screenOutput.width = PSP_SCREEN_WIDTH; } } break; - case STRETCHED_FULL_SCREEN: // we simply stretch to the whole screen + case STRETCH_TO_SCREEN: // we simply stretch to the whole screen _displayParams.screenOutput.width = PSP_SCREEN_WIDTH; _displayParams.screenOutput.height = PSP_SCREEN_HEIGHT; break; diff --git a/backends/platform/psp/display_manager.h b/backends/platform/psp/display_manager.h index ba11963f8c..e33328de4b 100644 --- a/backends/platform/psp/display_manager.h +++ b/backends/platform/psp/display_manager.h @@ -105,9 +105,8 @@ class DisplayManager { public: enum GraphicsModeID { ///> Possible output formats onscreen ORIGINAL_RESOLUTION, - KEEP_ASPECT_RATIO, - ASPECT_RATIO_CORRECTION, - STRETCHED_FULL_SCREEN + FIT_TO_SCREEN, + STRETCH_TO_SCREEN }; DisplayManager() : _screen(0), _cursor(0), _overlay(0), _keyboard(0), _imageViewer(0), _lastUpdateTime(0), _graphicsMode(0) {} @@ -119,7 +118,7 @@ public: bool setGraphicsMode(int mode); bool setGraphicsMode(const char *name); int getGraphicsMode() const { return _graphicsMode; } - uint32 getDefaultGraphicsMode() const { return KEEP_ASPECT_RATIO; } + uint32 getDefaultGraphicsMode() const { return FIT_TO_SCREEN; } const OSystem::GraphicsMode* getSupportedGraphicsModes() const { return _supportedModes; } // Setters for pointers diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index e31456fb70..7812f7df28 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -64,6 +64,9 @@ OSystem_PSP::~OSystem_PSP() {} void OSystem_PSP::initBackend() { DEBUG_ENTER_FUNC(); + ConfMan.registerDefault("aspect_ratio", false); + ConfMan.registerDefault("gfx_mode", "Fit to Screen"); + // Instantiate real time clock PspRtc::instance(); |