This is yet another resource "manager". This time specifically for sprite resources. A SpriteResource can hold any of
Character Data (NCGR) -> Tiles
Palette Data (NCLR) -> Palettes
Cell Data (NCER) -> Sprites
Cell Anim Data (NANR) -> Sprite Anims
Multi Cell Data (NMCR) -> Multi Sprites
Multi Cell Anim Data (NMAR) -> Multi Sprite Anims
It 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 NARCs
Another 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, via SpriteResourceCollection_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.
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.