.TH "MLV_animation.h" 3 "Dimanche 11 Avril 2021" "MLV-3.1.0" \" -*- nroff -*- .ad l .nh .SH NAME MLV_animation.h \- Ce fichier définit les prototypes des fonctions permettant de mettre en oeuvre des animations\&. .SH SYNOPSIS .br .PP .SS "Définitions de type" .in +1c .ti -1c .RI "typedef struct _MLV_Animation \fBMLV_Animation\fP" .br .RI "Ce type code une animation\&. " .ti -1c .RI "typedef struct _MLV_Animation_player \fBMLV_Animation_player\fP" .br .RI "Ce type code un lecteur d'animation\&. " .ti -1c .RI "typedef struct _MLV_Animation_book \fBMLV_Animation_book\fP" .br .RI "Ce type correspond à un livre contenant de nombreuses animations\&. " .in -1c .SS "Fonctions" .in +1c .ti -1c .RI "\fBMLV_Animation\fP * \fBMLV_create_animation\fP (unsigned int nb_frames, unsigned int nb_layers, unsigned int nb_channels)" .br .RI "Créé une animation comportant un nombre d'image donné " .ti -1c .RI "void \fBMLV_free_animation\fP (\fBMLV_Animation\fP *animation)" .br .RI "Cette fonction libère les données allouées pour l'animation\&. " .ti -1c .RI "void \fBMLV_change_frame_in_animation\fP (\fBMLV_Image\fP **array_of_images, \fBMLV_Sound\fP **array_of_sounds, unsigned int delay, \fBMLV_Animation\fP *animation, unsigned int position)" .br .RI "Change un animation en remplacant une image et son temps d'affichage associé\&. L'image concerné est repéré à l'aide de son index et de l'index de la couche où elle appartient\&. " .ti -1c .RI "void \fBMLV_change_frame_image_in_animation\fP (\fBMLV_Image\fP *image, \fBMLV_Animation\fP *animation, unsigned int position, unsigned int layer)" .br .RI "Change un animation en remplacant uniquement une image\&. L'image concerné est repéré à l'aide de son index et de de l'index de sa couche\&. " .ti -1c .RI "void \fBMLV_change_frame_sound_in_animation\fP (\fBMLV_Sound\fP *sound, \fBMLV_Animation\fP *animation, unsigned int position, unsigned int channel)" .br .RI "Change un animation en remplacant uniquement un bruitage\&. Le son image concerné est repéré à l'aide de son index et de de l'index de son canaul\&. " .ti -1c .RI "void \fBMLV_change_frame_delay_in_animation\fP (unsigned int delay, \fBMLV_Animation\fP *animation, unsigned int position)" .br .RI "Change le temps d'affichage d'une image donnée d'une animation\&. " .ti -1c .RI "void \fBMLV_get_frame_from_animation\fP (\fBMLV_Animation\fP *animation, unsigned int position, unsigned int layer, \fBMLV_Image\fP **image, unsigned int *delay)" .br .RI "Recupère l'image et le temps présents à une position et une couche donnée d'une animation\&. " .ti -1c .RI "int \fBMLV_get_frame_delay_from_animation\fP (\fBMLV_Animation\fP *animation, unsigned int position)" .br .RI "Renvoie le temps d'affichage de l'image présente à une position donnée d'une animation donnée\&. " .ti -1c .RI "\fBMLV_Image\fP * \fBMLV_get_frame_image_from_animation\fP (\fBMLV_Animation\fP *animation, unsigned int position, unsigned int layer)" .br .RI "Renvoie l'image présente à une position et une couche donnée d'une animation donnée\&. " .ti -1c .RI "\fBMLV_Animation_player\fP * \fBMLV_create_animation_player\fP (\fBMLV_Animation\fP *animation)" .br .RI "Cree un lecteur d'animation et l'initialise avec une animation donnée en paramètre\&. " .ti -1c .RI "void \fBMLV_free_animation_player\fP (\fBMLV_Animation_player\fP *animation_player)" .br .RI "Libère l'espace mémoire alloué pour un animateur donné\&. " .ti -1c .RI "void \fBMLV_play_animation_player\fP (\fBMLV_Animation_player\fP *animation_player)" .br .RI "Demare la lecture de l'animation lu par le lecteur d'animation\&. " .ti -1c .RI "void \fBMLV_play_revert_animation_player\fP (\fBMLV_Animation_player\fP *animation_player)" .br .RI "Demande à un lecteur d'animation donné de jouer l'animation à l'envers\&. " .ti -1c .RI "void \fBMLV_stop_animation_player\fP (\fBMLV_Animation_player\fP *animation_player)" .br .RI "Met en pause la lecture d'un lecteur d'animation donné\&. " .ti -1c .RI "void \fBMLV_rewind_animation_player\fP (\fBMLV_Animation_player\fP *animation_player)" .br .RI "Demande à l'animateur de reprendre la lecture de l'animation depuis le début\&. " .ti -1c .RI "void \fBMLV_next_frame\fP (\fBMLV_Animation_player\fP *animation_player)" .br .RI "Force le lecteur d'animation à passer à l'image suivante\&. " .ti -1c .RI "void \fBMLV_previous_frame\fP (\fBMLV_Animation_player\fP *animation_player)" .br .RI "Force l'animateur à revenir sur l'image précédente\&. " .ti -1c .RI "void \fBMLV_update_animation_player\fP (\fBMLV_Animation_player\fP *animation_player)" .br .RI "Met a jour un lecteur d'animation\&. " .ti -1c .RI "void \fBMLV_change_sound_volume_of_animation_player\fP (\fBMLV_Animation_player\fP *animation_player, unsigned int channel, float volume)" .br .RI "Change le volume sonore d'un bruitage\&. " .ti -1c .RI "void \fBMLV_turn_on_sound_of_animation_player\fP (\fBMLV_Animation_player\fP *animation_player, unsigned int channel)" .br .RI "Active le son du canal d'un lecteur d'animation donnée\&. " .ti -1c .RI "void \fBMLV_turn_off_sound_of_animation_player\fP (\fBMLV_Animation_player\fP *animation_player, unsigned int channel)" .br .RI "Désactive le son du canal d'une animation donnée\&. " .ti -1c .RI "void \fBMLV_draw_image_from_animation_player\fP (\fBMLV_Animation_player\fP *animation_player, unsigned int layer, int x, int y)" .br .RI "Dessine à une position donnée l'image actuellement lue par l'animateur\&. Cette image est situè à une couche donnée en paramètre\&. " .ti -1c .RI "void \fBMLV_play_sound_from_animation_player\fP (\fBMLV_Animation_player\fP *animation_player, unsigned int layer)" .br .RI "Joue le son d'une couche sonore donnée correspondant à l'image en cours de lecture dans l'animation\&. " .ti -1c .RI "void \fBMLV_play_sounds_from_animation_player\fP (\fBMLV_Animation_player\fP *animation_player,\&.\&.\&.)" .br .RI "Même chose que \fBMLV_play_sound_from_animation_player()\fP sauf que cette fonction permet de lancer plusieurs sons en même temps\&. " .ti -1c .RI "void \fBMLV_play_list_of_sounds_from_animation_player\fP (\fBMLV_Animation_player\fP *animation_player, unsigned int *layers, unsigned int nb_layers)" .br .RI "Même chose que \fBMLV_play_sound_from_animation_player()\fP sauf que cette fonction permet de lancer plusieurs sons en même temps\&. " .ti -1c .RI "void \fBMLV_draw_partial_image_from_animation_player\fP (\fBMLV_Animation_player\fP *animation_player, unsigned int layer, int source_x, int source_y, int source_width, int source_height, \fBMLV_Image\fP *image, int x, int y)" .br .RI "Dessine à l'écran à une position donnée, une portion de l'image actuellement lue par l'animateur et extraite de la couche spécifiée en paramètre\&. " .ti -1c .RI "void \fBMLV_draw_image_from_animation_player_on_image\fP (\fBMLV_Animation_player\fP *animation_player, unsigned int layer, \fBMLV_Image\fP *image, int x, int y)" .br .RI "Dessine sur une image donnée à une position donnée l'image actuellement lue par l'animateur et située à une couche donnée\&. " .ti -1c .RI "void \fBMLV_draw_partial_image_from_animation_player_on_image\fP (\fBMLV_Animation_player\fP *animation_player, unsigned int layer, int source_x, int source_y, int source_width, int source_height, \fBMLV_Image\fP *image, int x, int y)" .br .RI "Dessine sur une image donnée à une position donnée une portion de l'image actuellement lue par l'animateur et située à une couche donnée\&. " .ti -1c .RI "\fBMLV_Animation_book\fP * \fBMLV_load_animation_book\fP (const char *xml_file, const char *image_directory, const char *sound_directory)" .br .RI "Charge en memoire un livre contenant une multitude d'animations\&. " .ti -1c .RI "void \fBMLV_free_animation_book\fP (\fBMLV_Animation_book\fP *animation_book)" .br .RI "Libère la memoire contenue par le livre d'animation\&. " .ti -1c .RI "int \fBMLV_get_number_of_animations\fP (\fBMLV_Animation_book\fP *animation_book)" .br .RI "Détermine le nombre d'animations contenus par le livre d'animation\&. " .ti -1c .RI "\fBMLV_Animation\fP * \fBMLV_get_animation_from_id\fP (\fBMLV_Animation_book\fP *animation_book, int id)" .br .RI "Renvoie une animation donnée contenue dans le livre d'animation\&. " .ti -1c .RI "\fBMLV_Animation\fP * \fBMLV_get_animation_from_name\fP (\fBMLV_Animation_book\fP *animation_book, const char *name)" .br .RI "Renvoie une animation donnée contenue dans le livre d'animation\&. " .ti -1c .RI "const char * \fBMLV_get_name_from_id_animation\fP (\fBMLV_Animation_book\fP *animation_book, int id_animation)" .br .RI "Renvoie le nom d'un animation à partir de son identifiant dans le livre d'animation\&. " .ti -1c .RI "void \fBMLV_add_frame_in_animation\fP (\fBMLV_Image\fP **array_of_images, \fBMLV_Sound\fP **array_of_sounds, unsigned int delay, \fBMLV_Animation\fP *animation)" .br .RI "Ajoute un image dans la séquence d'animation\&. Cette fonction ne peux pas augmenter le nombre d'image d'une animation\&. " .in -1c .SH "Description détaillée" .PP Ce fichier définit les prototypes des fonctions permettant de mettre en oeuvre des animations\&. .PP \fBAuteur\fP .RS 4 Adrien Boussicault .PP Marc Zipstein .RE .PP Cette interface est inspiré du tutoriel : http://www.gnurou.org/writing/linuxmag/sdl/partie3 .SH "Documentation des définitions de type" .PP .SS "typedef struct _MLV_Animation \fBMLV_Animation\fP" .PP Ce type code une animation\&. Une animation est une succéssion de k+l+1 uplets\&. Chaque uplet contient : .IP "\(bu" 2 k images, .IP "\(bu" 2 l sons, .IP "\(bu" 2 1 temps d'affichage Les k images correspondent à k représentations différentes d'une même scène animée\&. Les l sons correspondent à l différents fonds sonores pour la même scène animée\&. Le temps d'affichage est le temps d'affichage des images dans l'animation\&. .PP .PP On appelle 'couche graphique i', l'ensemble des images situées à la position i du k+l+1-uplet\&. On appelle 'couche sonore j', l'ensemble des sons situées à la position k+j du k+l+1-uplet\&. .PP Voici la Structure d'une animatione représentée à l'aide d'un tableau : .PP .PP .nf |-------------------------------------------------------------| | MLV_Animation | |-------------------------------------------------------------| | | | Couche graphique 0 | Image Image Image ... | | Couche graphique 1 | Image Image Image ... | | ... | ... ... ... ... | | Couche graphique k-1 | Image Image Image ... | | ------------------------------------------------------- | | Couche sonore 0 | Son Son Son ... | | Couche sonore 1 | Son Son Son ... | | ... | ... ... ... ... | | Couche sonore k-1 | Son Son Son ... | | ------------------------------------------------------- | | Temps d'affichage | 1 3 1 ... | | | |-------------------------------------------------------------| .fi .PP .SS "typedef struct _MLV_Animation_book \fBMLV_Animation_book\fP" .PP Ce type correspond à un livre contenant de nombreuses animations\&. Un livre d'animations est un fichier XML qui code des animations\&. Le type MLV_Animation_book code le contenu d'un live d'animation\&. .SS "typedef struct _MLV_Animation_player \fBMLV_Animation_player\fP" .PP Ce type code un lecteur d'animation\&. Un lecteur d'animation est une structure qui permet d'animer une animation\&. Cette structure contient : .IP "\(bu" 2 un pointeur vers une animation .IP "\(bu" 2 la position de l'image courante de l'animation .IP "\(bu" 2 une horloge interne ( dont le temps est discret et indépendant du temps courant ) .PP .PP L'aiguille de l'horologe interne d'une animation avance d'une unité à chaque appel de la fonction \fBMLV_update_animation_player()\fP\&. Les animations sont alors jouée en fonction de l'évolution du temps de chaque animateur\&. Ainsi, deux lecteurs différents peuvent avoir une courbe du temps différente\&. .PP La bonne façon d'utiliser des lecteurs est de mettre a jour tous les lecteurs en même temps à un intervalle de temps régulier\&. Pour cela vous pouvez utiliser la fonction framerate qui endort le programme de façon a assurer l'execution d'un tour de boucle à une fréquence donnée .PP Voici un exemple d'utilisation du lecteur : .PP .nf MLV_Image* creature1 = MLV_load_image("creature1\&.png"); MLV_Image* creature2 = MLV_load_image("creature2\&.png"); int time_per_image = 1; MLV_Animation* animation; animation = MLV_create_animation( 2 ); MLV_change_frame_in_animation( creature1, time_per_image, animation, 0 ); MLV_change_frame_in_animation( creature2, time_per_image, animation, 0 ); MLV_Animation_player* animation_player; animation_player = MLV_create_animation_player( animation ); int frequence = 24; // nombre d'images par secondes MLV_change_frame_rate( frequence ); while( 1 ){ MLV_update_animation_player( animation_player ); MLV_draw_image_from_animation_player(0, 0, 0, animation_player); MLV_frame_rate_delay(); } .fi .PP .SH "Documentation des fonctions" .PP .SS "void MLV_add_frame_in_animation (\fBMLV_Image\fP ** array_of_images, \fBMLV_Sound\fP ** array_of_sounds, unsigned int delay, \fBMLV_Animation\fP * animation)" .PP Ajoute un image dans la séquence d'animation\&. Cette fonction ne peux pas augmenter le nombre d'image d'une animation\&. .PP \fBParamètres\fP .RS 4 \fIarray_of_images\fP Liste d'image à ajouter\&. Il s'agit de toutes les images assiciée à toutes les couches correspondnant de l'animation\&. .br \fIarray_of_sounds\fP Liste de sons à ajouter\&. Il s'agit de toutes les sons assiciées à tous les cannaux correspondnant de l'animation\&. .br \fIdelay\fP le temps d'afficahge d'une image\&. .br \fIanimation\fP La sequence d'animation à moifier\&. .RE .PP .PP \fBExemples\fP .in +1c \fBadvanced/09_animation\&.c\fP\&. .SS "void MLV_change_frame_delay_in_animation (unsigned int delay, \fBMLV_Animation\fP * animation, unsigned int position)" .PP Change le temps d'affichage d'une image donnée d'une animation\&. .PP \fBParamètres\fP .RS 4 \fIdelay\fP temps d'affichage de l'image .br \fIanimation\fP Animation à modifier .br \fIposition\fP position de l'image dans l'animation .RE .PP .SS "void MLV_change_frame_image_in_animation (\fBMLV_Image\fP * image, \fBMLV_Animation\fP * animation, unsigned int position, unsigned int layer)" .PP Change un animation en remplacant uniquement une image\&. L'image concerné est repéré à l'aide de son index et de de l'index de sa couche\&. .PP \fBParamètres\fP .RS 4 \fIimage\fP image a ajouter dans l'animation .br \fIanimation\fP Animation à modifier .br \fIposition\fP position de l'image dans l'animation .br \fIlayer\fP Couche de l'image\&. .RE .PP .SS "void MLV_change_frame_in_animation (\fBMLV_Image\fP ** array_of_images, \fBMLV_Sound\fP ** array_of_sounds, unsigned int delay, \fBMLV_Animation\fP * animation, unsigned int position)" .PP Change un animation en remplacant une image et son temps d'affichage associé\&. L'image concerné est repéré à l'aide de son index et de l'index de la couche où elle appartient\&. .PP \fBParamètres\fP .RS 4 \fIarray_of_images\fP Un tableau d'adresse contenant les addresses de images correspondat aux différentes couches d'une animation\&. .br \fIarray_of_sounds\fP Un tableau d'adresse contenant les addresses de sons correspondant aux différentes canaux d'une animation\&. .br \fIdelay\fP temps d'affichage de l'image .br \fIanimation\fP Animation à modifier .br \fIposition\fP position de l'image dans l'animation .RE .PP .SS "void MLV_change_frame_sound_in_animation (\fBMLV_Sound\fP * sound, \fBMLV_Animation\fP * animation, unsigned int position, unsigned int channel)" .PP Change un animation en remplacant uniquement un bruitage\&. Le son image concerné est repéré à l'aide de son index et de de l'index de son canaul\&. .PP \fBParamètres\fP .RS 4 \fIsound\fP son a ajouter dans l'animation .br \fIanimation\fP Animation à modifier .br \fIposition\fP position de l'image dans l'animation .br \fIchannel\fP Canal du son\&. .RE .PP .SS "void MLV_change_sound_volume_of_animation_player (\fBMLV_Animation_player\fP * animation_player, unsigned int channel, float volume)" .PP Change le volume sonore d'un bruitage\&. .PP \fBParamètres\fP .RS 4 \fIanimation_player\fP L'animateur dans lequel se trouve le son\&. .br \fIchannel\fP Le canal concerné\&. .br \fIvolume\fP le nouveau volume sonore\&. .RE .PP .PP \fBExemples\fP .in +1c \fBadvanced/09_animation\&.c\fP, et \fBadvanced/11_animation_book\&.c\fP\&. .SS "\fBMLV_Animation\fP* MLV_create_animation (unsigned int nb_frames, unsigned int nb_layers, unsigned int nb_channels)" .PP Créé une animation comportant un nombre d'image donné Une animationV est une succession d'image où à chaque image est associé un temps\&. Ce temps code le temps d'affichage de chaque image, lors du rendu de de l'animation\&. Pour des raisons de commodité, nos séquence d'animations sont composés de plusieurs couches\&. Elles sont donc des successions de couches contenant chacunes une image\&. .PP Une sequence d'animation (à ne pas confondre avec une animation) est une pure structure de donnée\&. Elle peut donc pas s'animer, ni s'afficher à l'ecran\&. Pour afficher une séquence d'animation, il faut utiliser une animation, qui s'aidera de la séquence d'animation pour s'afficher ou pour mettre en mouvement les images de la séquence d'animation\&. .PP Le temps d'une s'quence d'animation n'est pas codée en secondes\&. Il s'agit d'un entier\&. Lorsque vous utilisez une animation, l'animateur à un temps qui lui est propre et qui est codé à l'aide d'un entier qui croit\&. Les duree que vous ajouterez dans l'animation sont donc définit par rapport au temps de l'animation qui utilise la séquence d'animation\&. .PP \fBParamètres\fP .RS 4 \fInb_frames\fP Le nombre d'image que doit contenir l'animation .br \fInb_layers\fP Nombre de couches graphique de l'animation\&. .br \fInb_channels\fP Nombre de canaux sonore de l'animation\&. .RE .PP \fBRenvoie\fP .RS 4 Un pointeur vers une animation\&. .RE .PP .PP \fBExemples\fP .in +1c \fBadvanced/09_animation\&.c\fP\&. .SS "\fBMLV_Animation_player\fP* MLV_create_animation_player (\fBMLV_Animation\fP * animation)" .PP Cree un lecteur d'animation et l'initialise avec une animation donnée en paramètre\&. .PP \fBParamètres\fP .RS 4 \fIanimation\fP L'animation que devra animer l'animateur\&. .RE .PP \fBRenvoie\fP .RS 4 L'animateur créé\&. .RE .PP .PP \fBExemples\fP .in +1c \fBadvanced/09_animation\&.c\fP, et \fBadvanced/11_animation_book\&.c\fP\&. .SS "void MLV_draw_image_from_animation_player (\fBMLV_Animation_player\fP * animation_player, unsigned int layer, int x, int y)" .PP Dessine à une position donnée l'image actuellement lue par l'animateur\&. Cette image est situè à une couche donnée en paramètre\&. .PP \fBParamètres\fP .RS 4 \fIanimation_player\fP Le lecteur de l'animation à aficher .br \fIlayer\fP Couche de l'image\&. .br \fIx\fP Coordonnée en X de la position du sommet Nord-Ouest de l'image à afficher\&. .br \fIy\fP Coordonnée en Y de la position du sommet Nord-Ouest de l'image à afficher\&. .RE .PP .PP \fBExemples\fP .in +1c \fBadvanced/09_animation\&.c\fP, et \fBadvanced/11_animation_book\&.c\fP\&. .SS "void MLV_draw_image_from_animation_player_on_image (\fBMLV_Animation_player\fP * animation_player, unsigned int layer, \fBMLV_Image\fP * image, int x, int y)" .PP Dessine sur une image donnée à une position donnée l'image actuellement lue par l'animateur et située à une couche donnée\&. .PP \fBParamètres\fP .RS 4 \fIanimation_player\fP Le lecteur de l'animation à aficher .br \fIlayer\fP Couche de l'image\&. .br \fIimage\fP image sur laquel il faut dessiner l'animation .br \fIx\fP Coordonnée en X de la position du sommet Nord-Ouest de l'image à afficher\&. .br \fIy\fP Coordonnée en Y de la position du sommet Nord-Ouest de l'image à afficher\&. .RE .PP .SS "void MLV_draw_partial_image_from_animation_player (\fBMLV_Animation_player\fP * animation_player, unsigned int layer, int source_x, int source_y, int source_width, int source_height, \fBMLV_Image\fP * image, int x, int y)" .PP Dessine à l'écran à une position donnée, une portion de l'image actuellement lue par l'animateur et extraite de la couche spécifiée en paramètre\&. .PP \fBParamètres\fP .RS 4 \fIanimation_player\fP Le lecteur de l'animation à aficher .br \fIlayer\fP Couche de l'image\&. .br \fIimage\fP image sur laquel il faut dessiner l'animation .br \fIsource_x\fP Coordonnée en X de la position de la portion à recopier .br \fIsource_y\fP Coordonnée en Y de la position de la portion à recopier .br \fIsource_width\fP Largeur de la portion à recopier .br \fIsource_height\fP Hauteur de la portion à recopier .br \fIx\fP Coordonnée en X de la position du sommet Nord-Ouest de l'image à afficher\&. .br \fIy\fP Coordonnée en Y de la position du sommet Nord-Ouest de l'image à afficher\&. .RE .PP .SS "void MLV_draw_partial_image_from_animation_player_on_image (\fBMLV_Animation_player\fP * animation_player, unsigned int layer, int source_x, int source_y, int source_width, int source_height, \fBMLV_Image\fP * image, int x, int y)" .PP Dessine sur une image donnée à une position donnée une portion de l'image actuellement lue par l'animateur et située à une couche donnée\&. .PP \fBParamètres\fP .RS 4 \fIanimation_player\fP Le lecteru de l'animation à aficher .br \fIlayer\fP Couche de l'image\&. .br \fIimage\fP image sur laquel il faut dessiner l'animation .br \fIsource_x\fP Coordonnée en X de la position de la portion à recopier .br \fIsource_y\fP Coordonnée en Y de la position de la portion à recopier .br \fIsource_width\fP Largeur de la portion à recopier .br \fIsource_height\fP Hauteur de la portion à recopier .br \fIx\fP Coordonnée en X de la position du sommet Nord-Ouest de l'image à afficher\&. .br \fIy\fP Coordonnée en Y de la position du sommet Nord-Ouest de l'image à afficher\&. .RE .PP .SS "void MLV_free_animation (\fBMLV_Animation\fP * animation)" .PP Cette fonction libère les données allouées pour l'animation\&. .PP \fBParamètres\fP .RS 4 \fIanimation\fP L'animation à fermer\&. .RE .PP .PP \fBExemples\fP .in +1c \fBadvanced/09_animation\&.c\fP\&. .SS "void MLV_free_animation_book (\fBMLV_Animation_book\fP * animation_book)" .PP Libère la memoire contenue par le livre d'animation\&. .PP \fBParamètres\fP .RS 4 \fIanimation_book\fP Le livre d'animation\&. .RE .PP .PP \fBExemples\fP .in +1c \fBadvanced/11_animation_book\&.c\fP\&. .SS "void MLV_free_animation_player (\fBMLV_Animation_player\fP * animation_player)" .PP Libère l'espace mémoire alloué pour un animateur donné\&. .PP \fBParamètres\fP .RS 4 \fIanimation_player\fP Le lecteur d'animation à suprimer .RE .PP .PP \fBExemples\fP .in +1c \fBadvanced/09_animation\&.c\fP, et \fBadvanced/11_animation_book\&.c\fP\&. .SS "\fBMLV_Animation\fP* MLV_get_animation_from_id (\fBMLV_Animation_book\fP * animation_book, int id)" .PP Renvoie une animation donnée contenue dans le livre d'animation\&. .PP \fBParamètres\fP .RS 4 \fIanimation_book\fP Le livre d'animation\&. .br \fIid\fP L'identifiant .RE .PP \fBRenvoie\fP .RS 4 La séquence d'animation\&. .RE .PP .SS "\fBMLV_Animation\fP* MLV_get_animation_from_name (\fBMLV_Animation_book\fP * animation_book, const char * name)" .PP Renvoie une animation donnée contenue dans le livre d'animation\&. .PP \fBParamètres\fP .RS 4 \fIanimation_book\fP Le livre d'animation\&. .br \fIname\fP Le nom de l'animation .RE .PP \fBRenvoie\fP .RS 4 La séquence d'animation\&. .RE .PP .PP \fBExemples\fP .in +1c \fBadvanced/11_animation_book\&.c\fP\&. .SS "int MLV_get_frame_delay_from_animation (\fBMLV_Animation\fP * animation, unsigned int position)" .PP Renvoie le temps d'affichage de l'image présente à une position donnée d'une animation donnée\&. .PP \fBParamètres\fP .RS 4 \fIanimation\fP Animation à modifier .br \fIposition\fP position de l'image dans l'animation .RE .PP \fBRenvoie\fP .RS 4 le temps d'affichage de l'image .RE .PP .SS "void MLV_get_frame_from_animation (\fBMLV_Animation\fP * animation, unsigned int position, unsigned int layer, \fBMLV_Image\fP ** image, unsigned int * delay)" .PP Recupère l'image et le temps présents à une position et une couche donnée d'une animation\&. .PP \fBParamètres\fP .RS 4 \fIanimation\fP Animation à modifier .br \fIlayer\fP Couche de l'image\&. .br \fIposition\fP position de l'image dans l'animation .br \fIimage\fP image a ajouter dans l'animation .br \fIdelay\fP temps d'affichage de l'image .RE .PP .SS "\fBMLV_Image\fP* MLV_get_frame_image_from_animation (\fBMLV_Animation\fP * animation, unsigned int position, unsigned int layer)" .PP Renvoie l'image présente à une position et une couche donnée d'une animation donnée\&. .PP \fBParamètres\fP .RS 4 \fIanimation\fP Animation à modifier .br \fIposition\fP position de l'image dans l'animation .br \fIlayer\fP Couche de l'image\&. .RE .PP \fBRenvoie\fP .RS 4 l'image extraite\&. .RE .PP .SS "const char* MLV_get_name_from_id_animation (\fBMLV_Animation_book\fP * animation_book, int id_animation)" .PP Renvoie le nom d'un animation à partir de son identifiant dans le livre d'animation\&. .PP \fBParamètres\fP .RS 4 \fIanimation_book\fP Le livre d'animation\&. .br \fIid_animation\fP L'identifiant de l'animation dans le livre\&. .RE .PP \fBRenvoie\fP .RS 4 Le nom de l'animation\&. .RE .PP .SS "int MLV_get_number_of_animations (\fBMLV_Animation_book\fP * animation_book)" .PP Détermine le nombre d'animations contenus par le livre d'animation\&. .PP \fBParamètres\fP .RS 4 \fIanimation_book\fP Le livre d'animation\&. .RE .PP \fBRenvoie\fP .RS 4 le nombre d'animations contenus par le livre d'animation\&. .RE .PP .SS "\fBMLV_Animation_book\fP* MLV_load_animation_book (const char * xml_file, const char * image_directory, const char * sound_directory)" .PP Charge en memoire un livre contenant une multitude d'animations\&. .PP \fBParamètres\fP .RS 4 \fIxml_file\fP Fichiers xml\&. .br \fIimage_directory\fP Le dossier ou se trouve toutes les images du livre d'animation\&. Si NULL est passe en parametre, alors le programme cherche dans le repertoire du fichier de configuration du livre d'animation\&. .br \fIsound_directory\fP Le dossier ou se trouve toutes les échantillons sonore du livre d'animation\&. Si NULL est passe en parametre, alors le programme cherche dans le repertoire du fichier de configuration du livre d'animation\&. .RE .PP \fBRenvoie\fP .RS 4 L'adresse de la sructure de données contenant toutes les animations\&. .RE .PP .PP \fBExemples\fP .in +1c \fBadvanced/11_animation_book\&.c\fP\&. .SS "void MLV_next_frame (\fBMLV_Animation_player\fP * animation_player)" .PP Force le lecteur d'animation à passer à l'image suivante\&. .PP \fBParamètres\fP .RS 4 \fIanimation_player\fP Le lecteur d'animation .RE .PP .SS "void MLV_play_animation_player (\fBMLV_Animation_player\fP * animation_player)" .PP Demare la lecture de l'animation lu par le lecteur d'animation\&. .PP \fBParamètres\fP .RS 4 \fIanimation_player\fP Le lecteur d'animation .RE .PP .PP \fBExemples\fP .in +1c \fBadvanced/09_animation\&.c\fP, et \fBadvanced/11_animation_book\&.c\fP\&. .SS "void MLV_play_list_of_sounds_from_animation_player (\fBMLV_Animation_player\fP * animation_player, unsigned int * layers, unsigned int nb_layers)" .PP Même chose que \fBMLV_play_sound_from_animation_player()\fP sauf que cette fonction permet de lancer plusieurs sons en même temps\&. .PP \fBParamètres\fP .RS 4 \fIanimation_player\fP Le lecteur de l'animation à aficher\&. .br \fIlayers\fP Tableau contenant les couches du son à jouer\&. .br \fInb_layers\fP Nombre de couches dans le tableau\&. \\ .RE .PP .SS "void MLV_play_revert_animation_player (\fBMLV_Animation_player\fP * animation_player)" .PP Demande à un lecteur d'animation donné de jouer l'animation à l'envers\&. .PP \fBParamètres\fP .RS 4 \fIanimation_player\fP Le lecteur d'animation .RE .PP .PP \fBExemples\fP .in +1c \fBadvanced/09_animation\&.c\fP\&. .SS "void MLV_play_sound_from_animation_player (\fBMLV_Animation_player\fP * animation_player, unsigned int layer)" .PP Joue le son d'une couche sonore donnée correspondant à l'image en cours de lecture dans l'animation\&. Si le son a déjà été joué, cette fonction ne fait rien\&. .PP \fBParamètres\fP .RS 4 \fIanimation_player\fP Le lecteur de l'animation à aficher\&. .br \fIlayer\fP Couche du son\&. .RE .PP .PP \fBExemples\fP .in +1c \fBadvanced/09_animation\&.c\fP, et \fBadvanced/11_animation_book\&.c\fP\&. .SS "void MLV_play_sounds_from_animation_player (\fBMLV_Animation_player\fP * animation_player, \&.\&.\&.)" .PP Même chose que \fBMLV_play_sound_from_animation_player()\fP sauf que cette fonction permet de lancer plusieurs sons en même temps\&. La liste des couches sonores à jouer doivent être passé en paramètre (un paramètre par couche), et le dernier paramètre doit valoir -1 pour dire à la fonction quand il doit s'arrêter\&. .PP Par exemple, pour jouer les couches 2, 3 et 5 d'une animation, il suffit d'écrire: .PP .PP .nf MLV_play_sounds_from_animation_player( animation, 2, 3, 5, -1 ); .fi .PP .PP \fBParamètres\fP .RS 4 \fIanimation_player\fP Le lecteur de l'animation à aficher\&. .br \fI\&.\&.\&.\fP la liste des couches sonores, dont la veleure finale doit toujours être -1\&. .RE .PP .SS "void MLV_previous_frame (\fBMLV_Animation_player\fP * animation_player)" .PP Force l'animateur à revenir sur l'image précédente\&. .PP \fBParamètres\fP .RS 4 \fIanimation_player\fP Le lecteur d'animation .RE .PP .SS "void MLV_rewind_animation_player (\fBMLV_Animation_player\fP * animation_player)" .PP Demande à l'animateur de reprendre la lecture de l'animation depuis le début\&. .PP \fBParamètres\fP .RS 4 \fIanimation_player\fP Le lecteur d'animation .RE .PP .SS "void MLV_stop_animation_player (\fBMLV_Animation_player\fP * animation_player)" .PP Met en pause la lecture d'un lecteur d'animation donné\&. .PP \fBParamètres\fP .RS 4 \fIanimation_player\fP Le lecteur d'animation .RE .PP .SS "void MLV_turn_off_sound_of_animation_player (\fBMLV_Animation_player\fP * animation_player, unsigned int channel)" .PP Désactive le son du canal d'une animation donnée\&. .PP \fBParamètres\fP .RS 4 \fIanimation_player\fP L'animateur concerné\&. .br \fIchannel\fP Le canal concerné\&. .RE .PP .PP \fBExemples\fP .in +1c \fBadvanced/11_animation_book\&.c\fP\&. .SS "void MLV_turn_on_sound_of_animation_player (\fBMLV_Animation_player\fP * animation_player, unsigned int channel)" .PP Active le son du canal d'un lecteur d'animation donnée\&. .PP \fBParamètres\fP .RS 4 \fIanimation_player\fP L'animateur concerné\&. .br \fIchannel\fP Le canal concerné\&. .RE .PP .PP \fBExemples\fP .in +1c \fBadvanced/09_animation\&.c\fP, et \fBadvanced/11_animation_book\&.c\fP\&. .SS "void MLV_update_animation_player (\fBMLV_Animation_player\fP * animation_player)" .PP Met a jour un lecteur d'animation\&. L'horloge interne du lecteur voit son temps incrémenter de 1 unité exactement\&. .PP La position de lecture de l'animation est mis a jour en conséquence de la mis à jour de l'horloge interne\&. .PP \fBParamètres\fP .RS 4 \fIanimation_player\fP Le lecteur d'animation à mettre à jour .RE .PP .PP \fBExemples\fP .in +1c \fBadvanced/09_animation\&.c\fP, et \fBadvanced/11_animation_book\&.c\fP\&. .SH "Auteur" .PP Généré automatiquement par Doxygen pour MLV-3\&.1\&.0 à partir du code source\&.