-
Notifications
You must be signed in to change notification settings - Fork 182
[Mode] Hyrule Warriors-style Link #665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
garrettjoecox
merged 20 commits into
HarbourMasters:develop
from
OtherBlue:HW-Styled-Link
Nov 26, 2024
Merged
Changes from 12 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
6c05fb3
Add persistent bunny mask enhancement
garrettjoecox b0b1fd4
Merge branch 'HarbourMasters:develop' into HW-Styled-Link
OtherBlue 2194bc6
Adds option for HW styled Young Link
OtherBlue 7d5030b
Moves the enhancement to Modes
OtherBlue f9737f6
Formatting
OtherBlue 6772e21
Renamed HW>Hyrule Warriors/Changed rotate angles to hex
OtherBlue 9aec61b
Merge branch 'develop' into HW-Styled-Link
OtherBlue 5155547
Merge branch 'develop' into HW-Styled-Link
OtherBlue ee948f7
Merge branch 'HarbourMasters:develop' into HW-Styled-Link
OtherBlue a182218
Formatting again
OtherBlue 9d427f9
Merge branch 'HarbourMasters:develop' into HW-Styled-Link
OtherBlue 671e6d2
Merge branch 'HarbourMasters:develop' into HW-Styled-Link
OtherBlue f9c8bb4
Merge branch 'HW-Styled-Link' of https://github.com/OtherBlue/2ship2h…
OtherBlue d6369ef
Merge branch 'HarbourMasters:develop' into HW-Styled-Link
OtherBlue e84fb67
updated includes and stuff
OtherBlue 22d54f0
Merge branch 'HW-Styled-Link' of https://github.com/OtherBlue/2ship2h…
OtherBlue cf0b86e
Added the enhancement toggle to the modern menu
OtherBlue e3f8586
Formatting
OtherBlue 6a8bd95
removed unnecessary header include
OtherBlue d0a66af
Merge branch 'HarbourMasters:develop' into HW-Styled-Link
OtherBlue File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
mm/2s2h/Enhancements/Graphics/HyruleWarriorsStyledLink.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| #include "HyruleWarriorsStyledLink.h" | ||
| #include "libultraship/libultraship.h" | ||
| #include "2s2h/Enhancements/GameInteractor/GameInteractor.h" | ||
| #include "Enhancements/FrameInterpolation/FrameInterpolation.h" | ||
|
|
||
| extern "C" { | ||
| #include "z64.h" | ||
| #include "z64player.h" | ||
| #include "functions.h" | ||
| #include "macros.h" | ||
| #include "src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" | ||
|
|
||
| extern PlayState* gPlayState; | ||
| extern const char* D_801C0B20[28]; | ||
| extern SaveContext gSaveContext; | ||
| #include "objects/object_link_child/object_link_child.h" | ||
| void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction); | ||
| void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName); | ||
| } | ||
|
|
||
| void UpdateHyruleWarriorsStyledLink() { | ||
| GameInteractor::Instance->RegisterGameHookForID<GameInteractor::OnPlayerPostLimbDraw>( | ||
| PLAYER_LIMB_HEAD, [](Player* player, s32 limbIndex) { | ||
| if (CVarGetInteger("gModes.HyruleWarriorsStyledLink", 0) && player->currentMask == PLAYER_MASK_NONE && | ||
| player->transformation == PLAYER_FORM_HUMAN && INV_CONTENT(ITEM_MASK_KEATON) == ITEM_MASK_KEATON) { | ||
| OPEN_DISPS(gPlayState->state.gfxCtx); | ||
| Matrix_Push(); | ||
| Matrix_RotateYS(0x38e3, MTXMODE_APPLY); | ||
| Matrix_RotateZS(-0x12F6, MTXMODE_APPLY); | ||
| Matrix_Translate(300.0f, -250.0f, 77.7f, MTXMODE_APPLY); | ||
| Matrix_Scale(0.648f, 0.648f, 0.648f, MTXMODE_APPLY); | ||
| gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gPlayState->state.gfxCtx), | ||
| G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); | ||
| gSPDisplayList(POLY_OPA_DISP++, (Gfx*)D_801C0B20[PLAYER_MASK_KEATON - 1]); | ||
| Matrix_Pop(); | ||
| CLOSE_DISPS(gPlayState->state.gfxCtx); | ||
| } | ||
| }); | ||
| GameInteractor::Instance->RegisterGameHookForID<GameInteractor::OnPlayerPostLimbDraw>( | ||
| PLAYER_LIMB_WAIST, [](Player* player, s32 limbIndex) { | ||
| if (CVarGetInteger("gModes.HyruleWarriorsStyledLink", 0) && player->transformation == PLAYER_FORM_HUMAN && | ||
| player->itemAction != PLAYER_IA_MASK_FIERCE_DEITY && | ||
| INV_CONTENT(ITEM_MASK_FIERCE_DEITY) == ITEM_MASK_FIERCE_DEITY) { | ||
| OPEN_DISPS(gPlayState->state.gfxCtx); | ||
| Matrix_Push(); | ||
| Matrix_RotateXS(-0x61A8, MTXMODE_APPLY); | ||
| Matrix_RotateYS(-0x7D0, MTXMODE_APPLY); | ||
| Matrix_RotateZS(-0x3A98, MTXMODE_APPLY); | ||
| Matrix_Translate(-85.0f, 658.0f, -165.0f, MTXMODE_APPLY); | ||
| Matrix_Scale(0.635f, 0.635f, 0.635f, MTXMODE_APPLY); | ||
| gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gPlayState->state.gfxCtx), | ||
| G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); | ||
| gSPDisplayList(POLY_OPA_DISP++, (Gfx*)D_801C0B20[PLAYER_MASK_FIERCE_DEITY - 1]); | ||
| Matrix_Pop(); | ||
| CLOSE_DISPS(gPlayState->state.gfxCtx); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| void RegisterHyruleWarriorsStyledLink() { | ||
| UpdateHyruleWarriorsStyledLink(); | ||
|
|
||
| GameInteractor::Instance->RegisterGameHook<GameInteractor::OnSceneInit>( | ||
| [](s8 sceneId, s8 spawnNum) { UpdateHyruleWarriorsStyledLink(); }); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #ifndef GRAPHICS_HYRULE_WARRIORS_STYLED_LINK | ||
| #define GRAPHICS_HYRULE_WARRIORS_STYLED_LINK | ||
|
|
||
| void RegisterHyruleWarriorsStyledLink(); | ||
| void UpdateHyruleWarriorsStyledLink(); | ||
|
|
||
| #endif // GRAPHICS_HYRULE_WARRIORS_STYLED_LINK |
|
OtherBlue marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.