… | |
… | |
22 | /* GNU General Public License for more details. */ |
22 | /* GNU General Public License for more details. */ |
23 | /* */ |
23 | /* */ |
24 | /* You should have received a copy of the GNU General Public License */ |
24 | /* You should have received a copy of the GNU General Public License */ |
25 | /* along with this program; if not, write to the Free Software */ |
25 | /* along with this program; if not, write to the Free Software */ |
26 | /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ |
26 | /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ |
27 | /* */ /*****************************************************************************/ |
27 | /* */ |
|
|
28 | /*****************************************************************************/ |
28 | |
29 | |
29 | /* First let's include the header file needed */ |
30 | /* First let's include the header file needed */ |
30 | |
31 | |
31 | #include <cfanim.h> |
32 | #include <cfanim.h> |
32 | #include <stdarg.h> |
33 | #include <stdarg.h> |
… | |
… | |
436 | { |
437 | { |
437 | qsort (animationbox,animationcount,sizeof (CFanimationHook),compareAnims); |
438 | qsort (animationbox,animationcount,sizeof (CFanimationHook),compareAnims); |
438 | ordered_commands=1; |
439 | ordered_commands=1; |
439 | } |
440 | } |
440 | |
441 | |
441 | CFanimationHook* get_command (char* command) |
442 | static CFanimationHook *get_command(char *command) |
442 | { |
443 | { |
443 | CFanimationHook dummy; |
444 | CFanimationHook dummy; |
444 | dummy.name=command; |
445 | dummy.name=command; |
445 | if (!ordered_commands) |
446 | if (!ordered_commands) |
446 | prepare_commands(); |
447 | prepare_commands(); |
447 | return (CFanimationHook*) |
448 | return (CFanimationHook*) |
448 | bsearch (&dummy,animationbox,animationcount, |
449 | bsearch (&dummy,animationbox,animationcount, |
449 | sizeof(CFanimationHook), compareAnims); |
450 | sizeof(CFanimationHook), compareAnims); |
450 | } |
451 | } |
451 | |
452 | |
452 | CFmovement* parse_animation_block (char* buffer, size_t buffer_size,FILE* fichier, CFanimation* parent) |
453 | static CFmovement *parse_animation_block(char *buffer, size_t buffer_size, FILE *fichier, CFanimation *parent) |
453 | { |
454 | { |
454 | CFmovement* first=NULL; |
455 | CFmovement* first=NULL; |
455 | CFmovement* current=NULL; |
456 | CFmovement* current=NULL; |
456 | CFmovement* next; |
457 | CFmovement* next; |
457 | char* time; |
458 | char* time; |
… | |
… | |
589 | } |
590 | } |
590 | |
591 | |
591 | /* |
592 | /* |
592 | * return a new animation pointer inserted in the list of animations |
593 | * return a new animation pointer inserted in the list of animations |
593 | */ |
594 | */ |
594 | CFanimation* create_animation(void) |
595 | static CFanimation *create_animation(void) |
595 | { |
596 | { |
596 | CFanimation* new; |
597 | CFanimation* new; |
597 | CFanimation* current; |
598 | CFanimation* current; |
598 | new=(CFanimation*) malloc (sizeof (CFanimation)); |
599 | new=(CFanimation*) malloc (sizeof (CFanimation)); |
599 | if (!new) return NULL; |
600 | if (!new) return NULL; |
… | |
… | |
830 | if (current_anim->nextmovement) break; |
831 | if (current_anim->nextmovement) break; |
831 | } |
832 | } |
832 | fclose (fichier); |
833 | fclose (fichier); |
833 | return 1; |
834 | return 1; |
834 | } |
835 | } |
835 | void animate_one(CFanimation* animation, long int milliseconds) |
836 | static void animate_one(CFanimation *animation, long int milliseconds) |
836 | { |
837 | { |
837 | CFmovement* current; |
838 | CFmovement* current; |
838 | |
839 | |
839 | if (animation->time_representation==time_second) |
840 | if (animation->time_representation==time_second) |
840 | animation->tick_left+=milliseconds; |
841 | animation->tick_left+=milliseconds; |