Atrinik Server  4.0
Functions | Variables
anim.c File Reference
#include <global.h>
#include <object.h>

Go to the source code of this file.


void free_all_anim (void)
void init_anim (void)
static int anim_compare (const void *a, const void *b)
int find_animation (const char *name)
void animate_object (object *op)
void animate_turning (object *op)


Animationsanimations = NULL
int num_animations = 0
int animations_allocated

Detailed Description

This file contains animation related code.

Definition in file anim.c.

Function Documentation

static int anim_compare ( const void *  a,
const void *  b 

Compare two animations.

Used for bsearch in find_animation().

aFirst animation to compare
bSecond animation to compare
Return value of strcmp for the animation names

Definition at line 163 of file anim.c.

void animate_object ( object op)

Update the object's animation state.


Definition at line 197 of file anim.c.

void animate_turning ( object op)

Animates one step of object.

opObject to animate.

Definition at line 216 of file anim.c.

int find_animation ( const char *  name)

Tries to find the animation ID that matches name.

nameAnimation name to find
ID of the animation if found, 0 otherwise (animation 0 is initialized as the 'bug' face).

Definition at line 176 of file anim.c.

void free_all_anim ( void  )

Free all animations loaded

Definition at line 39 of file anim.c.

void init_anim ( void  )

Initialize animations structure, read the animations data from a file.

Definition at line 57 of file anim.c.