Crossfire Server, Trunk  R22010
anim.c File Reference
#include "global.h"
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "assets.h"
+ Include dependency graph for anim.c:

Go to the source code of this file.

Functions

void animate_object (object *op, int dir)
 
void apply_anim_suffix (object *who, const char *suffix)
 
static void do_anim (const Animations *anim)
 
void dump_animations (void)
 

Detailed Description

This file contains animation-related code.

Definition in file anim.c.

Function Documentation

◆ animate_object()

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, ...). This function correctly handles FLAG_IS_TURNABLE too.

Parameters
opis the object to animate.
diris 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. This parameter is ignored if the object has a head or is turnable.

Definition at line 43 of file anim.c.

References animate_object(), blank_face, CLEAR_FLAG, FLAG_ALIVE, FLAG_IS_TURNABLE, llevError, LOG(), NUM_ANIMATIONS, NUM_FACINGS, object_dump(), object_update(), QUERY_FLAG, SET_ANIMATION, SET_FLAG, stringbuffer_finish(), and stringbuffer_new().

Referenced by animate_object(), apply_anim_suffix(), apply_changes_to_player(), dragon_ability_gain(), face_player(), fix_stopped_arrow(), monster_move(), monster_use_scroll(), move_hole(), move_player(), move_to(), object_give_identified_properties(), object_update_turn_face(), process_events(), process_object(), turn_one_transport(), and turn_transport().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_anim_suffix()

void apply_anim_suffix ( object *  who,
const char *  suffix 
)

Applies a compound animation to an object.

Parameters
whoobject to apply the animation to. Must not be NULL.
suffixanimation suffix to apply. Must not be NULL.

Definition at line 149 of file anim.c.

References animate_object(), buf, animations_struct::facings, MAX_BUF, animations_struct::num_animations, snprintf, and try_find_animation().

Referenced by apply_by_living(), attack_ob_simple(), cast_spell(), do_skill(), fire_bow(), and god_intervention().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_anim()

static void do_anim ( const Animations anim)
static

Definition at line 176 of file anim.c.

References animations_struct::name, animations_struct::num, and animations_struct::num_animations.

Referenced by dump_animations().

+ Here is the caller graph for this function:

◆ dump_animations()

void dump_animations ( void  )

Dump all animations to stderr, for debugging purposes.

Definition at line 183 of file anim.c.

References animations_for_each(), and do_anim().

Referenced by server_dump_animations().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: