summaryrefslogtreecommitdiff
path: root/src/port/ui/PortMenu.cpp
diff options
context:
space:
mode:
authorMegaMech <MegaMech@users.noreply.github.com>2025-06-07 21:38:12 -0600
committerGitHub <noreply@github.com>2025-06-07 21:38:12 -0600
commit44db9bab773cc3b14c8f944a9411673b6fe08b01 (patch)
tree8ad796dac5ec3f42eca1220efe1e054b576374e8 /src/port/ui/PortMenu.cpp
parenta67fbb6442d76016397c67f2cb7831687cdda91a (diff)
Add Interpolation (#204)
* initial work * more work * progress * Fixed slow fps * Add Lywx changes * Interp Works * Test default tick/logic update * Added missing include (#202) * Added missing include * More missing includes --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * test * Revert "test" This reverts commit 1a810d74cc8531ce486bcb1c399cc6798fa1b51d. * Interp Item box * Actually interpolate item box * fix clouds * interp player? * Test 2 * Fix mistake * tag and fix item boxes * tag fake item box and whatever func_800696CC is * these aren't needed * tag karts * Slightly better falling rocks(still needs work) * Tag Smoke and Dust * Removed unneeded code from falling_rock * tag whatever func_80051ABC is * add missing rotate x coord * GrandPrixBallon/kart shadow * Green shells tag, and added comments I neglected to add before. * doesn't compile on win * Fixes * Disabled camera interpolation * Balloons fixes * progress * set_transform_matrix compiles * Compile setTransformMatrix * More transforms interp * Add more interps * matrix * Matrix multi interp * Fix interpolation camera bug * Missing includes needed for Linux. * Excluded access to HM64 Labs on Switch. * interpolation tags for various objects * Bowser castle statue flame interpolated. * tag hedgehogs * cloud interpolation * Interpolated smoke particles from shells * cloud interpolation refactor * Interpolated snowflakes * Interpolated penguins, also added comment tags to places I missed. * tag Snowman interpolation * Interpolated player reflection(sherbet land) * Forgot to uncomment stuff while testing * better tag * tag leaves * Set the default FPS to 30 * tag hud * Fixed "Match Refresh Rate" option * adjust draw distance * remove innecessary rock tag * rag rocks * better tag * Tagged player rank placement in HUD * Tagged Bat, Boos, and TrashBin(Banshee Boardwalk objects) * Refactor render_screens and fix editor raycast * better object interpolation * shift is not needed here * fix tag * fix tags * mole comments * comment * Changed how shell flames are interpolated. * interpolated ended scene fireworks. * Tagged star particles in the ending scene * Shell flames handled better. * this isn't needed * Fix multiplayer cameras * Fixed loading battle maps. * Tagged battle balloons * Some fixes for battle mode * No longer needed changes toAFinishline with the changes mega made. * Tag finishline * fix to make it compile with cmake 3.31 * changed mtxf_multiplication() to fix vert explosion in Desert & DK parkway.(provided by Coco.) * fix memory leaks, avoid invalidate texture (#207) * Fixed macos * More stupid fixes * update with main and update torch and lus and enable action on this branch * Update FrameInterpolation.h * Update FrameInterpolation.cpp * fix some memory leak * Update torch * Update torch * update torch and lus * reduce texture import * don't use fork of torch and lus * Update torch * Update torch --------- Co-authored-by: Lywx <kiritodev01@gmail.com> * Refactor World::Courses to unique_ptr (#211) * wip course unique ptr * Track unique_ptr : This probably compiles * Finish impl Courses as unique_ptr * Fix error * Fixes * More fixes * Cleanup * Remove old vars --------- Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com> * particle boat and train * fix player particle interpolation * add modify interpolation target fps in menu * fix windows * Update libultraship * Fix logo interp * Interp SetTextMatrix * Fix freecam camera * Clarify comment * Clarify func * fix linux compilation * Update Thwomp.cpp * Update Thwomp.h * Update render.inc.c * Update render.inc.c * Update gbiMacro.c * interp falling rock shadow * Revert change that has no explanation * Update code_80057C60.c * Update code_80057C60.c * Update GrandPrixBalloons.cpp * Update Lakitu.cpp * Update framebuffer_effects.c * Update render_courses.c --------- Co-authored-by: Sonic Dreamcaster <alejandro.asenjo88@gmail.com> Co-authored-by: KiritoDv <kiritodev01@gmail.com> Co-authored-by: sitton76 <58642183+sitton76@users.noreply.github.com> Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com> Co-authored-by: coco875 <59367621+coco875@users.noreply.github.com> Co-authored-by: coco875 <pereira.jannin@gmail.com>
Diffstat (limited to 'src/port/ui/PortMenu.cpp')
-rw-r--r--src/port/ui/PortMenu.cpp149
1 files changed, 84 insertions, 65 deletions
diff --git a/src/port/ui/PortMenu.cpp b/src/port/ui/PortMenu.cpp
index b21ddc1fa..3c2e61db2 100644
--- a/src/port/ui/PortMenu.cpp
+++ b/src/port/ui/PortMenu.cpp
@@ -15,10 +15,10 @@
#endif
extern "C" {
- extern s32 gGamestateNext;
- extern s32 gMenuSelection;
- #include "audio/external.h"
- #include "defines.h"
+extern s32 gGamestateNext;
+extern s32 gMenuSelection;
+#include "audio/external.h"
+#include "defines.h"
}
namespace GameUI {
@@ -158,9 +158,8 @@ void PortMenu::AddSettings() {
.IsPercentage());
AddWidget(path, "Main Music Volume: %.0f%%", WIDGET_CVAR_SLIDER_FLOAT)
.CVar("gMainMusicVolume")
- .Callback([](WidgetInfo& info) {
- audio_set_player_volume(SEQ_PLAYER_LEVEL, CVarGetFloat("gMainMusicVolume", 1.0f));
- })
+ .Callback(
+ [](WidgetInfo& info) { audio_set_player_volume(SEQ_PLAYER_LEVEL, CVarGetFloat("gMainMusicVolume", 1.0f)); })
.Options(FloatSliderOptions()
.Tooltip("Adjust the background music volume.")
.ShowButtons(false)
@@ -168,16 +167,17 @@ void PortMenu::AddSettings() {
.IsPercentage());
AddWidget(path, "Sound Effects Volume: %.0f%%", WIDGET_CVAR_SLIDER_FLOAT)
.CVar("gSFXMusicVolume")
- .Callback([](WidgetInfo& info) {
- audio_set_player_volume(SEQ_PLAYER_SFX, CVarGetFloat("gSFXMusicVolume", 1.0f));
- })
- .Options(
- FloatSliderOptions().Tooltip("Adjust the sound effects volume.").ShowButtons(false).Format("").IsPercentage());
+ .Callback(
+ [](WidgetInfo& info) { audio_set_player_volume(SEQ_PLAYER_SFX, CVarGetFloat("gSFXMusicVolume", 1.0f)); })
+ .Options(FloatSliderOptions()
+ .Tooltip("Adjust the sound effects volume.")
+ .ShowButtons(false)
+ .Format("")
+ .IsPercentage());
AddWidget(path, "Sound Effects Volume: %.0f%%", WIDGET_CVAR_SLIDER_FLOAT)
.CVar("gEnvironmentVolume")
- .Callback([](WidgetInfo& info) {
- audio_set_player_volume(SEQ_PLAYER_ENV, CVarGetFloat("gEnvironmentVolume", 1.0f));
- })
+ .Callback(
+ [](WidgetInfo& info) { audio_set_player_volume(SEQ_PLAYER_ENV, CVarGetFloat("gEnvironmentVolume", 1.0f)); })
.Options(FloatSliderOptions()
.Tooltip("Adjust the environment volume.")
.ShowButtons(false)
@@ -244,25 +244,25 @@ void PortMenu::AddSettings() {
.DefaultValue(1));
#endif
- // AddWidget(path, "Current FPS: %d", WIDGET_CVAR_SLIDER_INT)
- // .CVar("gInterpolationFPS")
- // .Callback([](WidgetInfo& info) {
- // int32_t defaultValue = std::static_pointer_cast<IntSliderOptions>(info.options)->defaultValue;
- // if (CVarGetInteger(info.cVar, defaultValue) == defaultValue) {
- // info.name = "Current FPS: Original (%d)";
- // } else {
- // info.name = "Current FPS: %d";
- // }
- // })
- // .PreFunc([](WidgetInfo& info) {
- // if (mPortMenu->disabledMap.at(DISABLE_FOR_MATCH_REFRESH_RATE_ON).active)
- // info.activeDisables.push_back(DISABLE_FOR_MATCH_REFRESH_RATE_ON);
- // })
- // .Options(IntSliderOptions().Tooltip(tooltip).Min(20).Max(maxFps).DefaultValue(20));
+ AddWidget(path, "Current FPS: %d", WIDGET_CVAR_SLIDER_INT)
+ .CVar("gInterpolationFPS")
+ .Callback([](WidgetInfo& info) {
+ int32_t defaultValue = std::static_pointer_cast<IntSliderOptions>(info.options)->defaultValue;
+ if (CVarGetInteger(info.cVar, defaultValue) == defaultValue) {
+ info.name = "Current FPS: Original (%d)";
+ } else {
+ info.name = "Current FPS: %d";
+ }
+ })
+ .PreFunc([](WidgetInfo& info) {
+ if (mPortMenu->disabledMap.at(DISABLE_FOR_MATCH_REFRESH_RATE_ON).active)
+ info.activeDisables.push_back(DISABLE_FOR_MATCH_REFRESH_RATE_ON);
+ })
+ .Options(IntSliderOptions().Tooltip(tooltip).Min(30).Max(maxFps).DefaultValue(30));
AddWidget(path, "Match Refresh Rate", WIDGET_BUTTON)
.Callback([](WidgetInfo& info) {
int hz = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate();
- if (hz >= 20 && hz <= 360) {
+ if (hz >= 30 && hz <= 360) {
CVarSetInteger("gInterpolationFPS", hz);
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
@@ -332,31 +332,36 @@ void PortMenu::AddEnhancements() {
AddMenuEntry("Enhancements", "gSettings.Menu.EnhancementsSidebarSection");
WidgetPath path = { "Enhancements", "General", SECTION_COLUMN_1 };
AddSidebarEntry("Enhancements", "General", 3);
- //UIWidgets::WindowButton("Multiplayer", "gMultiplayerWindowEnabled", GameUI::mMultiplayerWindow,
- // { .tooltip = "Shows the multiplayer window" });
- // UIWidgets::WindowButton("Freecam", "gFreecam", GameUI::mFreecamWindow,
- // { .tooltip = "Allows you to fly around the course" });
+ // UIWidgets::WindowButton("Multiplayer", "gMultiplayerWindowEnabled", GameUI::mMultiplayerWindow,
+ // { .tooltip = "Shows the multiplayer window" });
+ // UIWidgets::WindowButton("Freecam", "gFreecam", GameUI::mFreecamWindow,
+ // { .tooltip = "Allows you to fly around the course" });
AddWidget(path, "No multiplayer feature cuts", WIDGET_CVAR_CHECKBOX)
.CVar("gMultiplayerNoFeatureCuts")
.Options(CheckboxOptions().Tooltip("Allows full train and jumbotron in multiplayer, etc."));
AddWidget(path, "General Improvements", WIDGET_CVAR_CHECKBOX)
- .CVar("gImprovements").Options(CheckboxOptions().Tooltip("General improvements to the game experience."));
+ .CVar("gImprovements")
+ .Options(CheckboxOptions().Tooltip("General improvements to the game experience."));
AddWidget(path, "No Level of Detail (LOD)", WIDGET_CVAR_CHECKBOX)
.CVar("gDisableLod")
- .Options(CheckboxOptions().Tooltip("Disable Level of Detail (LOD) to avoid models using lower poly versions at a distance"));
+ .Options(CheckboxOptions().Tooltip(
+ "Disable Level of Detail (LOD) to avoid models using lower poly versions at a distance"));
AddWidget(path, "Disable Culling", WIDGET_CVAR_CHECKBOX)
- .CVar("gNoCulling").Options(CheckboxOptions().Tooltip("Disable original culling of mk64"));
+ .CVar("gNoCulling")
+ .Options(CheckboxOptions().Tooltip("Disable original culling of mk64"));
AddWidget(path, "Far Frustrum", WIDGET_CVAR_SLIDER_FLOAT)
.CVar("gFarFrustrum")
- .Options(FloatSliderOptions().Min(0.0f).Max(10000.0f).DefaultValue(10000.0f)
- .Tooltip("Say how Far the Frustrum are when 'Disable Culling' are enable").Step(10.0f));
+ .Options(FloatSliderOptions()
+ .Min(0.0f)
+ .Max(10000.0f)
+ .DefaultValue(10000.0f)
+ .Tooltip("Say how Far the Frustrum are when 'Disable Culling' are enable")
+ .Step(10.0f));
path = { "Enhancements", "Cheats", SECTION_COLUMN_1 };
AddSidebarEntry("Enhancements", "Cheats", 3);
- AddWidget(path, "Moon Jump", WIDGET_CVAR_CHECKBOX)
- .CVar("gEnableMoonJump");
- AddWidget(path, "Enable Custom CC", WIDGET_CVAR_CHECKBOX)
- .CVar("gEnableCustomCC");
+ AddWidget(path, "Moon Jump", WIDGET_CVAR_CHECKBOX).CVar("gEnableMoonJump");
+ AddWidget(path, "Enable Custom CC", WIDGET_CVAR_CHECKBOX).CVar("gEnableCustomCC");
AddWidget(path, "Custom CC", WIDGET_CVAR_SLIDER_FLOAT)
.CVar("gCustomCC")
.Options(FloatSliderOptions().Min(0.0f).Max(1000.0f).DefaultValue(150.0f).Step(10.0f));
@@ -365,21 +370,23 @@ void PortMenu::AddEnhancements() {
.Options(CheckboxOptions().Tooltip("Disable wall collision."));
AddWidget(path, "Min Height", WIDGET_CVAR_SLIDER_FLOAT)
.CVar("gMinHeight")
- .Options(FloatSliderOptions().Min(-50.0f).Max(50.0f).DefaultValue(0.0f)
- .Tooltip("When Disable Wall Collision are enable what is the minimal height you can get."));
+ .Options(FloatSliderOptions().Min(-50.0f).Max(50.0f).DefaultValue(0.0f).Tooltip(
+ "When Disable Wall Collision are enable what is the minimal height you can get."));
+#if not defined(__SWITCH__) and not defined(__WIIU__)
path = { "Enhancements", "HM64 Lab", SECTION_COLUMN_1 };
AddSidebarEntry("Enhancements", "HM64 Lab", 4);
AddWidget(path, "Enable HM64 Labs", WIDGET_CVAR_CHECKBOX)
- .CVar("gEditorEnabled")
- .Callback([](WidgetInfo& info) {
- Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Tools")->ToggleVisibility();
- Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Scene Explorer")->ToggleVisibility();
- Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Content Browser")->ToggleVisibility();
- Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Track Properties")->ToggleVisibility();
- Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Properties")->ToggleVisibility();
- })
- .Options(UIWidgets::CheckboxOptions({{ .tooltip = "Edit the universe!"}}));
+ .CVar("gEditorEnabled")
+ .Callback([](WidgetInfo& info) {
+ Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Tools")->ToggleVisibility();
+ Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Scene Explorer")->ToggleVisibility();
+ Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Content Browser")->ToggleVisibility();
+ Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Track Properties")->ToggleVisibility();
+ Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Properties")->ToggleVisibility();
+ })
+ .Options(UIWidgets::CheckboxOptions({ { .tooltip = "Edit the universe!" } }));
+#endif
}
#ifdef __SWITCH__
@@ -400,11 +407,11 @@ void PortMenu::AddDevTools() {
WidgetPath path = { "Developer", "General", SECTION_COLUMN_1 };
#ifdef __SWITCH__
AddWidget(path, "Switch CPU Profile", WIDGET_CVAR_COMBOBOX)
- .CVar("gSwitchPerfMode")
- .Options(ComboboxOptions()
- .Tooltip("Switches the CPU profile to a different one")
- .ComboMap(switchCPUProfiles)
- .DefaultIndex(Ship::SwitchProfiles::STOCK))
+ .CVar("gSwitchPerfMode")
+ .Options(ComboboxOptions()
+ .Tooltip("Switches the CPU profile to a different one")
+ .ComboMap(switchCPUProfiles)
+ .DefaultIndex(Ship::SwitchProfiles::STOCK))
.Callback([](WidgetInfo& info) { Ship::Switch::ApplyOverclock(); });
#endif
AddWidget(path, "Popout Menu", WIDGET_CVAR_CHECKBOX)
@@ -413,6 +420,17 @@ void PortMenu::AddDevTools() {
AddWidget(path, "Debug Mode", WIDGET_CVAR_CHECKBOX)
.CVar("gEnableDebugMode")
.Options(CheckboxOptions().Tooltip("Enables Debug Mode."));
+ AddWidget(path, "Modify Interpolation Target FPS", WIDGET_CVAR_CHECKBOX)
+ .CVar("gModifyInterpolationTargetFPS")
+ .Options(CheckboxOptions().Tooltip("Enables Debug Mode."));
+ AddWidget(path, "Interpolation Target FPS", WIDGET_CVAR_SLIDER_INT)
+ .CVar("gInterpolationTargetFPS")
+ .PreFunc([](WidgetInfo& info) { info.isHidden = !CVarGetInteger("gModifyInterpolationTargetFPS", 0); })
+ .Options(IntSliderOptions()
+ .Tooltip("Sets the target FPS for interpolation. When Modify Interpolation Target FPS are enable")
+ .Min(15)
+ .Max(360)
+ .DefaultValue(60));
AddWidget(path, "Render Collision", WIDGET_CVAR_CHECKBOX)
.CVar("gRenderCollisionMesh")
.Options(CheckboxOptions().Tooltip("Renders the collision mesh instead of the course mesh"));
@@ -429,7 +447,8 @@ void PortMenu::AddDevTools() {
AddSidebarEntry("Developer", "Stats", 1);
AddWidget(path, "Popout Stats", WIDGET_WINDOW_BUTTON)
.CVar("gStatsEnabled")
- .Options(ButtonOptions().Tooltip("Shows the stats window, with your FPS and frametimes, and the OS you're playing on"))
+ .Options(ButtonOptions().Tooltip(
+ "Shows the stats window, with your FPS and frametimes, and the OS you're playing on"))
.WindowName("Stats");
path = { "Developer", "Console", SECTION_COLUMN_1 };
@@ -445,9 +464,9 @@ PortMenu::PortMenu(const std::string& consoleVariable, const std::string& name)
: Menu(consoleVariable, name, 0, UIWidgets::Colors::LightBlue) {
}
-//bool CheckNetworkConnected(disabledInfo& info) {
-// return gNetwork.isConnected;
-//}
+// bool CheckNetworkConnected(disabledInfo& info) {
+// return gNetwork.isConnected;
+// }
void PortMenu::InitElement() {
Ship::Menu::InitElement();
@@ -531,4 +550,4 @@ void PortMenu::Draw() {
void PortMenu::DrawElement() {
Ship::Menu::DrawElement();
}
-} // namespace BenGui
+} // namespace GameUI