summaryrefslogtreecommitdiff
path: root/src/port/ui/ResolutionEditor.cpp
diff options
context:
space:
mode:
authorAlejandro Asenjo Nitti <96613413+sonicdcer@users.noreply.github.com>2025-04-18 03:22:13 -0400
committerGitHub <noreply@github.com>2025-04-18 04:22:13 -0300
commit54a4d76b6ffd6b276a951224b62881fa6c4ff9a9 (patch)
tree65038ecdf0c1e9448be765ae2d67cadf75ec5414 /src/port/ui/ResolutionEditor.cpp
parenta4a465151ae6eb5a3ce92c821bc00bea105ab8b1 (diff)
Bump LUS (#191)
* Bump LUS (#190) * Bump LUS * Disabled shader-based linear conversion on metal * Fixed missing mInterpolationIndex * Bump LUS --------- Co-authored-by: KiritoDv <kiritodev01@gmail.com> * restore console * bump LUS * Reverted linear conversion on shader --------- Co-authored-by: KiritoDv <kiritodev01@gmail.com>
Diffstat (limited to 'src/port/ui/ResolutionEditor.cpp')
-rw-r--r--src/port/ui/ResolutionEditor.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/port/ui/ResolutionEditor.cpp b/src/port/ui/ResolutionEditor.cpp
index cac3b8be..cc78edaf 100644
--- a/src/port/ui/ResolutionEditor.cpp
+++ b/src/port/ui/ResolutionEditor.cpp
@@ -1,10 +1,11 @@
#include "ResolutionEditor.h"
#include "UIWidgets.h"
#include "libultraship/src/Context.h"
+#include "port/Engine.h"
#include <imgui.h>
#include <libultraship/libultraship.h>
-#include <graphic/Fast3D/gfx_pc.h>
+#include <graphic/Fast3D/interpreter.h>
/* Console Variables are grouped under gAdvancedResolution. (e.g. "gAdvancedResolution.Enabled")
@@ -59,6 +60,7 @@ namespace AdvancedResolutionSettings {
for (unsigned short i = 0; i < sizeof(setting); i++)
update[i] = false;
static short updateCountdown = 0;
+ auto interpreter = GameEngine_GetInterpreter();
short countdownStartingValue = CVarGetInteger("gInterpolationFPS", 60) / 2; // half of a second, in frames.
// Initialise integer scale bounds.
@@ -67,13 +69,13 @@ namespace AdvancedResolutionSettings {
short integerScale_maximumBounds = 1; // can change when window is resized
// This is mostly just for UX purposes, as Fit Automatically logic is part of LUS.
- if (((float)gfx_current_game_window_viewport.width / gfx_current_game_window_viewport.height) >
- ((float)gfx_current_dimensions.width / gfx_current_dimensions.height)) {
+ if (((float)interpreter->mGameWindowViewport.width / interpreter->mGameWindowViewport.height) >
+ ((float)interpreter->mCurDimensions.width / interpreter->mCurDimensions.height)) {
// Scale to window height
- integerScale_maximumBounds = gfx_current_game_window_viewport.height / gfx_current_dimensions.height;
+ integerScale_maximumBounds = interpreter->mGameWindowViewport.height / interpreter->mCurDimensions.height;
} else {
// Scale to window width
- integerScale_maximumBounds = gfx_current_game_window_viewport.width / gfx_current_dimensions.width;
+ integerScale_maximumBounds = interpreter->mGameWindowViewport.width / interpreter->mCurDimensions.width;
}
// Lower-clamping maximum bounds value to 1 is no-longer necessary as that's accounted for in LUS.
// Letting it go below 1 in this Editor will even allow for checking if screen bounds are being exceeded.
@@ -136,9 +138,9 @@ namespace AdvancedResolutionSettings {
}
}
// Resolution visualiser
- ImGui::Text("Viewport dimensions: %d x %d", gfx_current_game_window_viewport.width,
- gfx_current_game_window_viewport.height);
- ImGui::Text("Internal resolution: %d x %d", gfx_current_dimensions.width, gfx_current_dimensions.height);
+ ImGui::Text("Viewport dimensions: %d x %d", interpreter->mGameWindowViewport.width,
+ interpreter->mGameWindowViewport.height);
+ ImGui::Text("Internal resolution: %d x %d", interpreter->mCurDimensions.width, interpreter->mCurDimensions.height);
UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f);
@@ -171,7 +173,7 @@ namespace AdvancedResolutionSettings {
} else if (showHorizontalResField) { // Show calculated aspect ratio
if (item_aspectRatio) {
UIWidgets::Spacer(2);
- float resolvedAspectRatio = (float)gfx_current_dimensions.height / gfx_current_dimensions.width;
+ float resolvedAspectRatio = (float)interpreter->mCurDimensions.height / interpreter->mCurDimensions.width;
ImGui::Text("Aspect ratio: %.4f", resolvedAspectRatio);
} else {
UIWidgets::Spacer(enhancementSpacerHeight);