Skip to content

Commit

Permalink
Shader testing
Browse files Browse the repository at this point in the history
  • Loading branch information
KiritoDv committed May 9, 2024
1 parent 47b690f commit 6fcb569
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 22 deletions.
37 changes: 21 additions & 16 deletions soh/soh/SohMenuBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void DrawSettingsMenu() {
"Lower values may improve performance.\n"
"Values above 100% can be used for super-sampling, as an intensive but highly effective form of anti-aliasing.\n\n"
"Default: 100%");

if (mAdvancedResolutionSettingsWindow) {
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(12.0f, 6.0f));
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0.0f, 0.0f));
Expand Down Expand Up @@ -397,7 +397,7 @@ void DrawSettingsMenu() {
"Uses Matrix Interpolation to create extra frames, resulting in smoother graphics.\n"
"This is purely visual and does not impact game logic, execution of glitches etc.\n"
"Higher frame rate settings may impact CPU performance."
"\n\n " ICON_FA_INFO_CIRCLE
"\n\n " ICON_FA_INFO_CIRCLE
" There is no need to set this above your monitor's refresh rate. Doing so will waste resources and may give a worse result.");
} else {
UIWidgets::Tooltip(
Expand Down Expand Up @@ -442,7 +442,7 @@ void DrawSettingsMenu() {
UIWidgets::Tooltip("Changes the scaling of the ImGui menu elements.");

UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f);

static std::unordered_map<Ship::WindowBackend, const char*> windowBackendNames = {
{ Ship::WindowBackend::DX11, "DirectX" },
{ Ship::WindowBackend::SDL_OPENGL, "OpenGL"},
Expand Down Expand Up @@ -524,17 +524,17 @@ void DrawSettingsMenu() {
}
ImGui::EndMenu();
}

UIWidgets::Spacer(0);

if (ImGui::BeginMenu("Accessibility")) {
#if defined(_WIN32) || defined(__APPLE__)
UIWidgets::PaddedEnhancementCheckbox("Text to Speech", CVAR_SETTING("A11yTTS"));
UIWidgets::Tooltip("Enables text to speech for in game dialog");
#endif
UIWidgets::PaddedEnhancementCheckbox("Disable Idle Camera Re-Centering", CVAR_SETTING("A11yDisableIdleCam"));
UIWidgets::Tooltip("Disables the automatic re-centering of the camera when idle.");

ImGui::EndMenu();
}
ImGui::EndMenu();
Expand Down Expand Up @@ -597,7 +597,7 @@ void DrawEnhancementsMenu() {
UIWidgets::Spacer(0);
ImGui::Text("Changes:");
UIWidgets::PaddedSeparator();

UIWidgets::PaddedEnhancementSliderInt("Biggoron Forge Time: %d days", "##FORGETIME", CVAR_ENHANCEMENT("ForgeTime"), 0, 3, "", 3, true, false, true);
UIWidgets::Tooltip("Allows you to change the number of days it takes for Biggoron to forge the Biggoron Sword");
UIWidgets::PaddedEnhancementCheckbox("Remember Save Location", CVAR_ENHANCEMENT("RememberSaveLocation"), false, false);
Expand Down Expand Up @@ -660,7 +660,7 @@ void DrawEnhancementsMenu() {
"- Not within range of Ocarina playing spots");
UIWidgets::PaddedEnhancementCheckbox("Pause Warp", CVAR_ENHANCEMENT("PauseWarp"), true, false);
UIWidgets::Tooltip("Selection of warp song in pause menu initiates warp. Disables song playback.");

ImGui::EndTable();
ImGui::EndMenu();
}
Expand Down Expand Up @@ -1031,7 +1031,7 @@ void DrawEnhancementsMenu() {
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_BLUE_FIRE_ARROWS);
static const char* forceEnableBlueFireArrowsText =
"This setting is forcefully enabled because a savefile\nwith \"Blue Fire Arrows\" is loaded.";
UIWidgets::PaddedEnhancementCheckbox("Blue Fire Arrows", CVAR_ENHANCEMENT("BlueFireArrows"), true, false,
UIWidgets::PaddedEnhancementCheckbox("Blue Fire Arrows", CVAR_ENHANCEMENT("BlueFireArrows"), true, false,
forceEnableBlueFireArrows, forceEnableBlueFireArrowsText, UIWidgets::CheckboxGraphics::Checkmark);
UIWidgets::Tooltip("Allows Ice Arrows to melt red ice.\nMay require a room reload if toggled during gameplay.");

Expand All @@ -1040,7 +1040,7 @@ void DrawEnhancementsMenu() {
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SUNLIGHT_ARROWS);
static const char* forceEnableSunLightArrowsText =
"This setting is forcefully enabled because a savefile\nwith \"Sunlight Arrows\" is loaded.";
UIWidgets::PaddedEnhancementCheckbox("Sunlight Arrows", CVAR_ENHANCEMENT("SunlightArrows"), true, false,
UIWidgets::PaddedEnhancementCheckbox("Sunlight Arrows", CVAR_ENHANCEMENT("SunlightArrows"), true, false,
forceEnableSunLightArrows, forceEnableSunLightArrowsText, UIWidgets::CheckboxGraphics::Checkmark);
UIWidgets::Tooltip("Allows Light Arrows to activate sun switches.\nMay require a room reload if toggled during gameplay.");

Expand Down Expand Up @@ -1240,8 +1240,8 @@ void DrawEnhancementsMenu() {
"Fixes an incorrect calculation that acted like water underneath ground was above it.");
UIWidgets::PaddedEnhancementCheckbox("Fix Bush Item Drops", CVAR_ENHANCEMENT("BushDropFix"), true, false);
UIWidgets::Tooltip("Fixes the bushes to drop items correctly rather than spawning undefined items.");
UIWidgets::PaddedEnhancementCheckbox("Fix falling from vine edges", CVAR_ENHANCEMENT("FixVineFall"), true, false);
UIWidgets::Tooltip("Prevents immediately falling off climbable surfaces if climbing on the edges.");
UIWidgets::PaddedEnhancementCheckbox("Fix falling from vine edges", CVAR_ENHANCEMENT("FixVineFall"), true, false);
UIWidgets::Tooltip("Prevents immediately falling off climbable surfaces if climbing on the edges.");
UIWidgets::PaddedEnhancementCheckbox("Fix Link's eyes open while sleeping", CVAR_ENHANCEMENT("FixEyesOpenWhileSleeping"), true, false);
UIWidgets::Tooltip("Fixes Link's eyes being open in the opening cutscene when he is supposed to be sleeping.");
UIWidgets::PaddedEnhancementCheckbox("Fix Darunia dancing too fast", CVAR_ENHANCEMENT("FixDaruniaDanceSpeed"),
Expand Down Expand Up @@ -1468,12 +1468,12 @@ void DrawCheatsMenu() {
if (ImGui::Button("Change Age")) {
CVarSetInteger(CVAR_GENERAL("SwitchAge"), 1);
}
UIWidgets::Tooltip("Switches Link's age and reloads the area.");
UIWidgets::Tooltip("Switches Link's age and reloads the area.");
UIWidgets::Spacer(2.0f);
if (ImGui::Button("Clear Cutscene Pointer")) {
GameInteractor::RawAction::ClearCutscenePointer();
}
UIWidgets::Tooltip("Clears the cutscene pointer to a value safe for wrong warps.");
UIWidgets::Tooltip("Clears the cutscene pointer to a value safe for wrong warps.");

ImGui::TableNextColumn();
UIWidgets::Spacer(2.0f);
Expand Down Expand Up @@ -1730,6 +1730,11 @@ void DrawDeveloperToolsMenu() {
}
}

UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Cleanup Shader Cache", false).c_str(), ImVec2(-1.0f, 0.0f))) {
CVarSetInteger(CVAR_DEVELOPER_TOOLS("CleanupShaderCache"), 1);
}

ImGui::PopStyleVar(3);
ImGui::PopStyleColor(1);

Expand Down Expand Up @@ -1953,12 +1958,12 @@ void DrawRandomizerMenu() {
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_BOSS_KEYSANITY) == RO_DUNGEON_ITEM_LOC_ANYWHERE ||
(OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_GANONS_BOSS_KEY) != RO_GANON_BOSS_KEY_VANILLA &&
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_GANONS_BOSS_KEY) != RO_GANON_BOSS_KEY_OWN_DUNGEON &&
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_GANONS_BOSS_KEY) != RO_GANON_BOSS_KEY_STARTWITH) ||
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_GANONS_BOSS_KEY) != RO_GANON_BOSS_KEY_STARTWITH) ||
!IS_RANDO) {
disableKeyColors = false;
}

static const char* disableKeyColorsText =
static const char* disableKeyColorsText =
"This setting is disabled because a savefile is loaded without any key\n"
"shuffle settings set to \"Any Dungeon\", \"Overworld\" or \"Anywhere\"";

Expand Down
14 changes: 9 additions & 5 deletions soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <string.h>

#include "z_kaleido_scope.h"
#include "textures/parameter_static/parameter_static.h"
#include "textures/icon_item_static/icon_item_static.h"
Expand Down Expand Up @@ -345,7 +347,7 @@ void KaleidoScope_HandleItemCycles(PlayState* play) {
INV_CONTENT(ITEM_TRADE_CHILD) == ITEM_MASK_BUNNY
? AGE_REQ_NONE
: AGE_REQ_CHILD;

//also update the age requirement for the bunny hood itself
gItemAgeReqs[ITEM_MASK_BUNNY] =
((CVarGetInteger(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_VANILLA) != BUNNY_HOOD_VANILLA) && CVarGetInteger(CVAR_ENHANCEMENT("AdultBunnyHood"), 0)) ||
Expand Down Expand Up @@ -377,7 +379,7 @@ void KaleidoScope_DrawItemCycles(PlayState* play) {
ITEM_MASK_KEATON :
INV_CONTENT(ITEM_TRADE_CHILD) + 1
);

//draw the adult trade select
KaleidoScope_DrawItemCycleExtras(
play,
Expand Down Expand Up @@ -765,8 +767,10 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
gDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 255);
gSPGrayscale(POLY_KAL_DISP++, true);
}
gSPBindShader(POLY_KAL_DISP++, "shaders/rainbow.glsl");
KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIcons[itemId], 32,
32, 0);
gSPBindShader(POLY_KAL_DISP++, NULL);
gSPGrayscale(POLY_KAL_DISP++, false);
}
}
Expand Down Expand Up @@ -913,8 +917,8 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) {
{ C_DOWN_BUTTON_X+X_Margins_CD, C_DOWN_BUTTON_Y+Y_Margins_CD },
{ C_RIGHT_BUTTON_X+X_Margins_CR, C_RIGHT_BUTTON_Y+Y_Margins_CR },
{ DPAD_UP_X+X_Margins_DPad_Items, DPAD_UP_Y+Y_Margins_DPad_Items },
{ DPAD_DOWN_X+X_Margins_DPad_Items, DPAD_DOWN_Y+Y_Margins_DPad_Items },
{ DPAD_LEFT_X+X_Margins_DPad_Items, DPAD_LEFT_Y+Y_Margins_DPad_Items },
{ DPAD_DOWN_X+X_Margins_DPad_Items, DPAD_DOWN_Y+Y_Margins_DPad_Items },
{ DPAD_LEFT_X+X_Margins_DPad_Items, DPAD_LEFT_Y+Y_Margins_DPad_Items },
{ DPAD_RIGHT_X+X_Margins_DPad_Items, DPAD_RIGHT_Y+Y_Margins_DPad_Items }
};
s16 DPad_ItemsOffset[4][2] = {
Expand Down Expand Up @@ -1127,7 +1131,7 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) {
pauseCtx->equipTargetSlot = SLOT_BOW;
}
}

// If the item is on another button already, swap the two
uint16_t targetButtonIndex = pauseCtx->equipTargetCBtn + 1;
for (uint16_t otherSlotIndex = 0; otherSlotIndex < ARRAY_COUNT(gSaveContext.equips.cButtonSlots);
Expand Down

0 comments on commit 6fcb569

Please sign in to comment.