Updates for graphic overrides and item table #712
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 doesn't add any new features, but it introduces a couple of changes to slightly improve the addition of more custom items to the Randomizer. A couple of graphical fixes are also included.
This branch is the base for some new settings I'm currently working on.
Remove GraphicID
The randomizer's rItemTable currently contains a column,
graphicId
, used to override the index into the game's gDrawItemTable when obtaining an item, in order to change the GetItem model. Separately, the item table also contains all the values that are returned by the gDrawItemTable: this set of values is used to draw overworld and shop models.To reduce the complexity, I have removed the graphicId from the table and replaced some patches so that, instead of overriding the index into gDrawItemTable, the Randomizer will override the access to it, returning the set of values from the rItemTable.
This means that adding custom items won't require finding an unused entry in the gDrawItemTable and editing it for the new item. It also prevents running out of unused entries in the future (there aren't many left).
To improve readability of the Item Table, I also added an entry to the GetItemID enum for each item row, so it's easier to see what items the rows correspond to. The chest type is also written with enum values now.
Group model editing functions
The code to edit models and textures for the creation of custom items is currently duplicated across
models.c
,shops.c
anditem_override.c
. I moved it to generic editing functions incustom_models.c
.Fix billboard models rotation
For overworld item models, I fixed the rotation of the secondary models used to display 2D images, by making them always follow the camera orientation (for example the fairy orb inside the bottle). Similarly, the flame on the blue fire shop model should now always revolve correctly around the candle.