- added compile time checks for bad state links and state label references.

- preserve a state's source line information for the postprocessing phase so that the checker can output more useful information.
- added missing check for weapon psprites to DPSprite::SetState.
This commit is contained in:
Christoph Oelckers 2016-11-15 11:21:08 +01:00
commit 96d093d01f
10 changed files with 179 additions and 45 deletions

View file

@ -913,7 +913,7 @@ bool FStateDefinitions::SetLoop()
//
//==========================================================================
int FStateDefinitions::AddStates(FState *state, const char *framechars)
int FStateDefinitions::AddStates(FState *state, const char *framechars, const FScriptPosition &sc)
{
bool error = false;
int frame = 0;
@ -939,6 +939,7 @@ int FStateDefinitions::AddStates(FState *state, const char *framechars)
state->Frame = frame;
state->SameFrame = noframe;
StateArray.Push(*state);
SourceLines.Push(sc);
++count;
// NODELAY flag is not carried past the first state
@ -968,6 +969,7 @@ int FStateDefinitions::FinishStates(PClassActor *actor, AActor *defaults)
memcpy(realstates, &StateArray[0], count*sizeof(FState));
actor->OwnedStates = realstates;
actor->NumOwnedStates = count;
SaveStateSourceLines(realstates, SourceLines);
// adjust the state pointers
// In the case new states are added these must be adjusted, too!
@ -1012,6 +1014,7 @@ int FStateDefinitions::FinishStates(PClassActor *actor, AActor *defaults)
}
//==========================================================================
//
// Prints all state label info to the logfile