- Removed DECORATE's ParseClass because it was only used to add data to fully
internal actor classes which no longer exist. - Changed the state structure so that the Tics value doesn't need to be hacked into misc1 with SF_BIGTIC anymore. - Changed sprite processing so that sprite names are converted to indices during parsing so that an additional postprocessing step is no longer needed. - Fixed: Sprite names in DECORATE were case sensitive. - Exported AActor's defaults to DECORATE and removed all code for the internal property parser which is no longer needed. SVN r1146 (trunk)
This commit is contained in:
parent
9b58c5ebbd
commit
f4c07c45ec
33 changed files with 484 additions and 1662 deletions
|
|
@ -360,8 +360,8 @@ void AActor::Serialize (FArchive &arc)
|
|||
{
|
||||
if (playeringame[player - players] &&
|
||||
player->cls != NULL &&
|
||||
state->sprite.index ==
|
||||
GetDefaultByType (player->cls)->SpawnState->sprite.index)
|
||||
state->sprite ==
|
||||
GetDefaultByType (player->cls)->SpawnState->sprite)
|
||||
{ // Give player back the skin
|
||||
sprite = skins[player->userinfo.skin].sprite;
|
||||
scaleX = skins[player->userinfo.skin].ScaleX;
|
||||
|
|
@ -477,7 +477,7 @@ bool AActor::SetState (FState *newstate)
|
|||
|
||||
if (state != NULL)
|
||||
{
|
||||
prevsprite = state->sprite.index;
|
||||
prevsprite = state->sprite;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -486,13 +486,13 @@ bool AActor::SetState (FState *newstate)
|
|||
state = newstate;
|
||||
tics = GetTics(newstate);
|
||||
renderflags = (renderflags & ~RF_FULLBRIGHT) | newstate->GetFullbright();
|
||||
newsprite = newstate->sprite.index;
|
||||
newsprite = newstate->sprite;
|
||||
if (newsprite != 1)
|
||||
{
|
||||
// Sprite 1 is ----, which means "do not change the sprite"
|
||||
frame = newstate->GetFrame();
|
||||
|
||||
if (!(flags4 & MF4_NOSKIN) && newsprite == SpawnState->sprite.index)
|
||||
if (!(flags4 & MF4_NOSKIN) && newsprite == SpawnState->sprite)
|
||||
{ // [RH] If the new sprite is the same as the original sprite, and
|
||||
// this actor is attached to a player, use the player's skin's
|
||||
// sprite. If a player is not attached, do not change the sprite
|
||||
|
|
@ -560,7 +560,7 @@ bool AActor::SetStateNF (FState *newstate)
|
|||
|
||||
if (state != NULL)
|
||||
{
|
||||
prevsprite = state->sprite.index;
|
||||
prevsprite = state->sprite;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -569,13 +569,13 @@ bool AActor::SetStateNF (FState *newstate)
|
|||
state = newstate;
|
||||
tics = GetTics(newstate);
|
||||
renderflags = (renderflags & ~RF_FULLBRIGHT) | newstate->GetFullbright();
|
||||
newsprite = newstate->sprite.index;
|
||||
newsprite = newstate->sprite;
|
||||
if (newsprite != 1)
|
||||
{
|
||||
// Sprite 1 is ----, which means "do not change the sprite"
|
||||
|
||||
frame = newstate->GetFrame();
|
||||
if (!(flags4 & MF4_NOSKIN) && newsprite == SpawnState->sprite.index)
|
||||
if (!(flags4 & MF4_NOSKIN) && newsprite == SpawnState->sprite)
|
||||
{
|
||||
if (player != NULL && gameinfo.gametype != GAME_Hexen)
|
||||
{
|
||||
|
|
@ -3057,23 +3057,6 @@ bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash)
|
|||
return false; // we did the splash ourselves! ;)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
//
|
||||
// PROC A_FreeTargMobj
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
void A_FreeTargMobj (AActor *mo)
|
||||
{
|
||||
mo->momx = mo->momy = mo->momz = 0;
|
||||
mo->z = mo->ceilingz + 4*FRACUNIT;
|
||||
mo->flags &= ~(MF_SHOOTABLE|MF_FLOAT|MF_SKULLFLY|MF_SOLID);
|
||||
mo->flags |= MF_CORPSE|MF_DROPOFF|MF_NOGRAVITY;
|
||||
mo->flags2 &= ~MF2_PASSMOBJ;
|
||||
mo->gravity = FRACUNIT;
|
||||
mo->player = NULL;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// A_GenericFreezeDeath
|
||||
|
|
@ -3086,45 +3069,6 @@ void A_GenericFreezeDeath (AActor *actor)
|
|||
A_FreezeDeath (actor);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// AActor stuff
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FState AActor::States[] =
|
||||
{
|
||||
S_NORMAL (TNT1, 'A', -1, NULL, NULL),
|
||||
S_NORMAL (TNT1, 'E', 1050, A_FreeTargMobj, NULL),
|
||||
S_NORMAL (TNT1, 'A', 1, NULL, NULL), // S_NULL
|
||||
|
||||
// Generic freeze death frames. Woo!
|
||||
S_NORMAL (----, 'A', 5, A_GenericFreezeDeath, &States[4]),
|
||||
S_NORMAL (----, 'A', 1, A_FreezeDeathChunks, &States[4])
|
||||
};
|
||||
|
||||
BEGIN_DEFAULTS (AActor, Any, -1, 0)
|
||||
PROP_XScale (FRACUNIT)
|
||||
PROP_YScale (FRACUNIT)
|
||||
PROP_SpawnState (2)
|
||||
PROP_SpawnHealth (1000)
|
||||
PROP_ReactionTime (8)
|
||||
PROP_RadiusFixed (20)
|
||||
PROP_HeightFixed (16)
|
||||
PROP_Mass (100)
|
||||
PROP_RenderStyle (STYLE_Normal)
|
||||
PROP_Alpha (FRACUNIT)
|
||||
PROP_MinMissileChance (200)
|
||||
PROP_MeleeRange(44) // MELEERANGE(64) - 20
|
||||
PROP_MaxDropOffHeight(24)
|
||||
PROP_MaxStepHeight(24)
|
||||
PROP_BounceFactor(FRACUNIT*7/10)
|
||||
PROP_WallBounceFactor(FRACUNIT*3/4)
|
||||
PROP_BounceCount(-1)
|
||||
PROP_FloatSpeed(4)
|
||||
PROP_Gravity(FRACUNIT)
|
||||
END_DEFAULTS
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// P_SpawnMobj
|
||||
|
|
@ -3174,7 +3118,7 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t
|
|||
actor->state = st;
|
||||
actor->tics = st->GetTics();
|
||||
|
||||
actor->sprite = st->sprite.index;
|
||||
actor->sprite = st->sprite;
|
||||
actor->frame = st->GetFrame();
|
||||
actor->renderflags = (actor->renderflags & ~RF_FULLBRIGHT) | st->GetFullbright();
|
||||
actor->touching_sectorlist = NULL; // NULL head of sector list // phares 3/13/98
|
||||
|
|
@ -3923,7 +3867,7 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
|
|||
|
||||
const AActor *defaults = GetDefaultByType (i);
|
||||
if (defaults->SpawnState == NULL ||
|
||||
sprites[defaults->SpawnState->sprite.index].numframes == 0)
|
||||
sprites[defaults->SpawnState->sprite].numframes == 0)
|
||||
{
|
||||
Printf ("%s at (%i, %i) has no frames\n",
|
||||
i->TypeName.GetChars(), mthing->x>>FRACBITS, mthing->y>>FRACBITS);
|
||||
|
|
@ -4917,7 +4861,7 @@ int AActor::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FN
|
|||
if (death == NULL && !deh.NoAutofreeze && !(flags4 & MF4_NOICEDEATH) &&
|
||||
(player || (flags3 & MF3_ISMONSTER)))
|
||||
{
|
||||
death = &AActor::States[S_GENERICFREEZEDEATH];
|
||||
death = FindState(NAME_GenericFreezeDeath);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue