- Finally has the right idea how to restore Doom's original clipping of projectiles

against decorations without breaking anything newer:
  Added a new 'projectilepassheight' property that defines an alternative height
  that is only used when checking a projectile's movement against this actor.
  If the value is positive it is used regardless of other settings, if it is
  negative, its absolute will be used if a new compatibility option is enabled
  and if it is 0 the normal height will be used.


SVN r1253 (trunk)
This commit is contained in:
Christoph Oelckers 2008-10-05 11:23:41 +00:00
parent d9ab611db2
commit 2221ab5668
13 changed files with 80 additions and 2 deletions

View file

@ -1,4 +1,11 @@
October 5, 2008 (Changes by Graf Zahl)
- Finally has the right idea how to restore Doom's original clipping of projectiles
against decorations without breaking anything newer:
Added a new 'projectilepassheight' property that defines an alternative height
that is only used when checking a projectile's movement against this actor.
If the value is positive it is used regardless of other settings, if it is
negative, its absolute will be used if a new compatibility option is enabled
and if it is 0 the normal height will be used.
- Fixed: Powerup.Color's handler contained an unnecessary 'else' which resulted
in opaque powerup blends.

View file

@ -650,6 +650,7 @@ public:
struct sector_t *ceilingsector;
FTextureID ceilingpic; // contacted sec ceilingpic
fixed_t radius, height; // for movement checking
fixed_t projectilepassheight; // height for clipping projectile movement against this actor
fixed_t momx, momy, momz; // momentums
SDWORD tics; // state tic counter
FState *state;

View file

@ -746,6 +746,7 @@ static int PatchThing (int thingy)
else if (linelen == 6 && stricmp (Line1, "Height") == 0)
{
info->height = val;
info->projectilepassheight = 0; // needs to be disabled
hadHeight = true;
}
else if (linelen == 14 && stricmp (Line1, "Missile damage") == 0)
@ -1009,6 +1010,7 @@ static int PatchThing (int thingy)
thingy <= NumOrgHeights && thingy > 0)
{
info->height = OrgHeights[thingy - 1] * FRACUNIT;
info->projectilepassheight = 0;
}
// If the thing's shadow changed, change its fuzziness if not already specified
if ((info->flags ^ oldflags) & MF_SHADOW)

View file

@ -486,6 +486,7 @@ CVAR (Flag, compat_boomscroll, compatflags, COMPATF_BOOMSCROLL);
CVAR (Flag, compat_invisibility,compatflags, COMPATF_INVISIBILITY);
CVAR (Flag, compat_silentinstantfloors,compatflags, COMPATF_SILENT_INSTANT_FLOORS);
CVAR (Flag, compat_sectorsounds,compatflags, COMPATF_SECTORSOUNDS);
CVAR (Flag, compat_missileclip, compatflags, COMPATF_MISSILECLIP);
//==========================================================================
//

View file

@ -273,6 +273,7 @@ enum
COMPATF_INVISIBILITY = 1 << 16, // Monsters can see semi-invisible players
COMPATF_SILENT_INSTANT_FLOORS = 1<<17, // Instantly moving floors are not silent
COMPATF_SECTORSOUNDS = 1 << 18, // Sector sounds use original method for sound origin.
COMPATF_MISSILECLIP = 1 << 19, // Use original Doom heights for clipping against projectiles
};
// phares 3/20/98:

View file

@ -351,6 +351,7 @@ static const char *MapInfoMapLevel[] =
"compat_invisibility",
"compat_silent_instant_floors",
"compat_sectorsounds",
"compat_missileclip",
"bordertexture",
"f1", // [RC] F1 help
"noinfighting",
@ -503,6 +504,7 @@ MapHandlers[] =
{ MITYPE_COMPATFLAG, COMPATF_INVISIBILITY},
{ MITYPE_COMPATFLAG, COMPATF_SILENT_INSTANT_FLOORS},
{ MITYPE_COMPATFLAG, COMPATF_SECTORSOUNDS},
{ MITYPE_COMPATFLAG, COMPATF_MISSILECLIP},
{ MITYPE_LUMPNAME, lioffset(bordertexture), 0 },
{ MITYPE_LUMPNAME, lioffset(f1), 0, },
{ MITYPE_SCFLAGS, LEVEL_NOINFIGHTING, ~LEVEL_TOTALINFIGHTING },

View file

@ -1103,6 +1103,7 @@ static menuitem_t CompatibilityItems[] = {
{ bitflag, "Boom scrollers are additive", {&compatflags}, {0}, {0}, {0}, {(value_t *)COMPATF_BOOMSCROLL} },
{ bitflag, "Inst. moving floors are not silent", {&compatflags}, {0}, {0}, {0}, {(value_t *)COMPATF_SILENT_INSTANT_FLOORS} },
{ bitflag, "Sector sounds use center as source", {&compatflags}, {0}, {0}, {0}, {(value_t *)COMPATF_SECTORSOUNDS} },
{ bitflag, "Use Doom heights for missile clipping", {&compatflags}, {0}, {0}, {0}, {(value_t *)COMPATF_MISSILECLIP} },
{ discrete, "Interpolate monster movement", {&nomonsterinterpolation}, {2.0}, {0.0}, {0.0}, {NoYes} },
};

View file

@ -745,8 +745,24 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm)
{
return true;
}
int clipheight;
if (thing->projectilepassheight > 0)
{
clipheight = thing->projectilepassheight;
}
else if (thing->projectilepassheight < 0 && (i_compatflags & COMPATF_MISSILECLIP))
{
clipheight = -thing->projectilepassheight;
}
else
{
clipheight = thing->height;
}
// Check if it went over / under
if (tm.thing->z > thing->z + thing->height)
if (tm.thing->z > thing->z + clipheight)
{ // Over thing
return true;
}

View file

@ -220,6 +220,7 @@ void AActor::Serialize (FArchive &arc)
<< ceilingsector
<< radius
<< height
<< projectilepassheight
<< momx
<< momy
<< momz

View file

@ -695,6 +695,15 @@ DEFINE_PROPERTY(height, F, Actor)
defaults->height=id;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(projectilepassheight, F, Actor)
{
PROP_FIXED_PARM(id, 0);
defaults->projectilepassheight=id;
}
//==========================================================================
//
//==========================================================================

View file

@ -75,7 +75,7 @@
// SAVESIG should match SAVEVER.
// MINSAVEVER is the minimum level snapshot version that can be loaded.
#define MINSAVEVER 1215
#define MINSAVEVER 1253
#if SVN_REVISION_NUMBER < MINSAVEVER
// Never write a savegame with a version lower than what we need

View file

@ -6,6 +6,7 @@ ACTOR TechLamp 85
Game Doom
Radius 16
Height 80
ProjectilePassHeight -16
+SOLID
States
{
@ -22,6 +23,7 @@ ACTOR TechLamp2 86
Game Doom
Radius 16
Height 60
ProjectilePassHeight -16
+SOLID
States
{
@ -38,6 +40,7 @@ ACTOR Column 2028
Game Doom
Radius 16
Height 48
ProjectilePassHeight -16
+SOLID
States
{
@ -54,6 +57,7 @@ ACTOR TallGreenColumn 30
Game Doom
Radius 16
Height 52
ProjectilePassHeight -16
+SOLID
States
{
@ -70,6 +74,7 @@ ACTOR ShortGreenColumn 31
Game Doom
Radius 16
Height 40
ProjectilePassHeight -16
+SOLID
States
{
@ -86,6 +91,7 @@ ACTOR TallRedColumn 32
Game Doom
Radius 16
Height 52
ProjectilePassHeight -16
+SOLID
States
{
@ -102,6 +108,7 @@ ACTOR ShortRedColumn 33
Game Doom
Radius 16
Height 40
ProjectilePassHeight -16
+SOLID
States
{
@ -118,6 +125,7 @@ ACTOR SkullColumn 37
Game Doom
Radius 16
Height 40
ProjectilePassHeight -16
+SOLID
States
{
@ -134,6 +142,7 @@ ACTOR HeartColumn 36
Game Doom
Radius 16
Height 40
ProjectilePassHeight -16
+SOLID
States
{
@ -150,6 +159,7 @@ ACTOR EvilEye 41
Game Doom
Radius 16
Height 54
ProjectilePassHeight -16
+SOLID
States
{
@ -166,6 +176,7 @@ ACTOR FloatingSkull 42
Game Doom
Radius 16
Height 26
ProjectilePassHeight -16
+SOLID
States
{
@ -182,6 +193,7 @@ ACTOR TorchTree 43
Game Doom
Radius 16
Height 56
ProjectilePassHeight -16
+SOLID
States
{
@ -198,6 +210,7 @@ ACTOR BlueTorch 44
Game Doom
Radius 16
Height 68
ProjectilePassHeight -16
+SOLID
States
{
@ -214,6 +227,7 @@ ACTOR GreenTorch 45
Game Doom
Radius 16
Height 68
ProjectilePassHeight -16
+SOLID
States
{
@ -230,6 +244,7 @@ ACTOR RedTorch 46
Game Doom
Radius 16
Height 68
ProjectilePassHeight -16
+SOLID
States
{
@ -246,6 +261,7 @@ ACTOR ShortBlueTorch 55
Game Doom
Radius 16
Height 37
ProjectilePassHeight -16
+SOLID
States
{
@ -262,6 +278,7 @@ ACTOR ShortGreenTorch 56
Game Doom
Radius 16
Height 37
ProjectilePassHeight -16
+SOLID
States
{
@ -278,6 +295,7 @@ ACTOR ShortRedTorch 57
Game Doom
Radius 16
Height 37
ProjectilePassHeight -16
+SOLID
States
{
@ -294,6 +312,7 @@ ACTOR Stalagtite 47
Game Doom
Radius 16
Height 40
ProjectilePassHeight -16
+SOLID
States
{
@ -310,6 +329,7 @@ ACTOR TechPillar 48
Game Doom
Radius 16
Height 128
ProjectilePassHeight -16
+SOLID
States
{
@ -326,6 +346,7 @@ ACTOR Candlestick 34
Game Doom
Radius 20
Height 14
ProjectilePassHeight -16
States
{
Spawn:
@ -341,6 +362,7 @@ ACTOR Candelabra 35
Game Doom
Radius 16
Height 60
ProjectilePassHeight -16
+SOLID
States
{
@ -489,6 +511,7 @@ ACTOR HeadOnAStick 27
Game Doom
Radius 16
Height 56
ProjectilePassHeight -16
+SOLID
States
{
@ -505,6 +528,7 @@ ACTOR HeadsOnAStick 28
Game Doom
Radius 16
Height 64
ProjectilePassHeight -16
+SOLID
States
{
@ -521,6 +545,7 @@ ACTOR HeadCandles 29
Game Doom
Radius 16
Height 42
ProjectilePassHeight -16
+SOLID
States
{
@ -537,6 +562,7 @@ ACTOR DeadStick 25
Game Doom
Radius 16
Height 64
ProjectilePassHeight -16
+SOLID
States
{
@ -553,6 +579,7 @@ ACTOR LiveStick 26
Game Doom
Radius 16
Height 64
ProjectilePassHeight -16
+SOLID
States
{
@ -570,6 +597,7 @@ ACTOR BigTree 54
Game Doom
Radius 32
Height 108
ProjectilePassHeight -16
+SOLID
States
{
@ -587,6 +615,7 @@ ACTOR BurningBarrel 70
SpawnID 149
Radius 16
Height 32
ProjectilePassHeight -16
+SOLID
States
{

View file

@ -1063,6 +1063,14 @@
RelativePath=".\src\thingdef\thingdef_exp.cpp"
>
</File>
<File
RelativePath=".\src\thingdef\thingdef_exp.h"
>
</File>
<File
RelativePath=".\src\thingdef\thingdef_exp_execute.cpp"
>
</File>
<File
RelativePath=".\src\thingdef\thingdef_main.cpp"
>