- Used the one unused byte in the state structure as a flag to tell what type

the NextState parameter is. The code did some rather unsafe checks with it
  to determine its type.
- moved all state related code into a new file: p_states.cpp.
- merged all FindState functions. All the different variations are now inlined
  and call the same function to do the real work.


SVN r1243 (trunk)
This commit is contained in:
Christoph Oelckers 2008-09-22 18:55:29 +00:00
commit 954955c5a5
16 changed files with 1001 additions and 904 deletions

View file

@ -507,7 +507,7 @@ void ParseActorProperty(FScanner &sc, Baggage &bag)
}
else if (MatchString(propname, statenames) != -1)
{
AddState(propname, CheckState (sc, bag.Info->Class));
bag.statedef.AddState(propname, CheckState (sc, bag.Info->Class));
}
else
{
@ -528,13 +528,14 @@ void FinishActor(FScanner &sc, FActorInfo *info, Baggage &bag)
try
{
FinishStates (info, defaults);
bag.statedef.FinishStates (info, defaults, bag.StateArray);
}
catch (CRecoverableError &err)
{
sc.ScriptError(err.GetMessage());
}
InstallStates (info, defaults);
bag.statedef.InstallStates (info, defaults);
bag.StateArray.Clear ();
if (bag.DropItemSet)
{
if (bag.DropItemList == NULL)