NightFox’s Lib
Data Structures | Macros | Functions | Variables
nf_sprite256.h File Reference

Functions related to 256 color sprites. More...

#include <nds.h>

Data Structures

struct  NF_TYPE_SPR256GFX_INFO
 Struct that holds information about sprite graphics in RAM. More...
 
struct  NF_TYPE_SPR256PAL_INFO
 Struct that holds information about sprite palettes in RAM. More...
 
struct  NF_TYPE_SPR256VRAM_INFO
 Struct that holds information about sprite graphics in VRAM. More...
 
struct  NF_TYPE_SPRPALSLOT_INFO
 Struct that holds information about sprite palettes in VRAM. More...
 
struct  NF_TYPE_SPRITEOAM_INFO
 Struct that defines OAM information. More...
 
struct  NF_TYPE_SPRVRAM_INFO
 Struct with information of sprite allocation in VRAM. More...
 

Macros

#define NF_SLOTS_SPR256GFX   256
 Maximum number of slots of 256 color sprites.
 
#define NF_SLOTS_SPR256PAL   64
 Maximum number of slots of palettes of 256 color sprites.
 

Functions

void NF_InitSpriteBuffers (void)
 Initialize library to load files from the filesystem to create 256 color sprites. More...
 
void NF_ResetSpriteBuffers (void)
 Reset state used for 256 color sprites loaded from FAT. More...
 
void NF_InitSpriteSys (int screen,...)
 Initialize sprite system in the specified screen. More...
 
void NF_LoadSpriteGfx (const char *file, u32 id, u32 width, u32 height)
 Load sprite graphics from the filesystem to RAM to use it later. More...
 
void NF_UnloadSpriteGfx (u32 id)
 Delete from RAM the graphics of the selected slot and mark it as free. More...
 
void NF_LoadSpritePal (const char *file, u32 id)
 Load a palette from the filesystem to RAM to be used for a sprite. More...
 
void NF_UnloadSpritePal (u32 id)
 Delete the selected palette from RAM and mark it as free. More...
 
void NF_VramSpriteGfx (int screen, u32 ram, u32 vram, bool keepframes)
 Copy a graphics object from RAM to VRAM of the selected screen to be used as a sprite. More...
 
void NF_FreeSpriteGfx (int screen, u32 id)
 Delete from VRAM the graphics object of the selected slot and a screen. More...
 
void NF_VramSpriteGfxDefrag (int screen)
 Defragments the free VRAM used for sprite graphics. More...
 
void NF_VramSpritePal (int screen, u32 id, u32 slot)
 Copy the palette from RAM to a slot of extended palettes in VRAM. More...
 
void NF_CreateSprite (int screen, u32 id, u32 gfx, u32 pal, s32 x, s32 y)
 Create a sprite with the specified ID in the selcted screen. More...
 
void NF_DeleteSprite (int screen, u32 id)
 Delete the selected sprite ID from the specified screen. More...
 
void NF_SpriteOamSet (int screen)
 Copy data from the shadow OAM used by NFLib to the real OAM of libnds. More...
 
void NF_SpriteSetPalColor (int screen, u32 pal, u32 number, u32 r, u32 g, u32 b)
 Changes a color of a sprite palette in the specified screen. More...
 
void NF_SpriteEditPalColor (int screen, u32 pal, u32 number, u32 r, u32 g, u32 b)
 Changes the value of one color in a sprite palettes of the specified screen. More...
 
void NF_SpriteUpdatePalette (int screen, u32 pal)
 Updates a sprite palette in VRAM with the copy in RAM of it. More...
 
void NF_SpriteGetPalColor (int screen, u32 pal, u32 number, u8 *r, u8 *g, u8 *b)
 Gets the RGB value of a color of a sprites palette in RAM. More...
 

Variables

char * NF_BUFFER_SPR256GFX [NF_SLOTS_SPR256GFX]
 Buffers to hold 256 color sprite graphics.
 
char * NF_BUFFER_SPR256PAL [NF_SLOTS_SPR256PAL]
 Buffers to hold 256 color sprite palettes.
 
NF_TYPE_SPR256GFX_INFO NF_SPR256GFX [NF_SLOTS_SPR256GFX]
 Information of all sprite graphics in RAM.
 
NF_TYPE_SPR256PAL_INFO NF_SPR256PAL [NF_SLOTS_SPR256PAL]
 Information of all palettes in RAM.
 
NF_TYPE_SPR256VRAM_INFO NF_SPR256VRAM [2][128]
 Information of all sprite graphics in VRAM.
 
NF_TYPE_SPRPALSLOT_INFO NF_SPRPALSLOT [2][16]
 Information of all palettes in VRAM.
 
NF_TYPE_SPRITEOAM_INFO NF_SPRITEOAM [2][128]
 OAM information of all sprites.
 
NF_TYPE_SPRVRAM_INFO NF_SPRVRAM [2]
 Information of sprite allocation in VRAM of both screens.
 

Detailed Description

Functions related to 256 color sprites.