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

Go to the source code of this file.


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

Detailed Description

This file contains animation-related code.

Definition in file anim.cpp.

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.

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 44 of file anim.cpp.

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

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_aura(), 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.

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

Definition at line 150 of file anim.cpp.

References animate::anim, animate_object(), object::animation, buf, object::facing, HEAD, object::last_anim, MAX_BUF, object::more, Animations::name, object::state, castle_read::suffix, object::temp_anim_speed, object::temp_animation, try_find_animation(), and autojail::who.

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:

◆ dump_animations()

void dump_animations ( void  )

Dump all animations to stderr, for debugging purposes.

Definition at line 180 of file anim.cpp.

References animate::anim, AssetsManager::animations(), AssetsCollection< T, Key >::each(), and getManager().

Referenced by server_dump_animations().

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