diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 0be3b878d..41cc2d5b6 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -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. diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index c8e74d12f..7af3e18fb 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -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); } // diff --git a/src/r_anim.cpp b/src/r_anim.cpp index 14b701334..ac8aca317 100644 --- a/src/r_anim.cpp +++ b/src/r_anim.cpp @@ -340,6 +340,11 @@ static void R_InitAnimDefs () TexMan.ReplaceTexture (picnum, warper, false); } + if (sc.CheckFloat()) + { + static_cast(warper)->SetSpeed(sc.Float); + } + // No decals on warping textures, by default. // Warping information is taken from the last warp // definition for this texture. diff --git a/src/r_data.h b/src/r_data.h index eb5a5ecff..890061314 100644 --- a/src/r_data.h +++ b/src/r_data.h @@ -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); }; diff --git a/src/textures/warptexture.cpp b/src/textures/warptexture.cpp index eae089a53..662496344 100644 --- a/src/textures/warptexture.cpp +++ b/src/textures/warptexture.cpp @@ -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); diff --git a/wadsrc/decorate/nativeclasses.txt b/wadsrc/decorate/nativeclasses.txt index 7b0aed679..272537920 100644 --- a/wadsrc/decorate/nativeclasses.txt +++ b/wadsrc/decorate/nativeclasses.txt @@ -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 spawntype, optional eval int numspawns);