- Merged SetState and SetStateNF into a single function.

- Added new sprite #### and frame character # to specify the behavior of sprite ---- on a
  per-sprite and per-frame basis respectively.

SVN r2291 (trunk)
This commit is contained in:
Randy Heit 2010-04-19 02:46:50 +00:00
commit 178587fff2
15 changed files with 85 additions and 160 deletions

View file

@ -824,23 +824,28 @@ bool FStateDefinitions::SetLoop()
bool FStateDefinitions::AddStates(FState *state, const char *framechars)
{
bool error = false;
int frame = 0;
while (*framechars)
{
int frame;
if (*framechars == '^')
frame = '\\'-'A';
bool noframe = false;
if (*framechars == '#')
noframe = true;
else if (*framechars == '^')
frame = '\\' - 'A';
else
frame = ((*framechars)&223)-'A';
frame = (*framechars & 223) - 'A';
framechars++;
if (frame<0 || frame>28)
if (frame < 0 || frame > 28)
{
frame = 0;
error = true;
}
state->Frame=(state->Frame&(SF_FULLBRIGHT))|frame;
state->Frame = frame;
state->SameFrame = noframe;
StateArray.Push(*state);
}
laststate = &StateArray[StateArray.Size() - 1];