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

Classes
animation.cpp File Reference
#include "stratagus.h"
#include "action/action_spellcast.h"
#include "action/action_build.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_luacallback.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 "animation/animation_wiggle.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   4096
 
static std::vector< LabelsStruct > Labels
 
static std::vector< LabelsLaterStruct > LabelsLater
 
CAnimation * AnimationsArray [ANIMATIONS_MAXANIM]
 
int NumAnimations
 
std::map< std::string, CAnimations * > AnimationMap
 
int UnitShowAnimation (CUnit &unit, const CAnimation *anim)
 Animation map. More...
 
static int ParseAnimPlayer (const CUnit &unit, char *parseint)
 
int ParseAnimInt (const CUnit &unit, const char *parseint)
 
int ParseAnimFlags (const CUnit &unit, const char *parseflag)
 
int UnitShowAnimationScaled (CUnit &unit, const CAnimation *anim, int scale)
 Handle the animation of a unit. More...
 
CAnimations * AnimationsByIdent (const std::string &ident)
 Get the animations structure by ident. More...
 
void FreeAnimations ()
 
static int GetAdvanceIndex (const CAnimation *base, const CAnimation *anim)
 
static const CAnimation * Advance (const CAnimation *anim, int n)
 
static void AddLabel (CAnimation *anim, const std::string &name)
 
static CAnimation * FindLabel (lua_State *l, const std::string &name)
 
void FindLabelLater (CAnimation **anim, const std::string &name)
 
static void FixLabels (lua_State *l)
 
static CAnimation * ParseAnimationFrame (lua_State *l, const char *str)
 
static CAnimation * ParseAnimation (lua_State *l, int idx)
 
static void AddAnimationToArray (CAnimation *anim)
 
static int CclDefineAnimations (lua_State *l)
 
void AnimationCclRegister ()
 

Macro Definition Documentation

◆ ANIMATIONS_MAXANIM

#define ANIMATIONS_MAXANIM   4096

Function Documentation

◆ AddAnimationToArray()

static void AddAnimationToArray ( CAnimation *  anim)
static

Add animation to AnimationsArray

◆ AddLabel()

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

Add a label

◆ Advance()

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

◆ AnimationCclRegister()

void AnimationCclRegister ( )

◆ AnimationsByIdent()

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

Get the animations structure by ident.

Get the animations structure by ident.

Parameters
identIdentifier for the animation.
Returns
Pointer to the animation structure.

◆ CclDefineAnimations()

static int CclDefineAnimations ( lua_State *  l)
static

Define a unit-type animation set.

Parameters
lLua state.

◆ FindLabel()

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

Find a label

◆ FindLabelLater()

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

Find a label later

◆ FixLabels()

static void FixLabels ( lua_State *  l)
static

Fix labels

◆ FreeAnimations()

void FreeAnimations ( )

◆ GetAdvanceIndex()

static int GetAdvanceIndex ( const CAnimation *  base,
const CAnimation *  anim 
)
static

◆ ParseAnimation()

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

Parse an animation

◆ ParseAnimationFrame()

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

Parse an animation frame

Parameters
strstring formated as "animationType extraArgs"

◆ ParseAnimFlags()

int ParseAnimFlags ( const CUnit &  unit,
const char *  parseflag 
)

Parse flags list in animation frame.

Parameters
unitUnit of the animation.
parseflagFlag list to parse.
Returns
The parsed value.

◆ ParseAnimInt()

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

Parse integer in animation frame.

Parameters
unitUnit of the animation.
parseintInteger to parse.
Returns
The parsed value.

◆ ParseAnimPlayer()

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

Parse player number in animation frame

Parameters
unitUnit of the animation.
parseintInteger to parse.
Returns
The parsed value.

◆ UnitShowAnimation()

int UnitShowAnimation ( CUnit &  unit,
const CAnimation *  anim 
)

Animation map.

Handle the animation of a unit.

Show unit animation.

Parameters
unitUnit of the animation.
animAnimation script to handle.
Returns
The flags of the current script step.

◆ UnitShowAnimationScaled()

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

Handle the animation of a unit.

Show unit animation.

Parameters
unitUnit of the animation.
animAnimation script to handle.
scaleScaling factor of the wait times in animation (8 means no scaling).
Returns
The flags of the current script step.

Variable Documentation

◆ AnimationMap

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

◆ AnimationsArray

CAnimation* AnimationsArray[ANIMATIONS_MAXANIM]

◆ Labels

std::vector<LabelsStruct> Labels
static

◆ LabelsLater

std::vector<LabelsLaterStruct> LabelsLater
static

◆ NumAnimations

int NumAnimations
(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.