summaryrefslogtreecommitdiff
path: root/src/port/Engine.cpp
diff options
context:
space:
mode:
authorKiloku <mateus.sateles@protonmail.com>2025-01-11 11:17:45 -0300
committerLywx <kiritodev01@gmail.com>2025-01-12 20:00:48 -0600
commit2d538fac86336d5c9d5cc4628f8e6a00583c2c09 (patch)
tree072c25814d3f3004b8d3c8ec18c4c83ebb4da938 /src/port/Engine.cpp
parent63fa98d02f5050a888d18999e2267d3208cd598d (diff)
use forced aspect ratio instead
Diffstat (limited to 'src/port/Engine.cpp')
-rw-r--r--src/port/Engine.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp
index eab38c3d..f7797ad5 100644
--- a/src/port/Engine.cpp
+++ b/src/port/Engine.cpp
@@ -547,12 +547,12 @@ extern "C" float OTRGetDimensionFromRightEdge(float v) {
(gfx_native_dimensions.width - v));
}
-extern "C" float OTRGetDimensionFromLeftEdgeCentered(float v) {
- return (gfx_native_dimensions.width / 2 - gfx_native_dimensions.height / 2 + (v));
+extern "C" float OTRGetDimensionFromLeftEdgeForcedAspect(float v, float aspectRatio) {
+ return (gfx_native_dimensions.width / 2 - gfx_native_dimensions.height / 2 * (aspectRatio > 0 ? aspectRatio : OTRGetAspectRatio()) + (v));
}
-extern "C" float OTRGetDimensionFromRightEdgeCentered(float v) {
- return (gfx_native_dimensions.width / 2 + gfx_native_dimensions.height / 2 -
+extern "C" float OTRGetDimensionFromRightEdgeForcedAspect(float v, float aspectRatio) {
+ return (gfx_native_dimensions.width / 2 + gfx_native_dimensions.height / 2 * (aspectRatio > 0 ? aspectRatio : OTRGetAspectRatio()) -
(gfx_native_dimensions.width - v));
}
// Gets the width of the current render target area
@@ -573,12 +573,12 @@ extern "C" int16_t OTRGetRectDimensionFromRightEdge(float v) {
return ((int) ceilf(OTRGetDimensionFromRightEdge(v)));
}
-extern "C" int16_t OTRGetRectDimensionFromLeftEdgeCentered(float v) {
- return ((int) floorf(OTRGetDimensionFromLeftEdgeCentered(v)));
+extern "C" int16_t OTRGetRectDimensionFromLeftEdgeForcedAspect(float v, float aspectRatio) {
+ return ((int) floorf(OTRGetDimensionFromLeftEdgeForcedAspect(v, aspectRatio)));
}
-extern "C" int16_t OTRGetRectDimensionFromRightEdgeCentered(float v) {
- return ((int) ceilf(OTRGetDimensionFromRightEdgeCentered(v)));
+extern "C" int16_t OTRGetRectDimensionFromRightEdgeForcedAspect(float v, float aspectRatio) {
+ return ((int) ceilf(OTRGetDimensionFromRightEdgeForcedAspect(v, aspectRatio)));
}
extern "C" int32_t OTRConvertHUDXToScreenX(int32_t v) {