- added ML_BLOCKPROJECTILE flag to lines.

SVN r1440 (trunk)
This commit is contained in:
Christoph Oelckers 2009-02-22 15:39:42 +00:00
parent eb47f4fdbf
commit 613ae5e022
7 changed files with 49 additions and 4 deletions

View file

@ -1,4 +1,5 @@
February 22, 2009 (Changes by Graf Zahl) February 22, 2009 (Changes by Graf Zahl)
- added ML_BLOCKPROJECTILE flag to lines.
- Fixed: With opl_onechip set the second OPL chip was never set to anything valid - Fixed: With opl_onechip set the second OPL chip was never set to anything valid
so it contained an invalid pointer. There were also a few other places that so it contained an invalid pointer. There were also a few other places that
simply assumed that the second chip is set to something valid. simply assumed that the second chip is set to something valid.

View file

@ -1,5 +1,5 @@
=============================================================================== ===============================================================================
Universal Doom Map Format ZDoom extensions v1.2 - 21.08.2008 Universal Doom Map Format ZDoom extensions v1.5 - 22.02.2009
Copyright (c) 2008 Christoph Oelckers. Copyright (c) 2008 Christoph Oelckers.
@ -102,6 +102,7 @@ Note: All <bool> fields default to false unless mentioned otherwise.
wrapmidtex = <bool>; // Line's mid textures are wrapped. wrapmidtex = <bool>; // Line's mid textures are wrapped.
midtex3d = <bool>; // Actors can walk on mid texture. midtex3d = <bool>; // Actors can walk on mid texture.
checkswitchrange = <bool>;// Switches can only be activated when vertically reachable. checkswitchrange = <bool>;// Switches can only be activated when vertically reachable.
blockprojectiles = <bool>;// Line blocks all projectiles
} }
@ -200,6 +201,7 @@ Note: All <bool> fields default to false unless mentioned otherwise.
Bit 4 (Value 16): wrapmidtex Bit 4 (Value 16): wrapmidtex
Bit 5 (Value 32): midtex3d Bit 5 (Value 32): midtex3d
Bit 6 (Value 64): checkswitchrange Bit 6 (Value 64): checkswitchrange
Bit 7 (Value 128): firstsideonly
When used in special 208 this arg should be cleared afterward. When used in special 208 this arg should be cleared afterward.
@ -229,6 +231,8 @@ integer, not float
Changed description of class and skill thing flags to avoid the impression that Changed description of class and skill thing flags to avoid the impression that
this uses array syntax. No functional changes this uses array syntax. No functional changes
1.5 22.02.2009
Added blockprojectiles to lines and firstsideonly to conversion notes
=============================================================================== ===============================================================================
EOF EOF

View file

@ -149,6 +149,7 @@ enum ELineFlags
ML_3DMIDTEX = 0x00200000, ML_3DMIDTEX = 0x00200000,
ML_CHECKSWITCHRANGE = 0x00400000, ML_CHECKSWITCHRANGE = 0x00400000,
ML_FIRSTSIDEONLY = 0x00800000, // activated only when crossed from front side ML_FIRSTSIDEONLY = 0x00800000, // activated only when crossed from front side
ML_BLOCKPROJECTILE = 0x01000000,
}; };

View file

@ -409,5 +409,6 @@ xx(light)
xx(lightabsolute) xx(lightabsolute)
xx(nofakecontrast) xx(nofakecontrast)
xx(smoothlighting) xx(smoothlighting)
xx(blockprojectiles)
xx(Renderstyle) xx(Renderstyle)

View file

@ -2357,6 +2357,39 @@ FUNC(LS_Line_SetTextureOffset)
return true; return true;
} }
FUNC(LS_Line_SetBlocking)
// Line_SetBlocking (id, setflags, clearflags)
{
static const int flagtrans[] =
{
ML_BLOCKING,
ML_BLOCKMONSTERS,
ML_BLOCK_PLAYERS,
ML_BLOCK_FLOATERS,
ML_BLOCKPROJECTILE,
ML_BLOCKEVERYTHING,
ML_RAILING,
-1
};
if (arg0 == 0) return false;
int setflags = 0;
int clearflags = 0;
for(int i = 0; flagtrans[i] != -1; i++, arg1 >>= 1, arg2 >>= 1)
{
if (arg1 & 1) setflags |= flagtrans[i];
if (arg2 & 1) clearflags |= flagtrans[i];
}
for(int line = -1; (line = P_FindLineFromID (arg0, line)) >= 0; )
{
lines[line].flags = (lines[line].flags & ~clearflags) | setflags;
}
return true;
}
FUNC(LS_ChangeCamera) FUNC(LS_ChangeCamera)
@ -2942,8 +2975,8 @@ lnSpecFunc LineSpecials[256] =
LS_Sector_SetLink, LS_Sector_SetLink,
LS_Scroll_Wall, LS_Scroll_Wall,
LS_Line_SetTextureOffset, LS_Line_SetTextureOffset,
LS_NOP, // 54 LS_Sector_ChangeFlags,
LS_NOP, // 55 LS_Line_SetBlocking,
LS_NOP, // 56 LS_NOP, // 56
LS_NOP, // 57 LS_NOP, // 57
LS_NOP, // 58 LS_NOP, // 58

View file

@ -562,7 +562,7 @@ bool PIT_CheckLine (line_t *ld, const FBoundingBox &box, FCheckPosition &tm)
return false; return false;
} }
if (!(tm.thing->flags & MF_MISSILE) || (ld->flags & ML_BLOCKEVERYTHING)) if (!(tm.thing->flags & MF_MISSILE) || (ld->flags & (ML_BLOCKEVERYTHING|ML_BLOCKPROJECTILE)))
{ {
if (ld->flags & ML_RAILING) if (ld->flags & ML_RAILING)
{ {
@ -571,6 +571,7 @@ bool PIT_CheckLine (line_t *ld, const FBoundingBox &box, FCheckPosition &tm)
else if ((ld->flags & (ML_BLOCKING|ML_BLOCKEVERYTHING)) || // explicitly blocking everything else if ((ld->flags & (ML_BLOCKING|ML_BLOCKEVERYTHING)) || // explicitly blocking everything
(!(tm.thing->flags3 & MF3_NOBLOCKMONST) && (ld->flags & ML_BLOCKMONSTERS)) || // block monsters only (!(tm.thing->flags3 & MF3_NOBLOCKMONST) && (ld->flags & ML_BLOCKMONSTERS)) || // block monsters only
(tm.thing->player != NULL && (ld->flags & ML_BLOCK_PLAYERS)) || // block players (tm.thing->player != NULL && (ld->flags & ML_BLOCK_PLAYERS)) || // block players
((tm.thing->flags & MF_MISSILE) && (ld->flags & ML_BLOCKPROJECTILE)) || // block projectiles
((ld->flags & ML_BLOCK_FLOATERS) && (tm.thing->flags & MF_FLOAT))) // block floaters ((ld->flags & ML_BLOCK_FLOATERS) && (tm.thing->flags & MF_FLOAT))) // block floaters
{ {
if (tm.thing->flags2 & MF2_BLASTED) if (tm.thing->flags2 & MF2_BLASTED)

View file

@ -628,6 +628,10 @@ struct UDMFParser
Flag(ld->flags, ML_FIRSTSIDEONLY, key); Flag(ld->flags, ML_FIRSTSIDEONLY, key);
break; break;
case NAME_blockprojectiles:
Flag(ld->flags, ML_BLOCKPROJECTILE, key);
break;
default: default:
break; break;
} }