diff --git a/mm/2s2h/BenGui/BenMenuBar.cpp b/mm/2s2h/BenGui/BenMenuBar.cpp index a543d35c7..6480ed54b 100644 --- a/mm/2s2h/BenGui/BenMenuBar.cpp +++ b/mm/2s2h/BenGui/BenMenuBar.cpp @@ -305,6 +305,7 @@ void DrawEnhancementsMenu() { }); UIWidgets::CVarCheckbox("Skip Entrance Cutscenes", "gEnhancements.TimeSavers.SkipEntranceCutscenes"); UIWidgets::CVarCheckbox("Hide Title Cards", "gEnhancements.TimeSavers.HideTitleCards"); + UIWidgets::CVarCheckbox("24 Hours Clock", "gEnhancements.General.24HoursClock"); if (mHudEditorWindow) { UIWidgets::WindowButton("Hud Editor", "gWindows.HudEditor", mHudEditorWindow, { diff --git a/mm/assets/.gitignore b/mm/assets/.gitignore index fec19cf96..d42a6436f 100644 --- a/mm/assets/.gitignore +++ b/mm/assets/.gitignore @@ -5,5 +5,6 @@ *.vtx.inc *.dlist.inc -# Unignore our custom assets +# Unignore our custom assets and header file !custom/**/* +!2s2h_assets.h diff --git a/mm/assets/2s2h_assets.h b/mm/assets/2s2h_assets.h new file mode 100644 index 000000000..1281181a4 --- /dev/null +++ b/mm/assets/2s2h_assets.h @@ -0,0 +1,57 @@ +#pragma once + +#include "align_asset_macro.h" + +// This file is manually made +// When new assets are added to the soh.otr file +// We need to add the aligned version of the resource names here and use in code +// On Mac, not using aligned resource names was causing crashes in release builds + +// textures +#define dgDPad "__OTR__textures/parameter_static/gDPad" +static const ALIGN_ASSET(2) char gDPadTex[] = dgDPad; + +#define dgArrowUp "__OTR__textures/parameter_static/gArrowUp" +static const ALIGN_ASSET(2) char gArrowUpTex[] = dgArrowUp; + +#define dgArrowDown "__OTR__textures/parameter_static/gArrowDown" +static const ALIGN_ASSET(2) char gArrowDownTex[] = dgArrowDown; + +#define dgTriforcePiece "__OTR__textures/parameter_static/gTriforcePiece" +static const ALIGN_ASSET(2) char gTriforcePieceTex[] = dgTriforcePiece; + +#define dgThreeDayClockHour13Tex "__OTR__textures/parameter_static/gThreeDayClockHour13Tex" +static const ALIGN_ASSET(2) char gThreeDayClockHour13Tex[] = dgThreeDayClockHour13Tex; + +#define dgThreeDayClockHour14Tex "__OTR__textures/parameter_static/gThreeDayClockHour14Tex" +static const ALIGN_ASSET(2) char gThreeDayClockHour14Tex[] = dgThreeDayClockHour14Tex; + +#define dgThreeDayClockHour15Tex "__OTR__textures/parameter_static/gThreeDayClockHour15Tex" +static const ALIGN_ASSET(2) char gThreeDayClockHour15Tex[] = dgThreeDayClockHour15Tex; + +#define dgThreeDayClockHour16Tex "__OTR__textures/parameter_static/gThreeDayClockHour16Tex" +static const ALIGN_ASSET(2) char gThreeDayClockHour16Tex[] = dgThreeDayClockHour16Tex; + +#define dgThreeDayClockHour17Tex "__OTR__textures/parameter_static/gThreeDayClockHour17Tex" +static const ALIGN_ASSET(2) char gThreeDayClockHour17Tex[] = dgThreeDayClockHour17Tex; + +#define dgThreeDayClockHour18Tex "__OTR__textures/parameter_static/gThreeDayClockHour18Tex" +static const ALIGN_ASSET(2) char gThreeDayClockHour18Tex[] = dgThreeDayClockHour18Tex; + +#define dgThreeDayClockHour19Tex "__OTR__textures/parameter_static/gThreeDayClockHour19Tex" +static const ALIGN_ASSET(2) char gThreeDayClockHour19Tex[] = dgThreeDayClockHour19Tex; + +#define dgThreeDayClockHour20Tex "__OTR__textures/parameter_static/gThreeDayClockHour20Tex" +static const ALIGN_ASSET(2) char gThreeDayClockHour20Tex[] = dgThreeDayClockHour20Tex; + +#define dgThreeDayClockHour21Tex "__OTR__textures/parameter_static/gThreeDayClockHour21Tex" +static const ALIGN_ASSET(2) char gThreeDayClockHour21Tex[] = dgThreeDayClockHour21Tex; + +#define dgThreeDayClockHour22Tex "__OTR__textures/parameter_static/gThreeDayClockHour22Tex" +static const ALIGN_ASSET(2) char gThreeDayClockHour22Tex[] = dgThreeDayClockHour22Tex; + +#define dgThreeDayClockHour23Tex "__OTR__textures/parameter_static/gThreeDayClockHour23Tex" +static const ALIGN_ASSET(2) char gThreeDayClockHour23Tex[] = dgThreeDayClockHour23Tex; + +#define dgThreeDayClockHour24Tex "__OTR__textures/parameter_static/gThreeDayClockHour24Tex" +static const ALIGN_ASSET(2) char gThreeDayClockHour24Tex[] = dgThreeDayClockHour24Tex; diff --git a/mm/assets/archives/icon_item_24_static/icon_item_24_static_yar.h b/mm/assets/archives/icon_item_24_static/icon_item_24_static_yar.h index 4d441bd8a..515902d7b 100644 --- a/mm/assets/archives/icon_item_24_static/icon_item_24_static_yar.h +++ b/mm/assets/archives/icon_item_24_static/icon_item_24_static_yar.h @@ -33,12 +33,12 @@ static const ALIGN_ASSET(2) char gQuestIconDungeonMapTex[] = dgQuestIconDungeonM #define dgQuestIconGoldSkulltula2Tex "__OTR__icon_item_24_static_yar/gQuestIconGoldSkulltula2Tex" static const ALIGN_ASSET(2) char gQuestIconGoldSkulltula2Tex[] = dgQuestIconGoldSkulltula2Tex; -#define dgQuestIconSmallMagicJarTex "__OTR__icon_item_24_static_yar/gQuestIconSmallMagicJarTex" -static const ALIGN_ASSET(2) char gQuestIconSmallMagicJarTex[] = dgQuestIconSmallMagicJarTex; - #define dgQuestIconSmallKeyTex "__OTR__icon_item_24_static_yar/gQuestIconSmallKeyTex" static const ALIGN_ASSET(2) char gQuestIconSmallKeyTex[] = dgQuestIconSmallKeyTex; +#define dgQuestIconSmallMagicJarTex "__OTR__icon_item_24_static_yar/gQuestIconSmallMagicJarTex" +static const ALIGN_ASSET(2) char gQuestIconSmallMagicJarTex[] = dgQuestIconSmallMagicJarTex; + #define dgQuestIconBigMagicJarTex "__OTR__icon_item_24_static_yar/gQuestIconBigMagicJarTex" static const ALIGN_ASSET(2) char gQuestIconBigMagicJarTex[] = dgQuestIconBigMagicJarTex; diff --git a/mm/assets/custom/textures/parameter_static/gThreeDayClockHour13Tex.ia4.png b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour13Tex.ia4.png new file mode 100644 index 000000000..7388c6969 Binary files /dev/null and b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour13Tex.ia4.png differ diff --git a/mm/assets/custom/textures/parameter_static/gThreeDayClockHour14Tex.ia4.png b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour14Tex.ia4.png new file mode 100644 index 000000000..abf5e7abd Binary files /dev/null and b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour14Tex.ia4.png differ diff --git a/mm/assets/custom/textures/parameter_static/gThreeDayClockHour15Tex.ia4.png b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour15Tex.ia4.png new file mode 100644 index 000000000..b0a1174e1 Binary files /dev/null and b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour15Tex.ia4.png differ diff --git a/mm/assets/custom/textures/parameter_static/gThreeDayClockHour16Tex.ia4.png b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour16Tex.ia4.png new file mode 100644 index 000000000..602dfc38f Binary files /dev/null and b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour16Tex.ia4.png differ diff --git a/mm/assets/custom/textures/parameter_static/gThreeDayClockHour17Tex.ia4.png b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour17Tex.ia4.png new file mode 100644 index 000000000..b404e0677 Binary files /dev/null and b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour17Tex.ia4.png differ diff --git a/mm/assets/custom/textures/parameter_static/gThreeDayClockHour18Tex.ia4.png b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour18Tex.ia4.png new file mode 100644 index 000000000..36d308b03 Binary files /dev/null and b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour18Tex.ia4.png differ diff --git a/mm/assets/custom/textures/parameter_static/gThreeDayClockHour19Tex.ia4.png b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour19Tex.ia4.png new file mode 100644 index 000000000..1673da386 Binary files /dev/null and b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour19Tex.ia4.png differ diff --git a/mm/assets/custom/textures/parameter_static/gThreeDayClockHour20Tex.ia4.png b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour20Tex.ia4.png new file mode 100644 index 000000000..df13cd513 Binary files /dev/null and b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour20Tex.ia4.png differ diff --git a/mm/assets/custom/textures/parameter_static/gThreeDayClockHour21Tex.ia4.png b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour21Tex.ia4.png new file mode 100644 index 000000000..3c9faa807 Binary files /dev/null and b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour21Tex.ia4.png differ diff --git a/mm/assets/custom/textures/parameter_static/gThreeDayClockHour22Tex.ia4.png b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour22Tex.ia4.png new file mode 100644 index 000000000..207801d81 Binary files /dev/null and b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour22Tex.ia4.png differ diff --git a/mm/assets/custom/textures/parameter_static/gThreeDayClockHour23Tex.ia4.png b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour23Tex.ia4.png new file mode 100644 index 000000000..30eda153f Binary files /dev/null and b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour23Tex.ia4.png differ diff --git a/mm/assets/custom/textures/parameter_static/gThreeDayClockHour24Tex.ia4.png b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour24Tex.ia4.png new file mode 100644 index 000000000..b3ac0c57d Binary files /dev/null and b/mm/assets/custom/textures/parameter_static/gThreeDayClockHour24Tex.ia4.png differ diff --git a/mm/src/code/z_parameter.c b/mm/src/code/z_parameter.c index 4ebca32ae..0120e2d7d 100644 --- a/mm/src/code/z_parameter.c +++ b/mm/src/code/z_parameter.c @@ -16,6 +16,7 @@ #include "BenPort.h" #include #include "BenGui/HudEditor.h" +#include "2s2h_assets.h" #include "Enhancements/GameInteractor/GameInteractor.h" // #region 2S2H [Port] Asset tables we can pull from instead of from ROM @@ -4850,6 +4851,17 @@ void Interface_DrawClock(PlayState* play) { gThreeDayClockHour4Tex, gThreeDayClockHour5Tex, gThreeDayClockHour6Tex, gThreeDayClockHour7Tex, gThreeDayClockHour8Tex, gThreeDayClockHour9Tex, gThreeDayClockHour10Tex, gThreeDayClockHour11Tex, gEmptyTexture, gEmptyTexture, // 2S2H [Port] To account for the vanilla bug detailed later on in this function + }; + // 2S2H Region [Enhancements] 24 Hours Clock + static TexturePtr sThreeDayClockHourTwentyHourHoursTextures[] = { + gThreeDayClockHour24Tex, gThreeDayClockHour1Tex, gThreeDayClockHour2Tex, gThreeDayClockHour3Tex, + gThreeDayClockHour4Tex, gThreeDayClockHour5Tex, gThreeDayClockHour6Tex, gThreeDayClockHour7Tex, + gThreeDayClockHour8Tex, gThreeDayClockHour9Tex, gThreeDayClockHour10Tex, gThreeDayClockHour11Tex, + gThreeDayClockHour12Tex, gThreeDayClockHour13Tex, gThreeDayClockHour14Tex, gThreeDayClockHour15Tex, + gThreeDayClockHour16Tex, gThreeDayClockHour17Tex, gThreeDayClockHour18Tex, gThreeDayClockHour19Tex, + gThreeDayClockHour20Tex, gThreeDayClockHour21Tex, gThreeDayClockHour22Tex, gThreeDayClockHour23Tex, + gEmptyTexture, gEmptyTexture, // 2S2H [Port] To account for the vanilla bug detailed later on in this function + // #endregison }; static s16 sClockInvDiamondPrimRed = 0; static s16 sClockInvDiamondPrimGreen = 155; @@ -5212,7 +5224,9 @@ void Interface_DrawClock(PlayState* play) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, sThreeDayClockAlpha); gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[24], 8, 0); - OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTextures[sp1C6], 4, 16, 11, 0); + OVERLAY_DISP = CVarGetInteger("gEnhancements.General.24HoursClock", 0) ? + Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTwentyHourHoursTextures[sp1C6], 4, 16, 11, 0) : + Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTextures[sp1C6], 4, 16, 11, 0); // Colours the Three-Day Clocks's Hour Digit Above the Sun gDPPipeSync(OVERLAY_DISP++); @@ -5236,7 +5250,10 @@ void Interface_DrawClock(PlayState* play) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, sThreeDayClockAlpha); gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[32], 8, 0); - OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTextures[sp1C6], 4, 16, 11, 0); + OVERLAY_DISP = CVarGetInteger("gEnhancements.General.24HoursClock", 0) ? + Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTwentyHourHoursTextures[sp1C6], 4, 16, 11, 0) : + Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTextures[sp1C6], 4, 16, 11, 0); + // Colours the Three-Day Clocks's Hour Digit Above the Moon gDPPipeSync(OVERLAY_DISP++);