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

Go to the source code of this file.

Functions

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)
 

Variables

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 
)
static

Compare two animations.

Used for bsearch in find_animation().

Parameters
aFirst animation to compare
bSecond animation to compare
Returns
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.

Parameters
opObject.

Definition at line 197 of file anim.c.

void animate_turning ( object op)

Animates one step of object.

Parameters
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.

Parameters
nameAnimation name to find
Returns
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.