Atrinik Server 2.5
Functions
server/anim.c File Reference
#include <global.h>

Go to the source code of this file.

Functions

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

Detailed Description

This file contains animation related code.

Definition in file anim.c.


Function Documentation

static int anim_compare ( Animations a,
Animations 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 172 of file anim.c.

void animate_object ( object op,
int  count 
)

Updates the face variable of an object. If the object is the head of a multi object, all objects are animated.

Parameters:
opObject to animate
countState count of the animation

Definition at line 204 of file anim.c.

int find_animation ( 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 182 of file anim.c.

void free_all_anim ( )

Free all animations loaded

Definition at line 34 of file anim.c.

void init_anim ( )

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

Definition at line 50 of file anim.c.