$treeview $search $mathjax
Stratagus  2.2.7
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

src/animation/animation.cpp File Reference

#include "stratagus.h"
#include "action/action_spellcast.h"
#include "animation.h"
#include "animation/animation_attack.h"
#include "animation/animation_die.h"
#include "animation/animation_exactframe.h"
#include "animation/animation_frame.h"
#include "animation/animation_goto.h"
#include "animation/animation_ifvar.h"
#include "animation/animation_label.h"
#include "animation/animation_move.h"
#include "animation/animation_randomgoto.h"
#include "animation/animation_randomrotate.h"
#include "animation/animation_randomsound.h"
#include "animation/animation_randomwait.h"
#include "animation/animation_rotate.h"
#include "animation/animation_setplayervar.h"
#include "animation/animation_setvar.h"
#include "animation/animation_sound.h"
#include "animation/animation_spawnmissile.h"
#include "animation/animation_spawnunit.h"
#include "animation/animation_unbreakable.h"
#include "animation/animation_wait.h"
#include "actions.h"
#include "iolib.h"
#include "player.h"
#include "script.h"
#include "spells.h"
#include "unit.h"
#include "unittype.h"

Classes

struct  LabelsStruct
struct  LabelsLaterStruct

actions.cpp - The actions.

#define ANIMATIONS_MAXANIM   1024
static std::vector< LabelsStructLabels
static std::vector
< LabelsLaterStruct
LabelsLater
CAnimationAnimationsArray [ANIMATIONS_MAXANIM]
int NumAnimations
std::map< std::string,
CAnimations * > 
AnimationMap
int UnitShowAnimation (CUnit &unit, const CAnimation *anim)
 Animation map.
static int ParseAnimPlayer (const CUnit &unit, const char *parseint)
int ParseAnimInt (const CUnit *unit, const char *parseint)
int UnitShowAnimationScaled (CUnit &unit, const CAnimation *anim, int scale)
 Handle the animation of a unit.
CAnimationsAnimationsByIdent (const std::string &ident)
 Get the animations structure by ident.
void FreeAnimations ()
static int GetAdvanceIndex (const CAnimation *base, const CAnimation *anim)
static const CAnimationAdvance (const CAnimation *anim, int n)
static void AddLabel (lua_State *, CAnimation *anim, const std::string &name)
static CAnimationFindLabel (lua_State *l, const std::string &name)
void FindLabelLater (CAnimation **anim, const std::string &name)
static void FixLabels (lua_State *l)
static CAnimationParseAnimationFrame (lua_State *l, const char *str)
static CAnimationParseAnimation (lua_State *l, int idx)
static void AddAnimationToArray (CAnimation *anim)
static int CclDefineAnimations (lua_State *l)
void AnimationCclRegister ()

Define Documentation

#define ANIMATIONS_MAXANIM   1024


Function Documentation

static void AddAnimationToArray ( CAnimation anim  )  [static]

Add animation to AnimationsArray

static void AddLabel ( lua_State *  ,
CAnimation anim,
const std::string &  name 
) [static]

Add a label

static const CAnimation* Advance ( const CAnimation anim,
int  n 
) [static]

void AnimationCclRegister (  ) 

CAnimations* AnimationsByIdent ( const std::string &  ident  ) 

Get the animations structure by ident.

Get the animations structure by ident.

Parameters:
ident Identifier for the animation.
Returns:
Pointer to the animation structure.

static int CclDefineAnimations ( lua_State *  l  )  [static]

Define a unit-type animation set.

Parameters:
l Lua state.

static CAnimation* FindLabel ( lua_State *  l,
const std::string &  name 
) [static]

Find a label

void FindLabelLater ( CAnimation **  anim,
const std::string &  name 
)

Find a label later

static void FixLabels ( lua_State *  l  )  [static]

Fix labels

void FreeAnimations (  ) 

static int GetAdvanceIndex ( const CAnimation base,
const CAnimation anim 
) [static]

static CAnimation* ParseAnimation ( lua_State *  l,
int  idx 
) [static]

Parse an animation

static CAnimation* ParseAnimationFrame ( lua_State *  l,
const char *  str 
) [static]

Parse an animation frame

Parameters:
str string formated as "animationType extraArgs"

int ParseAnimInt ( const CUnit unit,
const char *  parseint 
)

Parse integer in animation frame.

Parameters:
unit Unit of the animation.
parseint Integer to parse.
Returns:
The parsed value.

static int ParseAnimPlayer ( const CUnit unit,
const char *  parseint 
) [static]

Parse player number in animation frame

Parameters:
unit Unit of the animation.
parseint Integer to parse.
Returns:
The parsed value.

int UnitShowAnimation ( CUnit unit,
const CAnimation anim 
)

Animation map.

Handle the animation of a unit.

Show unit animation.

Parameters:
unit Unit of the animation.
anim Animation script to handle.
Returns:
The flags of the current script step.

int UnitShowAnimationScaled ( CUnit unit,
const CAnimation anim,
int  scale 
)

Handle the animation of a unit.

Show unit animation.

Parameters:
unit Unit of the animation.
anim Animation script to handle.
scale Scaling factor of the wait times in animation (8 means no scaling).
Returns:
The flags of the current script step.


Variable Documentation

std::map<std::string, CAnimations *> AnimationMap

CAnimation* AnimationsArray[ANIMATIONS_MAXANIM]

std::vector<LabelsStruct> Labels [static]

std::vector<LabelsLaterStruct> LabelsLater [static]

(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.