- Added speed factors for texture warp commands.

- Added damage type parameter to A_Die.

SVN r942 (trunk)
This commit is contained in:
Christoph Oelckers 2008-04-26 08:46:55 +00:00
parent 8de6217f66
commit dbf4677da9
6 changed files with 29 additions and 6 deletions

View file

@ -1,3 +1,7 @@
April 26, 2008 (Changes by Graf Zahl)
- Added speed factors for texture warp commands.
- Added damage type parameter to A_Die.
April 25, 2008
- Re-enabled TiMidity's loop and envelope stripping for instruments that look
like they weren't really meant to be played by the GUS MIDI library.

View file

@ -2502,7 +2502,19 @@ void A_Pain (AActor *actor)
// killough 11/98: kill an object
void A_Die (AActor *actor)
{
P_DamageMobj (actor, NULL, NULL, actor->health, NAME_None);
ENamedName name;
int index=CheckIndex(1, &CallingState);
if (index<0)
{
name = NAME_None;
}
else
{
name = ENamedName(StateParameters[index]);
}
P_DamageMobj (actor, NULL, NULL, actor->health, name);
}
//

View file

@ -340,6 +340,11 @@ static void R_InitAnimDefs ()
TexMan.ReplaceTexture (picnum, warper, false);
}
if (sc.CheckFloat())
{
static_cast<FWarpTexture*>(warper)->SetSpeed(sc.Float);
}
// No decals on warping textures, by default.
// Warping information is taken from the last warp
// definition for this texture.

View file

@ -494,12 +494,14 @@ public:
void Unload ();
bool CheckModified ();
int GetSourceLump() { return SourcePic->GetSourceLump(); }
void SetSpeed(float fac) { Speed = fac; }
protected:
FTexture *SourcePic;
BYTE *Pixels;
Span **Spans;
DWORD GenTime;
float Speed;
virtual void MakeTexture (DWORD time);
};

View file

@ -40,7 +40,7 @@
FWarpTexture::FWarpTexture (FTexture *source)
: SourcePic (source), Pixels (0), Spans (0), GenTime (0)
: SourcePic (source), Pixels (0), Spans (0), GenTime (0), Speed (0.f)
{
CopySize(source);
bNoDecals = source->bNoDecals;
@ -149,7 +149,7 @@ void FWarpTexture::MakeTexture (DWORD time)
ybits--;
}
DWORD timebase = time * 32 / 28;
DWORD timebase = DWORD(time * Speed * 32 / 28);
for (y = ysize-1; y >= 0; y--)
{
int xt, xf = (finesine[(timebase+y*128)&FINEMASK]>>13) & xmask;
@ -158,7 +158,7 @@ void FWarpTexture::MakeTexture (DWORD time)
for (xt = xsize; xt; xt--, xf = (xf+1)&xmask, dest += ysize)
*dest = source[xf << ybits];
}
timebase = time * 23 / 28;
timebase = DWORD(time * Speed * 23 / 28);
for (x = xsize-1; x >= 0; x--)
{
int yt, yf = (finesine[(time+(x+17)*128)&FINEMASK]>>13) & ymask;
@ -205,7 +205,7 @@ void FWarp2Texture::MakeTexture (DWORD time)
ybits--;
}
DWORD timebase = time * 40 / 28;
DWORD timebase = DWORD(time * Speed * 40 / 28);
for (x = 0; x < xsize; ++x)
{
BYTE *dest = Pixels + (x << ybits);

View file

@ -54,7 +54,7 @@ class Actor extends Thinker
action native A_SpawnSound();
action native A_SpawnFly();
action native A_BrainExplode();
action native A_Die();
action native A_Die(optional name damagetype);
action native A_Detonate();
action native A_Mushroom(optional class<Actor> spawntype, optional eval int numspawns);