-
Notifications
You must be signed in to change notification settings - Fork 82
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
Document Sprite Resource / Util (Cell Actor Part 3) #244
Conversation
Now that #176 has been merged, make sure to clean up your merge conflicts and run your code through the formatting utility. |
SpriteResourceTableEntryFile fileEntries[1]; | ||
SpriteResourceTableEntryNARC narcEntries[1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Is the subscript necessary to match?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but in my opinion it makes the code that actually uses these fields nicer. Could probably do [0]
as well, provided mwcc supports that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SpriteResourceTableEntryFile fileEntries[1]; | |
SpriteResourceTableEntryNARC narcEntries[1]; | |
SpriteResourceTableEntryFile *fileEntries; | |
SpriteResourceTableEntryNARC *narcEntries; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not the same code tho. It's an inline array, not a pointer to an array.
This is yet another resource "manager". This time specifically for sprite resources. A
SpriteResource
can hold any ofIt contains the raw file data and the unpacked data, obtained using the
NNS_G2dGetUnpacked*
functions, as well as some additional info in case of palettes and tiles.Resources can (as usual...) be added to a collection:
SpriteResourceCollection
. A sprite resource collection can only hold resources of one type. I.e. only sprites or only palettes, etc. It provides methods for loading resources from NARCsAnother type in this is
SpriteResourceTable
, which is similar to a collection but it's a table deserialized directly from a file or a NARC. It, by itself, then contains further references to either other files or NARCs which contain the actual resources. All entries from such a table can be added directly to a sprite resource collection as well, viaSpriteResourceCollection_AddTable[Ex]
.I now realized that this is most likely gonna be a 6 part PR, instead of 4. This file is mostly utility functions used by a more abstract system. However, there are two more files with utility functions like that. One is for handling VRAM transfers and the other I'm not sure yet.
I am also now debating going back to the cell actor PR and adjusting the terminology there (cell -> sprite) but I first need to see if there is a more concrete "Sprite" type elsewhere.