- Added a NODELAY state flag. This is only valid for a state immediately following a Spawn label.
When set, the actor will run this state during its first tick. This means Spawn states may now run an action function if you set this flag. Note that this action function is executed during the actor's first tick, which is not the same as when it is spawned. SVN r4240 (trunk)
This commit is contained in:
parent
cc5110575f
commit
0e19a0e330
6 changed files with 65 additions and 21 deletions
|
|
@ -334,8 +334,8 @@ FStateDefine *FStateDefinitions::FindStateLabelInList(TArray<FStateDefine> & lis
|
|||
if (create)
|
||||
{
|
||||
FStateDefine def;
|
||||
def.Label=name;
|
||||
def.State=NULL;
|
||||
def.Label = name;
|
||||
def.State = NULL;
|
||||
def.DefineFlags = SDF_NEXT;
|
||||
return &list[list.Push(def)];
|
||||
}
|
||||
|
|
@ -351,12 +351,11 @@ FStateDefine *FStateDefinitions::FindStateLabelInList(TArray<FStateDefine> & lis
|
|||
|
||||
FStateDefine * FStateDefinitions::FindStateAddress(const char *name)
|
||||
{
|
||||
FStateDefine * statedef=NULL;
|
||||
|
||||
FStateDefine *statedef = NULL;
|
||||
TArray<FName> &namelist = MakeStateNameList(name);
|
||||
TArray<FStateDefine> *statelist = &StateLabels;
|
||||
|
||||
TArray<FStateDefine> * statelist = &StateLabels;
|
||||
for(unsigned i=0;i<namelist.Size();i++)
|
||||
for(unsigned i = 0; i < namelist.Size(); i++)
|
||||
{
|
||||
statedef = FindStateLabelInList(*statelist, namelist[i], true);
|
||||
statelist = &statedef->Children;
|
||||
|
|
@ -379,7 +378,7 @@ void FStateDefinitions::SetStateLabel (const char *statename, FState *state, BYT
|
|||
|
||||
//==========================================================================
|
||||
//
|
||||
// Adds a new state to the curremt list
|
||||
// Adds a new state to the current list
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
|
|
@ -393,6 +392,24 @@ void FStateDefinitions::AddStateLabel (const char *statename)
|
|||
lastlabel = index;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Returns the index a state label points to. May only be called before
|
||||
// installing states.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
int FStateDefinitions::GetStateLabelIndex (FName statename)
|
||||
{
|
||||
FStateDefine *std = FindStateLabelInList(StateLabels, statename, false);
|
||||
if (std == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
assert((size_t)std->State <= StateArray.Size() + 1);
|
||||
return (int)((ptrdiff_t)std->State - 1);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Finds the state associated with the given name
|
||||
|
|
@ -863,6 +880,9 @@ bool FStateDefinitions::AddStates(FState *state, const char *framechars)
|
|||
state->Frame = frame;
|
||||
state->SameFrame = noframe;
|
||||
StateArray.Push(*state);
|
||||
|
||||
// NODELAY flag is not carried past the first state
|
||||
state->NoDelay = false;
|
||||
}
|
||||
laststate = &StateArray[StateArray.Size() - 1];
|
||||
laststatebeforelabel = laststate;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue