AnimaEngine  1.0.0
Nintendo DS Pokemon Black, White, Black 2, and White 2 sprite extraction and preview toolchain
nanr.h
Go to the documentation of this file.
1 
6 #ifndef NANR_H
7 #define NANR_H
8 
9 #include "common.h"
10 
11 #define NANR_SCALE_ONE 4096
12 #define NANR_ROTATION_FULL 65536.0
17 typedef struct NanrFrame {
19  int cell_id;
20  int duration;
23  int rotation;
24  int scale_x;
25  int scale_y;
29 
33 typedef struct NanrAnimation {
35  int loop_start;
37  int format;
41 
45 typedef struct NanrFile {
49 
57 int Nanr_Parse(const u8 *data, size_t size, NanrFile *out_nanr);
58 
63 void Nanr_Free(NanrFile *nanr);
64 
74  const NanrFile *nanr,
75  int animation_index,
76  int frame_index,
77  NanrFrame *out_frame
78 );
79 
89  const NanrFile *nanr,
90  int animation_index,
91  int tick,
92  NanrFrame *out_frame
93 );
94 
99 void Nanr_PrintInfo(const NanrFile *nanr);
100 
101 #endif
102 
Common types, macros, and standard library includes used throughout AnimaEngine.
unsigned int u32
Definition: common.h:16
unsigned short u16
Definition: common.h:15
unsigned char u8
Definition: common.h:14
void Nanr_PrintInfo(const NanrFile *nanr)
Debug printing routine to write parsed .NANR layout contents to stdout.
Definition: nanr.c:546
int Nanr_GetResolvedCellIdAtTick(const NanrFile *nanr, int animation_index, int tick, NanrFrame *out_frame)
Resolves keyframe attributes at a specific tick timing step.
Definition: nanr.c:503
int Nanr_Parse(const u8 *data, size_t size, NanrFile *out_nanr)
Parses an unpacked .NANR resource block from raw bytes.
Definition: nanr.c:231
int Nanr_GetResolvedCellId(const NanrFile *nanr, int animation_index, int frame_index, NanrFrame *out_frame)
Retrieves information for a specific keyframe in a timeline sequence.
Definition: nanr.c:476
void Nanr_Free(NanrFile *nanr)
Deallocates all resources held inside a NanrFile structure.
Definition: nanr.c:456
struct NanrAnimation NanrAnimation
Animation timeline sequence block containing multiple frames.
struct NanrFrame NanrFrame
Represents a single keyframe in an animation timeline.
struct NanrFile NanrFile
Unpacked representation of a complete .NANR resource file.
Animation timeline sequence block containing multiple frames.
Definition: nanr.h:33
int loop_start
Definition: nanr.h:35
u32 raw_frame_offset
Definition: nanr.h:38
int frame_count
Definition: nanr.h:34
int format
Definition: nanr.h:37
NanrFrame * frames
Definition: nanr.h:39
int playback_type
Definition: nanr.h:36
Unpacked representation of a complete .NANR resource file.
Definition: nanr.h:45
NanrAnimation * animations
Definition: nanr.h:47
int animation_count
Definition: nanr.h:46
Represents a single keyframe in an animation timeline.
Definition: nanr.h:17
int rotation
Definition: nanr.h:23
int duration
Definition: nanr.h:20
int transform_type
Definition: nanr.h:22
int scale_y
Definition: nanr.h:25
int translate_x
Definition: nanr.h:26
int translate_y
Definition: nanr.h:27
u32 raw_cell_value
Definition: nanr.h:18
u16 marker
Definition: nanr.h:21
int cell_id
Definition: nanr.h:19
int scale_x
Definition: nanr.h:24