Update to ZDoom r894:

- Eliminated all use of global variables used as output for P_CheckPosition
  and P_TryMove. Moved BlockingLine and BlockingMobj into AActor because 
  the global variables can be easily overwritten with certain DECORATE 
  constructs.
- Removed some unnecessary morphing code.
- Fixed some bugs in the HIRESTEX parser.
- Added floating point support and #include and #define tokens to 
  FParseContext  Not used yet.
- replaced the value scanning code in FParseContext::GetToken with
  calls to strtol.
- Changed XlatParseContext::FindToken to do a binary search over the
  valid token names.
- Fixed: The check arrays for BlockThingsIterators were not properly
  freed and each iterator allocated a new one as a result.
- Split the Xlat parser context class into a generic part that can be 
  used for other Lemon-based parsers in the future and a smaller
  Xlat-specific part.
- Changed: P_TeleportMove now always sets BlockingLine to NULL and
  P_FindFloorCeiling doesn't set it at all. The way it was set in 
  PIT_FindFloorCeiling didn't look correct. (Note: It's amazing how
  easy it is to break P_TryMove et.al. with DECORATE if you just know
  which combinations of code pointers will cause problems. This definitely
  needs to be addressed.)
- Changed P_FindFloorCeiling so that it doesn't need global variables 
  anymore. I also moved the code to set the calling actor's information
  into this function because that's all it is used for. This also fixes
  another bug:
- AInventory::BecomePickup called P_FindFloorCeiling to get
  proper position values for the item but never set the item's information
  to the return value of this call.
- Removed the check for Heretic when playing *evillaugh when using the 
  Chaos Device. This sound is not defined by the other games so it won't
  play by default.
- Added MORPH_UNDOMORPHBYTOMEOFPOWER and MORPH_UNDOMORPHBYCHAOSDEVICE flags
  for the morph style so that the special behavior of these two items
  can be switched on and off.
- Added Martin Howe's morph system enhancement.
- Removed PT_EARLYOUT from P_PathTraverse because it wasn't used anywhere.
- Rewrote BlockThingsIterator code not to use callbacks anymore.
- Fixed: PIT_FindFloorCeiling required tmx and tmy to be set but 
  P_FindFloorCeiling never did that.
- Merged Check_Sides and PIT_CrossLine into A_PainShootSkull.
- Replaced P_BlockLinesIterator with FBlockLinesIterator in all places it was
  used. This also allowed to remove all the global variable saving in
  P_CreateSecNodeList.
- Added a new FBlockLinesIterator class that doesn't need a callback
  function because debugging the previous bug proved to be a bit annoying
  because it involved a P_BlockLinesIterator loop.
- Fixed: The MBF code to move monsters away from dropoffs did not work as 
  intended due to some random decisions in P_DoNewChaseDir. When in the
  avoiding dropoff mode these are ignored now. This should cure the problem
  that monsters hanging over a dropoff tended to drop down.
- Added a NOTIMEFREEZE flag that excludes actors from being affected by
  the time freezer powerup.
- Changed: Empty pickup messages are no longer printed.
- Changed secret sector drawing in automap so that lines with the ML_SECRET
  flag are only drawn as part of a secret sector if that secret has already
  been found, even if the option is set to always show secret sectors. 

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@88 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
Christoph Oelckers 2008-04-08 22:32:52 +00:00
parent 80afd6a8bb
commit 700adbf82f
46 changed files with 2516 additions and 2306 deletions

View file

@ -9,8 +9,7 @@
#include "m_random.h"
#include "a_sharedglobal.h"
#include "sbar.h"
#define MORPHTICS (40*TICRATE)
#include "a_morph.h"
static FRandom pr_morphmonst ("MorphMonster");
@ -22,7 +21,7 @@ static FRandom pr_morphmonst ("MorphMonster");
//
//---------------------------------------------------------------------------
bool P_MorphPlayer (player_t *p, const PClass *spawntype)
bool P_MorphPlayer (player_t *p, const PClass *spawntype, int duration, int style, const PClass *enter_flash, const PClass *exit_flash)
{
AInventory *item;
APlayerPawn *morphed;
@ -77,12 +76,12 @@ bool P_MorphPlayer (player_t *p, const PClass *spawntype)
morphed->flags |= actor->flags & (MF_SHADOW|MF_NOGRAVITY);
morphed->flags2 |= actor->flags2 & MF2_FLY;
morphed->flags3 |= actor->flags3 & MF3_GHOST;
Spawn<ATeleportFog> (actor->x, actor->y, actor->z + TELEFOGHEIGHT, ALLOW_REPLACE);
Spawn(((enter_flash) ? enter_flash : RUNTIME_CLASS(ATeleportFog)), actor->x, actor->y, actor->z + TELEFOGHEIGHT, ALLOW_REPLACE);
actor->player = NULL;
actor->flags &= ~(MF_SOLID|MF_SHOOTABLE);
actor->flags |= MF_UNMORPHED;
actor->renderflags |= RF_INVISIBLE;
p->morphTics = MORPHTICS;
p->morphTics = (duration) ? duration : MORPHTICS;
// [MH] Used by SBARINFO to speed up face drawing
p->MorphedPlayerClass = 0;
@ -94,7 +93,9 @@ bool P_MorphPlayer (player_t *p, const PClass *spawntype)
break;
}
}
p->MorphStyle = style;
p->MorphExitFlash = (exit_flash) ? exit_flash : RUNTIME_CLASS(ATeleportFog);
p->health = morphed->health;
p->mo = morphed;
p->momx = p->momy = 0;
@ -198,7 +199,12 @@ bool P_UndoPlayerMorph (player_t *player, bool force)
mo->flags2 = (mo->flags2 & ~MF2_FLY) | (pmo->flags2 & MF2_FLY);
mo->flags3 = (mo->flags3 & ~MF3_GHOST) | (pmo->flags3 & MF3_GHOST);
const PClass *exit_flash = player->MorphExitFlash;
player->morphTics = 0;
player->MorphedPlayerClass = 0;
player->MorphStyle = 0;
player->MorphExitFlash = NULL;
player->viewheight = mo->ViewHeight;
AInventory *level2 = mo->FindInventory (RUNTIME_CLASS(APowerWeaponLevel2));
if (level2 != NULL)
@ -245,8 +251,7 @@ bool P_UndoPlayerMorph (player_t *player, bool force)
}
angle = mo->angle >> ANGLETOFINESHIFT;
Spawn<ATeleportFog> (pmo->x + 20*finecosine[angle],
pmo->y + 20*finesine[angle], pmo->z + TELEFOGHEIGHT, ALLOW_REPLACE);
Spawn(exit_flash, pmo->x + 20*finecosine[angle], pmo->y + 20*finesine[angle], pmo->z + TELEFOGHEIGHT, ALLOW_REPLACE);
beastweap = player->ReadyWeapon;
if (player->PremorphWeapon != NULL)
{
@ -283,7 +288,7 @@ bool P_UndoPlayerMorph (player_t *player, bool force)
//
//---------------------------------------------------------------------------
bool P_MorphMonster (AActor *actor, const PClass *spawntype)
bool P_MorphMonster (AActor *actor, const PClass *spawntype, int duration, int style, const PClass *enter_flash, const PClass *exit_flash)
{
AMorphedMonster *morphed;
@ -303,7 +308,9 @@ bool P_MorphMonster (AActor *actor, const PClass *spawntype)
morphed->alpha = actor->alpha;
morphed->RenderStyle = actor->RenderStyle;
morphed->UnmorphTime = level.time + MORPHTICS + pr_morphmonst();
morphed->UnmorphTime = level.time + ((duration) ? duration : MORPHTICS) + pr_morphmonst();
morphed->MorphStyle = style;
morphed->MorphExitFlash = (exit_flash) ? exit_flash : RUNTIME_CLASS(ATeleportFog);
morphed->FlagsSave = actor->flags & ~MF_JUSTHIT;
//morphed->special = actor->special;
//memcpy (morphed->args, actor->args, sizeof(actor->args));
@ -320,7 +327,7 @@ bool P_MorphMonster (AActor *actor, const PClass *spawntype)
actor->flags &= ~(MF_SOLID|MF_SHOOTABLE);
actor->flags |= MF_UNMORPHED;
actor->renderflags |= RF_INVISIBLE;
Spawn<ATeleportFog> (actor->x, actor->y, actor->z + TELEFOGHEIGHT, ALLOW_REPLACE);
Spawn(((enter_flash) ? enter_flash : RUNTIME_CLASS(ATeleportFog)), actor->x, actor->y, actor->z + TELEFOGHEIGHT, ALLOW_REPLACE);
return true;
}
@ -374,8 +381,9 @@ bool P_UpdateMorphedMonster (AMorphedMonster *beast)
actor->AddToHash ();
beast->UnmorphedMe = NULL;
DObject::StaticPointerSubstitution (beast, actor);
const PClass *exit_flash = beast->MorphExitFlash;
beast->Destroy ();
Spawn<ATeleportFog> (beast->x, beast->y, beast->z + TELEFOGHEIGHT, ALLOW_REPLACE);
Spawn(exit_flash, beast->x, beast->y, beast->z + TELEFOGHEIGHT, ALLOW_REPLACE);
return true;
}
@ -389,13 +397,17 @@ END_DEFAULTS
int AMorphProjectile::DoSpecialDamage (AActor *target, int damage)
{
const PClass *morph_flash = PClass::FindClass (MorphFlash);
const PClass *unmorph_flash = PClass::FindClass (UnMorphFlash);
if (target->player)
{
P_MorphPlayer (target->player, PClass::FindClass (PlayerClass));
const PClass *player_class = PClass::FindClass (PlayerClass);
P_MorphPlayer (target->player, player_class, Duration, MorphStyle, morph_flash, unmorph_flash);
}
else
{
P_MorphMonster (target, PClass::FindClass (MonsterClass));
const PClass *monster_class = PClass::FindClass (MonsterClass);
P_MorphMonster (target, monster_class, Duration, MorphStyle, morph_flash, unmorph_flash);
}
return -1;
}
@ -403,7 +415,7 @@ int AMorphProjectile::DoSpecialDamage (AActor *target, int damage)
void AMorphProjectile::Serialize (FArchive &arc)
{
Super::Serialize (arc);
arc << PlayerClass << MonsterClass;
arc << PlayerClass << MonsterClass << Duration << MorphStyle << MorphFlash << UnMorphFlash;
}
@ -422,7 +434,7 @@ END_DEFAULTS
void AMorphedMonster::Serialize (FArchive &arc)
{
Super::Serialize (arc);
arc << UnmorphedMe << UnmorphTime << FlagsSave;
arc << UnmorphedMe << UnmorphTime << MorphStyle << MorphExitFlash << FlagsSave;
}
void AMorphedMonster::Destroy ()