Tweak: Refactor 3D drops handling #3071
Merged
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.
This PR aims to refactor and improve the 3D drops handling to address bugs when toggling on/off and simplify the logic.
The way 3d drops worked before was applying a different actor scale, yOffset and sometimes shadowScale either during actor init or actor update/draw. This resulted in having to constantly apply the original or 3d drop specific values which lead to the drops flashing or ending up in a stuck state when toggled on/off.
Instead, this PR uses the pattern that the authentic game does for making recovery hearts 3D, by applying a
Matrix_Scale
. Doing this I was able to remove all the actor scale yOffset changes such that all the drops uses the authentic game values now, and only when 3d drops is only do we apply theMatrix_Scale
to make the GID appear as the right size. This resolves any lingering issues with toggling on the fly and ensures actor properties aren't left in a partially modified state.Ultimately this minimizes the original code changes while restoring authentic code/behavior. I have verified all drops have an appropriate scale with these changes.
Notable bug fixes in these changes:
ITEM00_BOMB_SPECIAL
was using the arrow GID instead of the bomb GIDNotable additions:
Notable change:
Previously when 3d drops are on, the "red" rupees in the Shooting gallery tracker section where being switched from purple (authentic) to red. This was due to the GID for gold rupees matching the color. The problem is that the game authentically incorrectly labels gold rupees as pink, and purple rupees as orange, and so this "adjustment" was used to make the rupee match the red ones in the mini-game. After swapping the GID to match this behavior (pink using purple GID), I have removed this change as it was only applied to 3d drops and was changing authentic behavior beyond what the toggle implies.
So now the progress tracker rupees are correctly their "pink" variant (purple GID when 3d drops are on).
Admittedly, this PR is doing a bit, so I am targeting develop as it is more of a refactor than just "bug fixes" alone. I can rebase if we prefer it for Sulu instead.
Fixes #1343
Build Artifacts