AnimaEngine  1.0.0
Nintendo DS Pokemon Black, White, Black 2, and White 2 sprite extraction and preview toolchain
Data Structures | Typedefs | Functions
nds_fnt.c File Reference
#include "nds_fnt.h"
#include "file_util.h"

Data Structures

struct  NdsFntDir
 

Typedefs

typedef struct NdsFntDir NdsFntDir
 

Functions

static int NdsFnt_GetDir (const u8 *fnt, size_t fnt_size, u16 dir_id, NdsFntDir *out_dir)
 
static int NameMatches (const u8 *name, size_t name_len, const char *component, size_t component_len)
 
static int NdsFnt_FindInDir (const u8 *fnt, size_t fnt_size, u16 dir_id, const char *component, size_t component_len, int is_last_component, int *out_file_id, u16 *out_dir_id)
 
int NdsFnt_FindFileId (const u8 *fnt, size_t fnt_size, const char *path, int *out_file_id)
 Scans the FNT structures to resolve the file ID matching a virtual filesystem path. More...
 

Typedef Documentation

◆ NdsFntDir

typedef struct NdsFntDir NdsFntDir

Function Documentation

◆ NameMatches()

static int NameMatches ( const u8 name,
size_t  name_len,
const char *  component,
size_t  component_len 
)
static

◆ NdsFnt_FindFileId()

int NdsFnt_FindFileId ( const u8 fnt,
size_t  fnt_size,
const char *  path,
int *  out_file_id 
)

Scans the FNT structures to resolve the file ID matching a virtual filesystem path.

Parameters
fntPointer to raw binary File Name Table buffer.
fnt_sizeSize of FNT buffer in bytes.
pathVirtual filesystem path string (e.g. "/a/0/0/4").
out_file_idDestination pointer to store the matching file ID.
Returns
0 on success; negative value on file path resolution failure.

◆ NdsFnt_FindInDir()

static int NdsFnt_FindInDir ( const u8 fnt,
size_t  fnt_size,
u16  dir_id,
const char *  component,
size_t  component_len,
int  is_last_component,
int *  out_file_id,
u16 out_dir_id 
)
static

◆ NdsFnt_GetDir()

static int NdsFnt_GetDir ( const u8 fnt,
size_t  fnt_size,
u16  dir_id,
NdsFntDir out_dir 
)
static