/home/leaf/crossfire/server/branches/1.12/common/anim.c File Reference

#include <global.h>
#include <stdio.h>
#include <assert.h>

Include dependency graph for anim.c:

Go to the source code of this file.

Functions

void free_all_anim (void)
void init_anim (void)
int find_animation (const char *name)
int try_find_animation (const char *name)
void animate_object (object *op, int dir)
void apply_anim_suffix (object *who, sstring suffix)


Detailed Description

This file contains animation-related code.

Definition in file anim.c.


Function Documentation

void animate_object ( object op,
int  dir 
)

Updates the face-variable of an object. If the object is the head of a multi-object, all objects are animated. The object's state is not changed, but merely updated if needed (out of bounds of new animation, reached end of animation, ...)

Parameters:
op is the object to animate.
dir is the direction the object is facing. This is generally same as op->direction, but in some cases, op->facing is used instead - the caller has a better idea which one it really wants to be using, so let it pass along the right one.

Definition at line 186 of file anim.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void apply_anim_suffix ( object who,
sstring  suffix 
)

Applies a compound animation to an object.

Parameters:
who object to apply the animation to. Must not be NULL.
suffix animation suffix to apply. Must not be NULL.

Definition at line 289 of file anim.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int find_animation ( const char *  name  ) 

Finds the animation id that matches name. Will LOG() an error if not found.

Parameters:
name the animation's name.
Returns:
animation number, or 0 if no match found (animation 0 is initialized as the 'bug' face).
See also:
try_find_animation

Definition at line 146 of file anim.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void free_all_anim ( void   ) 

Clears all animation-related memory.

Definition at line 41 of file anim.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void init_anim ( void   ) 

Loads the lib/animations file. Can be called multiple times without ill effects.

Definition at line 55 of file anim.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int try_find_animation ( const char *  name  ) 

Tries to find the animation id that matches name, don't LOG() an error if not found.

Parameters:
name the animation's name.
Returns:
animation number, or 0 if no match found (animation 0 is initialized as the 'bug' face).
See also:
find_animation

Definition at line 161 of file anim.c.

Here is the caller graph for this function:


Generated on Thu Mar 25 23:01:55 2010 for Crossfire Server, Branch 1.12 by  doxygen 1.5.8