[Graphics] Disable Black Bar Letterboxes (#590)

* Black Bars be gone

* Move it to draw/apply functions

Updates in real time now

* Added return instead

* added space

* Update mm/2s2h/Enhancements/Enhancements.cpp

* Update mm/2s2h/Enhancements/Enhancements.cpp

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
This commit is contained in:
Patrick12115
2024-06-02 21:32:19 -05:00
committed by GitHub
co-authored by Garrett Cox
parent 26321c9a17
commit 139a240ed3
8 changed files with 37 additions and 0 deletions
+5
View File
@@ -523,6 +523,11 @@ void DrawEnhancementsMenu() {
"model and texture on the boot logo start screen" });
UIWidgets::CVarCheckbox("Bow Reticle", "gEnhancements.Graphics.BowReticle",
{ .tooltip = "Gives the bow a reticle when you draw an arrow" });
UIWidgets::CVarCheckbox(
"Disable Black Bar Letterboxes", "gEnhancements.Graphics.DisableBlackBars",
{ .tooltip = "Disables Black Bar Letterboxes during cutscenes and Z-targeting\nNote: there may be "
"minor visual glitches that were covered up by the black bars\nPlease disable this "
"setting before reporting a bug" });
ImGui::EndMenu();
}
+3
View File
@@ -23,6 +23,9 @@ void InitEnhancements() {
// Equipment
RegisterSkipMagicArrowEquip();
// Graphics
RegisterDisableBlackBars();
// Masks
RegisterFastTransformation();
RegisterFierceDeityAnywhere();
+1
View File
@@ -24,6 +24,7 @@
#include "PlayerMovement/ClimbSpeed.h"
#include "Songs/EnableSunsSong.h"
#include "Saving/SavingEnhancements.h"
#include "Graphics/DisableBlackBars.h"
#include "Modes/TimeMovesWhenYouMove.h"
enum AlwaysWinDoggyRaceOptions {
@@ -52,6 +52,7 @@ typedef enum {
GI_VB_TATL_INTERUPT_MSG6,
GI_VB_ITEM_BE_RESTRICTED,
GI_VB_FLIP_HOP_VARIABLE,
GI_VB_DISABLE_LETTERBOX,
GI_VB_CLOCK_TOWER_OPENING_CONSIDER_THIS_FIRST_CYCLE,
} GIVanillaBehavior;
@@ -0,0 +1,11 @@
#include <libultraship/bridge.h>
#include "Enhancements/GameInteractor/GameInteractor.h"
#include "DisableBlackBars.h"
void RegisterDisableBlackBars() {
REGISTER_VB_SHOULD(GI_VB_DISABLE_LETTERBOX, {
if (CVarGetInteger("gEnhancements.Graphics.DisableBlackBars", 0)) {
*should = true;
}
});
}
@@ -0,0 +1,6 @@
#ifndef GRAPHICS_DISABLE_BLACK_BARS_H
#define GRAPHICS_DISABLE_BLACK_BARS_H
void RegisterDisableBlackBars();
#endif // GRAPHICS_DISABLE_BLACK_BARS_H
+5
View File
@@ -7,6 +7,7 @@
#include "global.h"
#include "z64shrink_window.h"
#include <string.h>
#include "Enhancements/GameInteractor/GameInteractor.h"
#include "BenPort.h"
@@ -79,6 +80,10 @@ void ShrinkWindow_Draw(GraphicsContext* gfxCtx) {
s8 letterboxSize = sShrinkWindowPtr->letterboxSize;
s8 pillarboxSize = sShrinkWindowPtr->pillarboxSize;
if (GameInteractor_Should(GI_VB_DISABLE_LETTERBOX, false, NULL)) {
return;
}
if (letterboxSize > 0) {
OPEN_DISPS(gfxCtx);
+5
View File
@@ -2,6 +2,7 @@
#include "z64shrink_window.h"
#include "z64view.h"
#include "2s2h/Enhancements/FrameInterpolation/FrameInterpolation.h"
#include "Enhancements/GameInteractor/GameInteractor.h"
s32 View_ApplyPerspective(View* view);
s32 View_ApplyOrtho(View* view);
@@ -159,6 +160,10 @@ void View_ApplyLetterbox(View* view) {
s32 lrx;
s32 lry;
if (GameInteractor_Should(GI_VB_DISABLE_LETTERBOX, false, NULL)) {
return;
}
OPEN_DISPS(view->gfxCtx);
letterboxY = ShrinkWindow_Letterbox_GetSize();