summaryrefslogtreecommitdiff
path: root/mm/2s2h/BenGui/BenMenu.cpp
diff options
context:
space:
mode:
authorJameriquiah <42100286+Jameriquiah@users.noreply.github.com>2026-07-21 22:22:35 -0400
committerGitHub <noreply@github.com>2026-07-21 22:22:35 -0400
commit65fb1b6e3cc49780057208f4050a160d1a4bdfc7 (patch)
treec0f2434ea2ee47c51cbb47ede559d4d5b318ec23 /mm/2s2h/BenGui/BenMenu.cpp
parentf86e04b4d5492906718aa7bacf5b92d55756006c (diff)
Bump LUS to port-maintenance (#1801)
* bump lus to port-maintenance * clang * remove redundant cast * clang again * update lus commit
Diffstat (limited to 'mm/2s2h/BenGui/BenMenu.cpp')
-rw-r--r--mm/2s2h/BenGui/BenMenu.cpp34
1 files changed, 19 insertions, 15 deletions
diff --git a/mm/2s2h/BenGui/BenMenu.cpp b/mm/2s2h/BenGui/BenMenu.cpp
index 2e143c126..81537b383 100644
--- a/mm/2s2h/BenGui/BenMenu.cpp
+++ b/mm/2s2h/BenGui/BenMenu.cpp
@@ -21,6 +21,9 @@
#include "2s2h/Rando/Rando.h"
#include "build.h"
+#include <fast/Fast3dGui.h>
+#include <fast/Fast3dWindow.h>
+
extern "C" {
#include "z64.h"
#include "functions.h"
@@ -356,7 +359,7 @@ void BenMenu::AddSettings() {
AddWidget(path, "Cursor Always Visible", WIDGET_CVAR_CHECKBOX)
.CVar("gSettings.CursorVisibility")
.Callback([](WidgetInfo& info) {
- Ship::Context::GetInstance()->GetWindow()->SetForceCursorVisibility(
+ Ship::Context::GetRawInstance()->GetWindow()->SetForceCursorVisibility(
CVarGetInteger("gSettings.CursorVisibility", 0));
})
.Options(CheckboxOptions().Tooltip("Makes the cursor always visible, even in full screen."));
@@ -385,7 +388,7 @@ void BenMenu::AddSettings() {
.Options(BtnSelectorOptions().DefaultValue(BTN_CUSTOM_MODIFIER2));
AddWidget(path, "Open App Files Folder", WIDGET_BUTTON)
.Callback([](WidgetInfo& info) {
- std::string filesPath = Ship::Context::GetInstance()->GetAppDirectoryPath();
+ std::string filesPath = Ship::Context::GetRawInstance()->GetAppDirectoryPath();
SDL_OpenURL(std::string("file:///" + std::filesystem::absolute(filesPath).string()).c_str());
})
.Options(ButtonOptions().Tooltip("Opens the folder that contains the save and mods folders, etc."));
@@ -414,8 +417,9 @@ void BenMenu::AddSettings() {
ImGui::SeparatorText("Thank You");
ImGui::PopStyleColor();
ImGui::SameLine();
- ImTextureID heartTextureId = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
- (const char*)gQuestIconHeartContainer2Tex);
+ ImTextureID heartTextureId =
+ std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetRawInstance()->GetWindow()->GetGui())
+ ->GetTextureByName((const char*)gQuestIconHeartContainer2Tex);
ImGui::Image(heartTextureId, ImVec2(25.0f, 25.0f));
ImGui::TextWrapped("Special thanks to our contributors, playtesters, artists, moderators, helpers, and "
"everyone in the larger decomp & N64 communities who make this project possible.\n\n");
@@ -523,12 +527,12 @@ void BenMenu::AddSettings() {
AddSidebarEntry("Settings", "Graphics", 3);
AddWidget(path, "Graphics Options", WIDGET_SEPARATOR_TEXT);
AddWidget(path, "Toggle Fullscreen", WIDGET_BUTTON)
- .Callback([](WidgetInfo& info) { Ship::Context::GetInstance()->GetWindow()->ToggleFullscreen(); })
+ .Callback([](WidgetInfo& info) { Ship::Context::GetRawInstance()->GetWindow()->ToggleFullscreen(); })
.Options(ButtonOptions().Tooltip("Toggles Fullscreen On/Off."));
AddWidget(path, "Internal Resolution: %.0f%%", WIDGET_CVAR_SLIDER_FLOAT)
.CVar(CVAR_INTERNAL_RESOLUTION)
.Callback([](WidgetInfo& info) {
- Ship::Context::GetInstance()->GetWindow()->SetResolutionMultiplier(
+ Ship::Context::GetRawInstance()->GetWindow()->SetResolutionMultiplier(
CVarGetFloat(CVAR_INTERNAL_RESOLUTION, 1));
})
.PreFunc([](WidgetInfo& info) {
@@ -553,7 +557,7 @@ void BenMenu::AddSettings() {
AddWidget(path, "Anti-aliasing (MSAA): %d", WIDGET_CVAR_SLIDER_INT)
.CVar(CVAR_MSAA_VALUE)
.Callback([](WidgetInfo& info) {
- Ship::Context::GetInstance()->GetWindow()->SetMsaaLevel(CVarGetInteger(CVAR_MSAA_VALUE, 1));
+ Ship::Context::GetRawInstance()->GetWindow()->SetMsaaLevel(CVarGetInteger(CVAR_MSAA_VALUE, 1));
})
.Options(
IntSliderOptions()
@@ -2051,7 +2055,7 @@ void BenMenu::AddDevTools() {
.ComboVec(&logLevels)
.DefaultIndex(defaultLogLevel))
.Callback([](WidgetInfo& info) {
- Ship::Context::GetInstance()->GetLogger()->set_level(
+ Ship::Context::GetRawInstance()->GetLogger()->set_level(
(spdlog::level::level_enum)CVarGetInteger("gDeveloperTools.LogLevel", defaultLogLevel));
})
.PreFunc([](WidgetInfo& info) { info.isHidden = mBenMenu->disabledMap.at(DISABLE_FOR_DEBUG_MODE_OFF).active; });
@@ -2227,29 +2231,29 @@ void BenMenu::InitElement() {
"Debug Mode is Disabled" } },
{ DISABLE_FOR_NO_VSYNC,
{ [](disabledInfo& info) -> bool {
- return !Ship::Context::GetInstance()->GetWindow()->CanDisableVerticalSync();
+ return !Ship::Context::GetRawInstance()->GetWindow()->CanDisableVerticalSync();
},
"Disabling VSync not supported" } },
{ DISABLE_FOR_NO_WINDOWED_FULLSCREEN,
{ [](disabledInfo& info) -> bool {
- return !Ship::Context::GetInstance()->GetWindow()->SupportsWindowedFullscreen();
+ return !Ship::Context::GetRawInstance()->GetWindow()->SupportsWindowedFullscreen();
},
"Windowed Fullscreen not supported" } },
{ DISABLE_FOR_NO_MULTI_VIEWPORT,
{ [](disabledInfo& info) -> bool {
- return !Ship::Context::GetInstance()->GetWindow()->GetGui()->SupportsViewports();
+ return !Ship::Context::GetRawInstance()->GetWindow()->GetGui()->SupportsViewports();
},
"Multi-viewports not supported" } },
{ DISABLE_FOR_NOT_DIRECTX,
{ [](disabledInfo& info) -> bool {
- return Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() !=
- Ship::WindowBackend::FAST3D_DXGI_DX11;
+ return Ship::Context::GetRawInstance()->GetWindow()->GetWindowBackend() !=
+ Fast::WindowBackend::FAST3D_DXGI_DX11;
},
"Available Only on DirectX" } },
{ DISABLE_FOR_DIRECTX,
{ [](disabledInfo& info) -> bool {
- return Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() ==
- Ship::WindowBackend::FAST3D_DXGI_DX11;
+ return Ship::Context::GetRawInstance()->GetWindow()->GetWindowBackend() ==
+ Fast::WindowBackend::FAST3D_DXGI_DX11;
},
"Not Available on DirectX" } },
{ DISABLE_FOR_MATCH_REFRESH_RATE_ON,