|
AnimaEngine
1.0.0
Nintendo DS Pokemon Black, White, Black 2, and White 2 sprite extraction and preview toolchain
|
Nintendo Cell Resource (.NCER) parser representing individual 2D sprite composite elements. More...
Go to the source code of this file.
Data Structures | |
| struct | NcerOam |
| Represents a single Object Attribute Memory (OAM) hardware sub-sprite element. More... | |
| struct | NcerCell |
| A composite cell sprite made of multiple sub-sprite hardware OAM entries. More... | |
| struct | NcerFile |
| Unpacked representation of a complete .NCER resource. More... | |
Typedefs | |
| typedef struct NcerOam | NcerOam |
| Represents a single Object Attribute Memory (OAM) hardware sub-sprite element. More... | |
| typedef struct NcerCell | NcerCell |
| A composite cell sprite made of multiple sub-sprite hardware OAM entries. More... | |
| typedef struct NcerFile | NcerFile |
| Unpacked representation of a complete .NCER resource. More... | |
Functions | |
| int | Ncer_Parse (const u8 *data, size_t size, NcerFile *out_ncer) |
| Parses an unpacked .NCER cell layout block from raw bytes. More... | |
| void | Ncer_Free (NcerFile *ncer) |
| Deallocates all resources held inside an NcerFile structure. More... | |
| void | Ncer_PrintInfo (const NcerFile *ncer) |
| Prints parsed .NCER layout metadata to stdout. More... | |
| void | Ncer_GetOamDrawOrigin (const NcerOam *oam, int *out_x, int *out_y) |
| Calculates resolved horizontal and vertical origins for drawing an OAM. More... | |
| int | Ncer_RenderCellToImage (const NcerFile *ncer, int cell_index, const NcgrImage *ncgr, const NclrPalette *palette, RgbaColor **out_pixels, int *out_width, int *out_height) |
| Renders a composite cell into a raw RGBA pixels buffer. More... | |
| int | Ncer_RenderCellToImageWithTileStride (const NcerFile *ncer, int cell_index, const NcgrImage *ncgr, const NclrPalette *palette, int tile_stride, RgbaColor **out_pixels, int *out_width, int *out_height) |
| Renders a composite cell using specific tile character width stride formatting constraints. More... | |
| void | Ncer_CellBounds (const NcerCell *cell, int *out_min_x, int *out_min_y, int *out_max_x, int *out_max_y) |
| Computes bounding box limits for a cell. More... | |
Nintendo Cell Resource (.NCER) parser representing individual 2D sprite composite elements.
A composite cell sprite made of multiple sub-sprite hardware OAM entries.
Represents a single Object Attribute Memory (OAM) hardware sub-sprite element.
| void Ncer_CellBounds | ( | const NcerCell * | cell, |
| int * | out_min_x, | ||
| int * | out_min_y, | ||
| int * | out_max_x, | ||
| int * | out_max_y | ||
| ) |
Computes bounding box limits for a cell.
| cell | Cell structure. |
| out_min_x | Minimum horizontal coordinate. |
| out_min_y | Minimum vertical coordinate. |
| out_max_x | Maximum horizontal coordinate. |
| out_max_y | Maximum vertical coordinate. |
| void Ncer_Free | ( | NcerFile * | ncer | ) |
Deallocates all resources held inside an NcerFile structure.
| ncer | Pointer to structure. |
| void Ncer_GetOamDrawOrigin | ( | const NcerOam * | oam, |
| int * | out_x, | ||
| int * | out_y | ||
| ) |
Calculates resolved horizontal and vertical origins for drawing an OAM.
| oam | Sub-sprite structure. |
| out_x | Output coordinate (horizontal). |
| out_y | Output coordinate (vertical). |
Parses an unpacked .NCER cell layout block from raw bytes.
| data | Pointer to raw binary file data buffer. |
| size | Buffer size in bytes. |
| out_ncer | Destination structure. |
| void Ncer_PrintInfo | ( | const NcerFile * | ncer | ) |
Prints parsed .NCER layout metadata to stdout.
| ncer | Pointer to parsed NCER file. |
| int Ncer_RenderCellToImage | ( | const NcerFile * | ncer, |
| int | cell_index, | ||
| const NcgrImage * | ncgr, | ||
| const NclrPalette * | palette, | ||
| RgbaColor ** | out_pixels, | ||
| int * | out_width, | ||
| int * | out_height | ||
| ) |
Renders a composite cell into a raw RGBA pixels buffer.
| ncer | NCER resource. |
| cell_index | Index of the cell to draw. |
| ncgr | NCGR tile graphic resource. |
| palette | NCLR palette resource. |
| out_pixels | Output pointer to destination buffer, allocated inside this function. |
| out_width | Width of rendered cell. |
| out_height | Height of rendered cell. |
| int Ncer_RenderCellToImageWithTileStride | ( | const NcerFile * | ncer, |
| int | cell_index, | ||
| const NcgrImage * | ncgr, | ||
| const NclrPalette * | palette, | ||
| int | tile_stride, | ||
| RgbaColor ** | out_pixels, | ||
| int * | out_width, | ||
| int * | out_height | ||
| ) |
Renders a composite cell using specific tile character width stride formatting constraints.
| ncer | NCER resource. |
| cell_index | Index of the cell to draw. |
| ncgr | NCGR tile graphic resource. |
| palette | NCLR palette resource. |
| tile_stride | Width stride (in tiles) of NCGR image data. |
| out_pixels | Output pointer to destination buffer. |
| out_width | Width of rendered cell. |
| out_height | Height of rendered cell. |