commit 588b09885d61da88b9e025bfecc705df59ba19c6
Author: jtothebell <j.to.the.bell@gmail.com>
AuthorDate: Wed Jun 23 18:52:41 2021 -0600
Commit: jtothebell <j.to.the.bell@gmail.com>
CommitDate: Wed Jun 23 18:52:41 2021 -0600
Add 4x3 modes to Vita, Switch, and Wii U
---
platform/SDL2Common/source/sdl2basehost.cpp | 14 ++++++++++++++
platform/wiiu/source/WiiUHost.cpp | 14 ++++++++++++++
source/host.h | 4 +++-
3 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/platform/SDL2Common/source/sdl2basehost.cpp b/platform/SDL2Common/source/sdl2basehost.cpp
index e663f5d..e8f5883 100644
--- a/platform/SDL2Common/source/sdl2basehost.cpp
+++ b/platform/SDL2Common/source/sdl2basehost.cpp
@@ -129,6 +129,14 @@ void _changeStretch(StretchOption newStretch){
_screenWidth = _maxNoStretchWidth;
_screenHeight = _maxNoStretchHeight;
}
+ else if (newStretch == FourByThreeVertPerfect) {
+ _screenWidth = _maxNoStretchHeight * 4 / 3;
+ _screenHeight = _maxNoStretchHeight;
+ }
+ else if (newStretch == FourByThreeStretch) {
+ _screenWidth = _windowHeight * 4 / 3;
+ _screenHeight = _windowHeight;
+ }
DestR.x = _windowWidth / 2 - _screenWidth / 2;
@@ -266,6 +274,12 @@ void Host::changeStretch(){
newStretch = StretchToFill;
}
else if (stretch == StretchToFill) {
+ newStretch = FourByThreeVertPerfect;
+ }
+ else if (stretch == FourByThreeVertPerfect) {
+ newStretch = FourByThreeStretch;
+ }
+ else if (stretch == FourByThreeStretch) {
newStretch = PixelPerfectStretch;
}
diff --git a/platform/wiiu/source/WiiUHost.cpp b/platform/wiiu/source/WiiUHost.cpp
index ab755ee..526e41b 100644
--- a/platform/wiiu/source/WiiUHost.cpp
+++ b/platform/wiiu/source/WiiUHost.cpp
@@ -150,6 +150,14 @@ void _changeStretch(StretchOption newStretch){
screenWidth = SCREEN_SIZE_X;
screenHeight = SCREEN_SIZE_Y;
}
+ else if (newStretch == FourByThreeVertPerfect) {
+ screenWidth = SCREEN_SIZE_Y * 4 / 3;
+ screenHeight = SCREEN_SIZE_Y;
+ }
+ else if (newStretch == FourByThreeStretch) {
+ screenWidth = WIN_HEIGHT * 4 / 3;
+ screenHeight = WIN_HEIGHT;
+ }
DestR.x = WIN_WIDTH / 2 - screenWidth / 2;
DestR.y = WIN_HEIGHT / 2 - screenHeight / 2;
@@ -289,6 +297,12 @@ void Host::changeStretch(){
stretch = StretchToFill;
}
else if (stretch == StretchToFill) {
+ stretch = FourByThreeVertPerfect;
+ }
+ else if (stretch == FourByThreeVertPerfect) {
+ stretch = FourByThreeStretch;
+ }
+ else if (stretch == FourByThreeStretch) {
stretch = PixelPerfectStretch;
}
diff --git a/source/host.h b/source/host.h
index e77e306..b02516d 100644
--- a/source/host.h
+++ b/source/host.h
@@ -13,7 +13,9 @@ enum StretchOption {
StretchToFill,
StretchAndOverflow,
AltScreenPixelPerfect,
- AltScreenStretch
+ AltScreenStretch,
+ FourByThreeVertPerfect,
+ FourByThreeStretch
};
class Host {