![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
Data Structures | |
struct | ANIM_DATA |
animation properties More... | |
struct | ANIM_FRAME |
struct of the properties of a frame in an animation More... | |
struct | ANIM_GFX |
struct of an animation More... | |
struct | ANIM_LIB |
structure of a library of gfxs More... | |
Functions | |
int | add_bmp_to_lib (ANIM_LIB *lib, unsigned int pos, char *file, char *resfile) |
add a bitmap to a ANIM_LIB *lib | |
ANIM_LIB * | create_anim_library (char *name, unsigned int size) |
Allocate an animation library. | |
int | delete_bmp_from_lib (ANIM_LIB *lib, unsigned int id) |
Delete the frame at 'id' from 'lib'. | |
int | destroy_anim_lib (ANIM_LIB **lib) |
Destroy an animation library. | |
int | draw_anim (ANIM_DATA *data, int x, int y) |
blit an ANIM_DATA at position x,y ( current selected video buffer is used ) | |
int | update_anim (ANIM_DATA *data, unsigned int delta_t) |
compute and update an ANIM_DATA context based on elapsed delta_t time in usecs | |
struct ANIM_DATA |
Data Fields | ||
---|---|---|
unsigned int | elapsed | elapsed time since last frame change |
unsigned int | frame | id of the current frame |
unsigned int | id | |
ANIM_LIB * | lib | pointer to an anim gfx library |
unsigned int | x | x coordinate of the animation |
unsigned int | y | y coordinate of the animation |
struct ANIM_FRAME |
struct ANIM_GFX |
Data Fields | ||
---|---|---|
ALLEGRO_BITMAP * | bmp | bitmap with a list of lil' bitmap inside |
ANIM_FRAME * | frames | each frame properties |
unsigned int | h | height of a frame |
unsigned int | nb_frames | nb frames in anim |
unsigned int | type | blit type: masked with color, blended, brut |
unsigned int | w | width of a frame |
struct ANIM_LIB |
int add_bmp_to_lib | ( | ANIM_LIB * | lib, |
unsigned int | pos, | ||
char * | file, | ||
char * | resfile | ||
) |
add a bitmap to a ANIM_LIB *lib
lib | targetted library |
pos | position in the animation library |
file | input bitmap file |
resfile | associated input bitmap text file |
Definition at line 82 of file n_anim.c.
References __n_assert, ANIM_GFX::bmp, ANIM_GFX::frames, Free, gfxs, ANIM_GFX::h, LOG_ERR, Malloc, n_log, name, ANIM_GFX::nb_frames, nb_max_gfxs, and ANIM_GFX::w.
ANIM_LIB * create_anim_library | ( | char * | name, |
unsigned int | size | ||
) |
Allocate an animation library.
name | Name for the library or NULL (in which case 'generic_name' will be assigned) |
size | Number of animations |
Definition at line 18 of file n_anim.c.
References __n_assert, gfxs, LOG_ERR, Malloc, n_log, name, and nb_max_gfxs.
int delete_bmp_from_lib | ( | ANIM_LIB * | lib, |
unsigned int | id | ||
) |
Delete the frame at 'id' from 'lib'.
lib | Target animation stream |
id | Id of the frame to delete |
Definition at line 66 of file n_anim.c.
References __n_assert, and gfxs.
int destroy_anim_lib | ( | ANIM_LIB ** | lib | ) |
Destroy an animation library.
lib | animation library to destroy |
Definition at line 50 of file n_anim.c.
References __n_assert, Free, and FreeNoLog.
int draw_anim | ( | ANIM_DATA * | data, |
int | x, | ||
int | y | ||
) |
blit an ANIM_DATA at position x,y ( current selected video buffer is used )
data | ANIM_DATA *source to use |
x | x position on screen |
y | y position on screen |
Definition at line 187 of file n_anim.c.
References ANIM_GFX::bmp, ANIM_DATA::frame, ANIM_GFX::frames, gfxs, ANIM_GFX::h, ANIM_DATA::lib, and ANIM_GFX::w.
int update_anim | ( | ANIM_DATA * | data, |
unsigned int | delta_t | ||
) |
compute and update an ANIM_DATA context based on elapsed delta_t time in usecs
data | targetted ANIM_DATA |
delta_t | elapsed time to apply (usecs) |
Definition at line 167 of file n_anim.c.
References __n_assert, ANIM_DATA::elapsed, ANIM_DATA::frame, ANIM_GFX::frames, gfxs, ANIM_DATA::lib, and ANIM_GFX::nb_frames.