34 #ifndef __MLV__MLV_ANIMATION_H__
35 #define __MLV__MLV_ANIMATION_H__
37 #include "MLV_image.h"
38 #include "MLV_audio.h"
91 typedef struct _MLV_Animation MLV_Animation;
121 MLV_Animation* MLV_create_animation(
122 unsigned int nb_frames,
unsigned int nb_layers,
unsigned int nb_channels
130 void MLV_free_animation( MLV_Animation* animation );
145 void MLV_change_frame_in_animation(
146 MLV_Image** array_of_images, MLV_Sound** array_of_sounds,
unsigned int delay,
147 MLV_Animation* animation,
unsigned int position
160 void MLV_change_frame_image_in_animation(
161 MLV_Image* image, MLV_Animation* animation,
unsigned int position,
175 void MLV_change_frame_sound_in_animation(
176 MLV_Sound* sound, MLV_Animation* animation,
unsigned int position,
187 void MLV_change_frame_delay_in_animation(
188 unsigned int delay, MLV_Animation* animation,
unsigned int position
201 void MLV_get_frame_from_animation(
202 MLV_Animation* animation,
unsigned int position,
204 MLV_Image** image,
unsigned int* delay
218 int MLV_get_frame_delay_from_animation(
219 MLV_Animation* animation,
unsigned int position
232 MLV_Image* MLV_get_frame_image_from_animation(
233 MLV_Animation* animation,
unsigned int position,
290 typedef struct _MLV_Animation_player MLV_Animation_player;
301 MLV_Animation_player* MLV_create_animation_player( MLV_Animation* animation );
308 void MLV_free_animation_player( MLV_Animation_player* animation_player );
315 void MLV_play_animation_player( MLV_Animation_player* animation_player );
322 void MLV_play_revert_animation_player( MLV_Animation_player* animation_player );
329 void MLV_stop_animation_player( MLV_Animation_player* animation_player );
337 void MLV_rewind_animation_player( MLV_Animation_player* animation_player );
344 void MLV_next_frame( MLV_Animation_player* animation_player );
351 void MLV_previous_frame( MLV_Animation_player* animation_player );
364 void MLV_update_animation_player( MLV_Animation_player* animation_player );
373 void MLV_change_sound_volume_of_animation_player(
374 MLV_Animation_player* animation_player,
unsigned int channel,
float volume
383 void MLV_turn_on_sound_of_animation_player(
384 MLV_Animation_player* animation_player,
unsigned int channel
393 void MLV_turn_off_sound_of_animation_player(
394 MLV_Animation_player* animation_player,
unsigned int channel
413 void MLV_draw_image_from_animation_player(
414 MLV_Animation_player* animation_player,
unsigned int layer,
427 void MLV_play_sound_from_animation_player(
428 MLV_Animation_player* animation_player,
unsigned int layer
453 void MLV_play_sounds_from_animation_player(
454 MLV_Animation_player* animation_player,
467 void MLV_play_list_of_sounds_from_animation_player(
468 MLV_Animation_player* animation_player,
unsigned int* layers,
469 unsigned int nb_layers
490 void MLV_draw_partial_image_from_animation_player(
491 MLV_Animation_player* animation_player,
unsigned int layer,
492 int source_x,
int source_y,
int source_width,
int source_height,
509 void MLV_draw_image_from_animation_player_on_image(
510 MLV_Animation_player* animation_player,
unsigned int layer,
532 void MLV_draw_partial_image_from_animation_player_on_image(
533 MLV_Animation_player* animation_player,
unsigned int layer,
534 int source_x,
int source_y,
int source_width,
int source_height,
553 typedef struct _MLV_Animation_book MLV_Animation_book;
570 MLV_Animation_book* MLV_load_animation_book(
571 const char* xml_file,
572 const char* image_directory,
573 const char* sound_directory
581 void MLV_free_animation_book(
582 MLV_Animation_book* animation_book
591 int MLV_get_number_of_animations(
592 MLV_Animation_book* animation_book
602 MLV_Animation* MLV_get_animation_from_id(
603 MLV_Animation_book* animation_book,
614 MLV_Animation* MLV_get_animation_from_name(
615 MLV_Animation_book* animation_book,
627 const char* MLV_get_name_from_id_animation(
628 MLV_Animation_book* animation_book,
int id_animation
645 void MLV_add_frame_in_animation(
646 MLV_Image** array_of_images, MLV_Sound** array_of_sounds,
unsigned int delay,
647 MLV_Animation* animation