mirror of
https://github.com/knightfox75/nds_nflib.git
synced 2025-06-18 16:55:32 -04:00
doxygen: Document remaining functions
This commit is contained in:
parent
0456094207
commit
7dd92e646b
@ -15,28 +15,50 @@ extern "C" {
|
||||
|
||||
#include <nds.h>
|
||||
|
||||
/// @file nf_3d.h
|
||||
/// @brief Functions to setup 3D video options.
|
||||
|
||||
/// @defgroup nf_2d 3D video setup
|
||||
///
|
||||
/// Functions to setup 2D the video modes of the NDS and enable 3D.
|
||||
///
|
||||
/// @{
|
||||
|
||||
|
||||
|
||||
// Funcion NF_Set3D();
|
||||
/// Init 3D mode for the selected screen.
|
||||
///
|
||||
/// Modes:
|
||||
/// 0 - Tiled BGs (256 colors).
|
||||
/// 2 - Affine BGs of 8 bits in layers 2 & 3
|
||||
/// 5 - Bitmap BGs at 8 or 16 bits.
|
||||
///
|
||||
/// The 3D output replaces layer 0.
|
||||
///
|
||||
/// If you set screen 1 for 3D, the screen numbers for 2D will be inverted (the
|
||||
/// top screen will be 1 and the bottom screen will be 0).
|
||||
///
|
||||
/// You must use this function before using 3D sprites.
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
/// // Setup video mode 0 (tiled backgrounds) with 3D
|
||||
/// NF_Set3D(1, 0);
|
||||
/// ```
|
||||
///
|
||||
/// @param screen Screen (0 - 1).
|
||||
/// @param mode Mode (0, 2, 5).
|
||||
void NF_Set3D(u8 screen, u8 mode);
|
||||
// Inicia el modo 3D seleccionado en la pantalla deseada
|
||||
|
||||
|
||||
// Funcion NF_InitOpenGL();
|
||||
/// Initialitzes and configures OpenGL for 3D sprites.
|
||||
///
|
||||
/// NF_Init3dSpriteSys() automaticaly calls it, so the user doesn't need to call
|
||||
/// it manually.
|
||||
void NF_InitOpenGL(void);
|
||||
// Inicializa el OpenGL para la libreria
|
||||
|
||||
|
||||
|
||||
// Funcion NF_GetTextureSize();
|
||||
extern u16 NF_GetTextureSize(u16 textel);
|
||||
// Devuelve el tamaño del textel
|
||||
|
||||
|
||||
|
||||
// Internal use. It takes a texture size in pixels and returns the internal DS
|
||||
// hardware representation of that size.
|
||||
u16 NF_GetTextureSize(u16 textel);
|
||||
|
||||
/// @}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -13,6 +13,8 @@ extern "C" {
|
||||
#ifndef __NF_DEFINES_H__
|
||||
#define __NF_DEFINES_H__
|
||||
|
||||
// TODO: This can probably be replaced by libnds now
|
||||
|
||||
// Definicion de los datos del usuario
|
||||
// Informacion obtenida de PALIB source code
|
||||
// Referencias usadas de http://nds.metawiki.com/Firmware
|
||||
|
104
include/nf_lib.h
104
include/nf_lib.h
@ -13,95 +13,21 @@ extern "C" {
|
||||
#ifndef __NF_LIB_H__
|
||||
#define __NF_LIB_H__
|
||||
|
||||
/*
|
||||
|
||||
Notas sobre BITSHIFT
|
||||
|
||||
(n >> x) Divide n / x
|
||||
(n << x) Multiplica n * x
|
||||
|
||||
Valores de X
|
||||
2 = 1
|
||||
4 = 2
|
||||
8 = 3
|
||||
16 = 4
|
||||
32 = 5
|
||||
64 = 6
|
||||
128 = 7
|
||||
256 = 8
|
||||
512 = 9
|
||||
1024 = 10
|
||||
2048 = 11
|
||||
4096 = 12
|
||||
8192 = 13
|
||||
16384 = 14
|
||||
32768 = 15
|
||||
65536 = 16
|
||||
|
||||
Dado que la DS no tiene unidad de coma flotante, siempre que dividas o
|
||||
multipliques por numeros de base 2, usa el bitshift
|
||||
Por ejemplo:
|
||||
a = (512 / 8);
|
||||
seria equivalente a
|
||||
a = (512 >> 3);
|
||||
Multiplicando
|
||||
b = (3 * 2048);
|
||||
seria con bitshift
|
||||
b = (3 << 11);
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
// Definiciones comunes
|
||||
#include "nf_defines.h"
|
||||
|
||||
// Libreria de funciones basicas y comunes
|
||||
#include "nf_basic.h"
|
||||
|
||||
// Libreria de funciones 2D comunes
|
||||
#include "nf_2d.h"
|
||||
|
||||
// Libreria de fondos con Tiles
|
||||
#include "nf_tiledbg.h"
|
||||
|
||||
// Libreria de fondos Affine
|
||||
#include "nf_affinebg.h"
|
||||
|
||||
// Libreria de fondos en modo Bitmap
|
||||
#include "nf_bitmapbg.h"
|
||||
|
||||
// Libreria de fondos en modo mixto (Tiled / Bitmap 8 bits)
|
||||
#include "nf_mixedbg.h"
|
||||
|
||||
// Libreria de sprites de 256 colores
|
||||
#include "nf_sprite256.h"
|
||||
|
||||
// Libreria de textos
|
||||
#include "nf_text.h"
|
||||
|
||||
// Libreria de textos de 16 pixeles
|
||||
#include "nf_text16.h"
|
||||
|
||||
// Libreria de colisiones
|
||||
#include "nf_collision.h"
|
||||
|
||||
// Libreria de sonido
|
||||
#include "nf_sound.h"
|
||||
|
||||
// Libreria de archivos multimedia
|
||||
#include "nf_media.h"
|
||||
|
||||
// Libreria 3D, funciones comunes
|
||||
#include "nf_3d.h"
|
||||
|
||||
// Libreria 3D, Sprites
|
||||
#include "nf_sprite3d.h"
|
||||
|
||||
|
||||
|
||||
|
||||
#include <nf_2d.h>
|
||||
#include <nf_3d.h>
|
||||
#include <nf_affinebg.h>
|
||||
#include <nf_basic.h>
|
||||
#include <nf_bitmapbg.h>
|
||||
#include <nf_collision.h>
|
||||
#include <nf_defines.h>
|
||||
#include <nf_media.h>
|
||||
#include <nf_mixedbg.h>
|
||||
#include <nf_sound.h>
|
||||
#include <nf_sprite256.h>
|
||||
#include <nf_sprite3d.h>
|
||||
#include <nf_text16.h>
|
||||
#include <nf_text.h>
|
||||
#include <nf_tiledbg.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -15,17 +15,26 @@ extern "C" {
|
||||
|
||||
#include <nds.h>
|
||||
|
||||
/// @file nf_mixedbg.h
|
||||
/// @brief Helpers to use bitmap and tiled backgrounds at the same time.
|
||||
|
||||
/// @defgroup nf_mixedbg Helpers to use bitmap and tiled backgrounds.
|
||||
///
|
||||
/// Helpers to use bitmap and tiled backgrounds at the same time.
|
||||
///
|
||||
/// @{
|
||||
|
||||
// Funcion NF_InitMixedBgSys();
|
||||
/// Initialize mixed background mode (tiled background and 8-bit bitmap).
|
||||
///
|
||||
/// Layers 0 to 2: Tiled, 64 KB (48 KB for tiles, 16 KB for maps).
|
||||
/// Layer 3: 8-bit bitmap, 64 KB.
|
||||
///
|
||||
/// After using this function you can use functions of both background modes.
|
||||
///
|
||||
/// @param screen Screen (0 - 1).
|
||||
void NF_InitMixedBgSys(u8 screen);
|
||||
// Inicializa el modo mixto para fondo (Tiled BG + Bitmap 8 bits)
|
||||
// Capas 0 a 2 - Tiled
|
||||
// Capa 3 - Bitmap 8 bits
|
||||
|
||||
|
||||
|
||||
|
||||
/// @}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -242,6 +242,9 @@ void NF_UnloadSpritePal(u8 id);
|
||||
/// Copy a graphics object from RAM to VRAM of the selected screen to be used as
|
||||
/// a sprite.
|
||||
///
|
||||
/// You must specify if you want to copy all frames to VRAM (false) or just the
|
||||
/// first one (true).
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
/// // Copy the graphics object stored in slot 160 of RAM to slot 23 of VRAM of
|
||||
|
@ -15,221 +15,397 @@ extern "C" {
|
||||
|
||||
#include <nds.h>
|
||||
|
||||
/// @file nf_sprite3d.h
|
||||
/// @brief Functions related to sprites rendered by the 3D GPU.
|
||||
|
||||
/// @defgroup nf_sprite3d 3D sprite functions.
|
||||
///
|
||||
/// These functions are special, since they use the 3D engine to draw sprites
|
||||
/// by using textured polygons. It can only be used in one screen at the same
|
||||
/// time, and background layer 0 is replaced by the 3D output.
|
||||
///
|
||||
/// In return we can create up to 256 sprites of a maximum size of 1024x1024, we
|
||||
/// can use any size in base 2, and use a maximum of 32 palettes simultaneously.
|
||||
///
|
||||
/// For the loading of graphics and palettes, use the same functions as with 2D
|
||||
/// sprites. You can convert indexed images of 256 colors to create textures for
|
||||
/// 3D sprites with the following grit command:
|
||||
///
|
||||
/// ```
|
||||
/// grit image.png -gb -gu8 -gB8 -pu8 -ftb -fh! -gTFF00FF
|
||||
/// ```
|
||||
///
|
||||
/// You can also use the same bat scripts as for 8 bit backgrounds.
|
||||
///
|
||||
/// @{
|
||||
|
||||
//////////////////////////////////
|
||||
// Defines y variables globales //
|
||||
//////////////////////////////////
|
||||
|
||||
// Numero maximo de sprites en pantalla
|
||||
/// Maximum number of slots of 3D sprites
|
||||
#define NF_3DSPRITES 256
|
||||
|
||||
// Estructura de control de los sprites 3d
|
||||
/// Struct that holds information about 3D sprites
|
||||
typedef struct {
|
||||
s16 x; // Coordenada X
|
||||
s16 y; // Coordenada Y
|
||||
s16 z; // Coordenada Z
|
||||
s16 rx; // Rotacion Eje X (-512/0/512) << 6
|
||||
s16 ry; // Rotacion Eje Y (-512/0/512) << 6
|
||||
s16 rz; // Rotacion Eje Z (-512/0/512) << 6
|
||||
bool rot; // Rotacion en uso
|
||||
u16 sx; // Escala X (0/64/512) << 6
|
||||
u16 sy; // Escala Y (0/64/512) << 6
|
||||
bool scale; // Escalado en uso
|
||||
s16 width; // Ancho del sprite
|
||||
s16 height; // Alto del sprite
|
||||
bool inuse; // Esta en uso?
|
||||
bool show; // Debe mostrarse el sprite?
|
||||
u32 gfx_tex_format; // Guarda el formato de la textura
|
||||
u32 gfx; // Direccion donde esta almacenado el grafico en VRAM
|
||||
u16 gfxid; // Id de Gfx usado
|
||||
u16 frame; // Frame actual
|
||||
u16 newframe; // Frame al que cambiar
|
||||
u16 framesize; // Tamaño del frame (en bytes)
|
||||
u16 lastframe; // Ultimo frame
|
||||
u32 gfx_pal_format; // Guarda el formato de la paleta
|
||||
u32 pal; // Direccion donde esta almacenada la paleta en VRAM
|
||||
u16 palid; // Id de la paleta usada
|
||||
u16 prio; // Prioridad de dibujado del sprite
|
||||
u8 poly_id; // Identificador unico para el Alpha (0 por defecto, 63 prohibido)
|
||||
u8 alpha; // Nivel de alpha (0 - 31) (31 por defecto)
|
||||
s16 x; ///< X coordinate
|
||||
s16 y; ///< Y coordinate
|
||||
s16 z; ///< Z coordinate
|
||||
s16 rx; ///< X axis rotation (-512 << 6 to 512 << 6)
|
||||
s16 ry; ///< Y axis rotation (-512 << 6 to 512 << 6)
|
||||
s16 rz; ///< Z axis rotation (-512 << 6 to 512 << 6)
|
||||
bool rot; ///< True if the sprite is being rotated
|
||||
u16 sx; ///< X scale (0 to 64 << 6 to more than 512 << 6)
|
||||
u16 sy; ///< Y scale (0 to 64 << 6 to more than 512 << 6)
|
||||
bool scale; ///< True if the sprite is being scaled
|
||||
s16 width; ///< Sprite width
|
||||
s16 height; ///< Sprite height
|
||||
bool inuse; ///< True if the sprite is being used
|
||||
bool show; ///< True if the sprite has to be drawn
|
||||
u32 gfx_tex_format; ///< Texture format
|
||||
u32 gfx; ///< Address of the texture in VRAM
|
||||
u16 gfxid; ///< ID of the texture/graphics being used by the sprite
|
||||
u16 frame; ///< Current frame
|
||||
u16 newframe; ///< Next frame
|
||||
u16 framesize; ///< Frame size in bytes
|
||||
u16 lastframe; ///< Last frame
|
||||
u32 gfx_pal_format; ///< Palette format
|
||||
u32 pal; ///< Address of the palette in VRAM
|
||||
u16 palid; ///< ID of the palette being used by the sprite
|
||||
u16 prio; ///< Sprite priority (lower values are higher priorities)
|
||||
u8 poly_id; ///< Polygon ID (0 by default, don't use 63)
|
||||
u8 alpha; ///< Alpha value (0 - 31) (31 by default)
|
||||
} NF_TYPE_3DSPRITE_INFO;
|
||||
|
||||
/// Information of all 3D sprites
|
||||
extern NF_TYPE_3DSPRITE_INFO NF_3DSPRITE[NF_3DSPRITES];
|
||||
|
||||
// Estructura de control Texturas en VRAM
|
||||
/// Struct that holds information about 3D sprite textures in VRAM
|
||||
typedef struct {
|
||||
u32 size; // Tamaño (en bytes) del Gfx
|
||||
u16 width; // Ancho del Gfx
|
||||
u16 height; // Altura del Gfx
|
||||
u32 address; // Posicion en la VRAM
|
||||
u16 ramid; // Numero de Slot en RAM del que provienes
|
||||
u16 framesize; // Tamaño del frame (en bytes)
|
||||
u16 lastframe; // Ultimo frame
|
||||
bool keepframes; // Si es un Sprite animado, debes de mantener los frames en RAM ?
|
||||
bool inuse; // Disponibilidat del Slot
|
||||
u32 size; ///< Size of the texture in bytes
|
||||
u16 width; ///< Width
|
||||
u16 height; ///< Height
|
||||
u32 address; ///< Address in VRAM
|
||||
u16 ramid; ///< RAM slot where it comes from
|
||||
u16 framesize; ///< Frame size in bytes
|
||||
u16 lastframe; ///< Last frame
|
||||
bool keepframes; ///< For animated sprites, keep all frames in RAM
|
||||
bool inuse; ///< True if this slot is in use
|
||||
} NF_TYPE_TEX256VRAM_INFO;
|
||||
|
||||
/// Information of all 3D sprite textures in VRAM
|
||||
extern NF_TYPE_TEX256VRAM_INFO NF_TEX256VRAM[NF_3DSPRITES];
|
||||
|
||||
// Estructura de control de las paletas en VRAM
|
||||
/// Struct that holds information about 3D sprite palettes in VRAM
|
||||
typedef struct {
|
||||
bool inuse; // Slot en uso
|
||||
u8 ramslot; // Paleta original en RAM
|
||||
bool inuse; ///< True if this slot is in use
|
||||
u8 ramslot; ///< Slot index of the original palette in RAM
|
||||
} NF_TYPE_3DSPRPALSLOT_INFO;
|
||||
|
||||
/// Information of all 3D sprite palettes in VRAM
|
||||
extern NF_TYPE_3DSPRPALSLOT_INFO NF_TEXPALSLOT[32];
|
||||
|
||||
// Define la esturctura de control de la VRAM para Sprites 3d
|
||||
/// Struct with information of 3D sprite allocation in VRAM
|
||||
typedef struct {
|
||||
s32 free; // Memoria VRAM libre
|
||||
u32 next; // Siguiente posicion libre
|
||||
u32 last; // Ultima posicion usada
|
||||
u32 pos[NF_3DSPRITES]; // Posicion en VRAM para reusar despues de un borrado
|
||||
u32 size[NF_3DSPRITES]; // Tamaño del bloque libre para reusar
|
||||
u16 deleted; // Numero de bloques borrados
|
||||
s32 fragmented; // Memoria VRAM fragmentada
|
||||
s32 inarow; // Memoria VRAM contigua
|
||||
s32 free; ///< Free VRAM
|
||||
u32 next; ///< Next free location
|
||||
u32 last; ///< Last used location
|
||||
u32 pos[NF_3DSPRITES]; ///< Location in VRAM to reuse after a free
|
||||
u32 size[NF_3DSPRITES]; ///< Size of the block to reuse
|
||||
u16 deleted; ///< Number of free'd blocks
|
||||
s32 fragmented; ///< Fragmented VRAM
|
||||
s32 inarow; ///< Contiguous VRAM
|
||||
} NF_TYPE_TEXVRAM_INFO;
|
||||
extern NF_TYPE_TEXVRAM_INFO NF_TEXVRAM; // Informacion VRAM de texturas
|
||||
|
||||
/// Information of 3D sprite allocation in VRAM
|
||||
extern NF_TYPE_TEXVRAM_INFO NF_TEXVRAM;
|
||||
|
||||
// Define la estructura de control de los sprites 3d creados
|
||||
/// Struct with information about created 3D sprites
|
||||
typedef struct {
|
||||
s16 total; // Numero de sprites creados
|
||||
u16 id[NF_3DSPRITES]; // ID del Sprite
|
||||
u16 bck[NF_3DSPRITES]; // Backup del ID
|
||||
s16 total; ///< Total number of 3D sprites created
|
||||
u16 id[NF_3DSPRITES]; ///< Sprite IDs
|
||||
u16 bck[NF_3DSPRITES]; ///< Backup IDs
|
||||
} NF_TYPE_CREATED_3DSPRITE_INFO;
|
||||
|
||||
/// Information of created 3D sprites
|
||||
extern NF_TYPE_CREATED_3DSPRITE_INFO NF_CREATED_3DSPRITE;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Funcion NF_Init3dSpriteSys();
|
||||
/// Initialize 3D sprite system.
|
||||
///
|
||||
/// Asigns 128 KB of VRAM for textures and 16 KB for palettes.
|
||||
///
|
||||
/// It enables extended palettes.
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
/// // Initialize the 3D sprite system
|
||||
/// NF_Init3dSpriteSys();
|
||||
/// ```
|
||||
void NF_Init3dSpriteSys(void);
|
||||
// Inicializa el sistema de Sprites en 3D
|
||||
|
||||
|
||||
// Funcion NF_Vram3dSpriteGfx();
|
||||
/// Copy a texture from RAM to VRAM to use it for 3D sprites.
|
||||
///
|
||||
/// You must specify if you want to copy all frames to VRAM (false) or just the
|
||||
/// first one (true).
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
/// // Copy the texture stored in slot 160 of RAM to slot 23 of VRAM, copying
|
||||
/// // all frames if it's animated.
|
||||
/// NF_Vram3dSpriteGfx(160, 23, false);
|
||||
/// ```
|
||||
///
|
||||
/// @param ram RAM slot (0 - 255)
|
||||
/// @param vram VRAM slot (0 - 255)
|
||||
/// @param keepframes For animated sprites. If true, copy all frames to VRAM.
|
||||
void NF_Vram3dSpriteGfx(u16 ram, u16 vram, bool keepframes);
|
||||
// Transfiere un grafico de la RAM a la VRAM
|
||||
|
||||
|
||||
// Funcion NF_Free3dSpriteGfx();
|
||||
/// Delete from VRAM the texture in the selected slot.
|
||||
///
|
||||
/// You mustn't delete the graphics while a sprite is using them.
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
/// // Delete from VRAM the texture in slot 34.
|
||||
/// NF_Free3dSpriteGfx(34);
|
||||
/// ```
|
||||
///
|
||||
/// @param id VRAM slot (0 - 255)
|
||||
void NF_Free3dSpriteGfx(u16 id);
|
||||
// Elimina de la VRAM un grafico de texturas y desfragmenta la VRAM si es necesario
|
||||
|
||||
|
||||
// Funcion NF_Vram3dSpriteGfxDefrag();
|
||||
/// Defragments the free VRAM used for 3D sprite textures.
|
||||
///
|
||||
/// This function is automaticaly executed when fragmented free VRAM is bigger
|
||||
/// than 50% of the total free VRAM. You don’t need to manually execute this
|
||||
/// function. You can get the state of VRAM reading the following variables:
|
||||
///
|
||||
/// ```
|
||||
/// NF_TEXVRAM[u8 screen].free // Total free VRAM
|
||||
/// NF_TEXVRAM[u8 screen].fragmented // Total fragmented free VRAM
|
||||
/// NF_TEXVRAM[u8 screen].inarow // Largest free block of VRAM at the end
|
||||
/// NF_TEXVRAM[u8 screen].lost // Unusable free VRAM because fragmentation
|
||||
/// ```
|
||||
void NF_Vram3dSpriteGfxDefrag(void);
|
||||
// Desfragmenta la VRAM usada para texturas
|
||||
|
||||
|
||||
// Funcion NF_Vram3dSpritePal();
|
||||
/// Copy a palette from RAM to the specified slot in VRAM.
|
||||
///
|
||||
/// If the slot is in use, its contents are overwritten.
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
/// // Copy the palette from RAM slot 56 to VRAM slot 8
|
||||
/// NF_VramSpritePal(56, 8);
|
||||
/// ```
|
||||
///
|
||||
/// @param id RAM slot (0 - 64)
|
||||
/// @param slot VRAM slot (0 - 31)
|
||||
void NF_Vram3dSpritePal(u8 id, u8 slot);
|
||||
// Copia una paleta a la VRAM
|
||||
|
||||
|
||||
// Funcion NF_Create3dSprite();
|
||||
/// Create a 3D sprite with the specified ID and display it on the screen.
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
/// // Create a sprite with ID 12, using the texture stored in slot 30 of VRAM
|
||||
/// // and the palette in slot 1. The sprite is created at coordinates (100, 50)
|
||||
/// NF_Create3dSprite(12, 30, 1, 100, 50);
|
||||
/// ```
|
||||
///
|
||||
/// @param id Sprite ID (0 - 255).
|
||||
/// @param gfx Texture slot (0 - 255).
|
||||
/// @param pal Palette slot (0 - 31).
|
||||
/// @param x X coordinate.
|
||||
/// @param y Y coordinate.
|
||||
void NF_Create3dSprite(u16 id, u16 gfx, u16 pal, s16 x, s16 y);
|
||||
// Crea un Sprite 3D en las coordenadas indicadas
|
||||
|
||||
|
||||
// Funcion NF_Delete3dSprite();
|
||||
/// Remove the sprite with the specified ID from the screen.
|
||||
///
|
||||
/// The texture and palette used by the sprite won't be deleted from VRAM.
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
/// // Delete from screen the sprite with ID 12
|
||||
/// NF_Delete3dSprite(12);
|
||||
/// ```
|
||||
///
|
||||
/// @param id Sprite ID (0 - 255).
|
||||
void NF_Delete3dSprite(u16 id);
|
||||
// Borra el Sprite con la ID indicada
|
||||
|
||||
|
||||
// Funcion NF_Sort3dSprites();
|
||||
/// Sets the priorities of 3D sprites based on their sprite IDs.
|
||||
///
|
||||
/// Lower sprite IDs have higher priorities.
|
||||
void NF_Sort3dSprites(void);
|
||||
// Reordena la cola de Sprites 3D creados de menor a mayor segun su ID
|
||||
// Los Sprites con numeros mas bajos tienen prioridad.
|
||||
|
||||
|
||||
// Funcion NF_Set3dSpritePriority();
|
||||
/// Changes the draw priority of the 3D sprite with the specified ID.
|
||||
///
|
||||
/// Lower priority values have a higher priority.
|
||||
///
|
||||
/// @param id Sprite ID (0 - 255).
|
||||
/// @param prio Priority (0 - 255).
|
||||
void NF_Set3dSpritePriority(u16 id, u16 prio);
|
||||
// Cambia la prioridad del Sprite
|
||||
|
||||
|
||||
// Funcion NF_Swap3dSpritePriority();
|
||||
/// Swaps the priority of two 3D sprites.
|
||||
///
|
||||
/// @param id_a Sprite ID A (0 - 255).
|
||||
/// @param id_b Sprite ID B (0 - 255).
|
||||
void NF_Swap3dSpritePriority(u16 id_a, u16 id_b);
|
||||
// Intercambia la prioridad de dos Sprites
|
||||
|
||||
|
||||
// Funcion NF_Move3dSprite();
|
||||
/// Move a 3D sprite to the specified position.
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
/// // Moves 3D sprite 35 to coordinates (100, 50).
|
||||
/// NF_Move3dSprite(35, 100, 50);
|
||||
/// ```
|
||||
///
|
||||
/// @param id Sprite ID (0 - 255).
|
||||
/// @param x X coordinate.
|
||||
/// @param y Y coordinate.
|
||||
void NF_Move3dSprite(u16 id, s16 x, s16 y);
|
||||
// Mueve el Sprite seleccionado a las coordenadas dadas
|
||||
|
||||
|
||||
// Funcion NF_Show3dSprite();
|
||||
/// Show or hide a 3D sprite.
|
||||
///
|
||||
/// If you hide it, the 3D sprite becomes invisible, but it isn't deleted.
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
/// // Hide 3D sprite 35.
|
||||
/// NF_Show3dSprite(35, false);
|
||||
/// // Make 3D sprite 45 visible
|
||||
/// NF_Show3dSprite(45, true);
|
||||
/// ```
|
||||
///
|
||||
/// @param id Sprite ID (0 - 255).
|
||||
/// @param show True to show the sprite, false to hide it.
|
||||
void NF_Show3dSprite(u16 id, bool show);
|
||||
// Muestra u oculta el sprite con la id indicada
|
||||
|
||||
|
||||
// Funcion NF_Set3dSpriteFrame();
|
||||
/// Select the frame of an animation to display in the 3D sprite.
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
/// // Make sprite 20 show frame 5
|
||||
/// NF_Set3dSpriteFrame(20, 5);
|
||||
/// ```
|
||||
///
|
||||
/// @param id Sprite ID (0 - 255).
|
||||
/// @param frame Frame index.
|
||||
void NF_Set3dSpriteFrame(u16 id, u16 frame);
|
||||
// Cambia el frame visible del sprite indicado
|
||||
|
||||
|
||||
// Funcion NF_Draw3dSprites();
|
||||
/// Draw all created 3D sprites on the screen.
|
||||
///
|
||||
/// You need to call this function once per frame. This is the basic code to
|
||||
/// show them:
|
||||
/// ```
|
||||
/// // Draw all 3D Sprites
|
||||
/// NF_Draw3dSprites();
|
||||
/// // Tell the 3D hardware that all commands for this frame have been sent
|
||||
/// glFlush(0);
|
||||
/// // Wait for the vertical sync
|
||||
/// swiWaitForVBlank();
|
||||
/// ```
|
||||
void NF_Draw3dSprites(void);
|
||||
// Dibuja en pantalla todos los sprites creados
|
||||
|
||||
|
||||
// Funcion NF_Update3dSpritesGfx();
|
||||
/// Update the textures of all animated 3D sprites that need it.
|
||||
///
|
||||
/// Use this if any of your 3D sprites has the flag "keepframes" set to true.
|
||||
///
|
||||
/// Call this function just after swiWaitForVBlank().
|
||||
void NF_Update3dSpritesGfx(void);
|
||||
// Actualiza si es necesario las texturas de los sprites animados
|
||||
|
||||
|
||||
// Funcion NF_Rotate3dSprite();
|
||||
/// Rotates a 3D sprite on its 3 axes.
|
||||
///
|
||||
/// You can set a rotation between -512 and 512, with 0 meaning no rotation.
|
||||
///
|
||||
/// @param id Sprite ID (0 - 255).
|
||||
/// @param x Rotation by X axis.
|
||||
/// @param y Rotation by Y axis.
|
||||
/// @param z Rotation by Z axis.
|
||||
void NF_Rotate3dSprite(u16 id, s16 x, s16 y, s16 z);
|
||||
// Rota el Sprite sobre los ejes indicados (-512/0/512)
|
||||
|
||||
|
||||
// Funcion NF_Scale3dSprite();
|
||||
/// Scales 3D sprite on X and Y axes.
|
||||
///
|
||||
/// The scale range goes from 0 to 64 (original size) to any greater value.
|
||||
///
|
||||
/// @param id Sprite ID (0 - 255).
|
||||
/// @param x X axis scale.
|
||||
/// @param y Y axis scale.
|
||||
void NF_Scale3dSprite(u16 id, u16 x, u16 y);
|
||||
// Escala el sprite al tamaño indicado (0/64/512)
|
||||
|
||||
|
||||
// Funcion NF_Blend3dSprite();
|
||||
/// Set the alpha level of a 3D sprite.
|
||||
///
|
||||
/// For transparency to work properly between different translucent sprites you
|
||||
/// need to use different polygon IDs for them (between 1 and 62). The alpha
|
||||
/// range is 0 to 31, with 31 being fully opaque.
|
||||
///
|
||||
/// To disable transparency, select an alpha value of 31 or a polygon ID of 0.
|
||||
///
|
||||
/// @param sprite Sprite ID (0 - 255).
|
||||
/// @param poly_id Polygon ID (1 - 62).
|
||||
/// @param alpha Transparency (0 - 31).
|
||||
void NF_Blend3dSprite(u8 sprite, u8 poly_id, u8 alpha);
|
||||
// Habilita y cambia el nivel de alpha de el sprite 3d indicado. Para que la transparencia
|
||||
// sea efectiva entre Sprites, debes especificar un poly_id diferente para cada sprite
|
||||
// (entre 1 y 62). El rango de alpha es de 0 a 31, siendo 31 opaco. Para eliminar la
|
||||
// transparencia, selecciona un valor para alpha de 31 o especifica como poly_id el nº 0.
|
||||
|
||||
|
||||
// Funcion NF_3dSpritesLayer();
|
||||
/// Select the layer where 3D sprites are drawn.
|
||||
///
|
||||
/// This function only changes the priority of background layer 0. The 3D output
|
||||
/// can only be sent to layer 0 because of how the hardware was designed.
|
||||
///
|
||||
/// @param layer Layer (0 - 3).
|
||||
void NF_3dSpritesLayer(u8 layer);
|
||||
// Selecciona la capa en la que se dibujaran los Sprites 3D. (0 - 3)
|
||||
// En realidad los Sprites 3D siempre se dibujan sobre la CAPA 0, esta funcion solo cambia
|
||||
// la prioridad de esta capa sobre las demas.
|
||||
|
||||
|
||||
// Funcion NF_3dSpriteEditPalColor();
|
||||
/// Changes one color of one 3D sprite palette.
|
||||
///
|
||||
/// The change is made to the RAM copy of the palette, so you won't see any
|
||||
/// change until you update the VRAM copy with NF_3dSpriteUpdatePalette(). Use
|
||||
/// this function to make cool effects with your 3D sprites.
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
/// // Set color 1 of palette 3 to red
|
||||
/// NF_3dSpriteSetPalColor(3, 1, 31, 0, 0);
|
||||
/// ```
|
||||
///
|
||||
/// @param pal Palette slot (0 - 31).
|
||||
/// @param number Color number (0 - 255).
|
||||
/// @param r Red component (0 - 31).
|
||||
/// @param g Green component (0 - 31).
|
||||
/// @param b Blue component (0 - 31).
|
||||
void NF_3dSpriteEditPalColor(u8 pal, u8 number, u8 r, u8 g, u8 b);
|
||||
// Modifica los valores de la paleta seleccionada. Las modificaciones se efectuan
|
||||
// sobre la copia en RAM, por lo que los cambios no seran visibles hasta que se
|
||||
// transfiera la paleta a la VRAM
|
||||
|
||||
|
||||
// Funcion NF_3dSpriteUpdatePalette();
|
||||
/// Updates the VRAM copy of a palette with the RAM copy of it.
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
/// // Update palette 2
|
||||
/// NF_3dSpriteUpdatePalette(2);
|
||||
/// ```
|
||||
///
|
||||
/// @param pal Palette slot (0 - 31).
|
||||
void NF_3dSpriteUpdatePalette(u8 pal);
|
||||
// Actualiza la paleta en VRAM con la copia que se encuentra en la RAM
|
||||
|
||||
|
||||
// Funcion NF_3dSpriteGetPalColor();
|
||||
/// Gets the RGB value of a color from a 3D sprite palette loaded in RAM.
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
/// // Gets the RGB values of color 200 of sprite palette 3 and stores it in
|
||||
/// // variables "red", "green" and "blue".
|
||||
/// u8 red;
|
||||
/// u8 green;
|
||||
/// u8 blue;
|
||||
/// NF_3dSpriteGetPalColor(3, 200, &red, &green, &blue);
|
||||
/// ```
|
||||
///
|
||||
/// @param pal Palette slot (0 - 31).
|
||||
/// @param number Color number (0 - 255).
|
||||
/// @param r Red component (0 - 31).
|
||||
/// @param g Green component (0 - 31).
|
||||
/// @param b Blue component (0 - 31).
|
||||
void NF_3dSpriteGetPalColor(u8 pal, u8 number, u8* r, u8* g, u8* b);
|
||||
// Obtiene el valor de un color de la paleta que se encuentra en la RAM
|
||||
|
||||
|
||||
// Funcion NF_3dSpriteSetDeep();
|
||||
/// Sets the depth of the selected 3D sprite.
|
||||
///
|
||||
/// -512 is highest priority (on top of the other sprites). 0 is the default
|
||||
/// value, and 512 the lowest priority.
|
||||
///
|
||||
/// Change the sprite depth to prevent it from intersecting with other sprites
|
||||
/// when rotation or zoom are applied.
|
||||
void NF_3dSpriteSetDeep(u8 id, s16 z);
|
||||
// Cambia la profuncidad de dibujado (z) del sprite (-512/0/512),
|
||||
// siendo -512 el punto mas cercano, 0 el centro por defecto
|
||||
// y 512 el punto mas lejano.
|
||||
|
||||
|
||||
|
||||
|
||||
/// @}
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user