mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
Adds line specials
This commit is contained in:
parent
cadc4f2a30
commit
475d3f0829
1 changed files with 50 additions and 0 deletions
|
@ -2765,6 +2765,54 @@ FUNC(LS_Line_SetBlocking)
|
|||
return true;
|
||||
}
|
||||
|
||||
FUNC(LS_Line_SetAutomapFlags)
|
||||
// Line_SetAutomapFlags (id, setflags, clearflags)
|
||||
{
|
||||
static const int flagtrans[] =
|
||||
{
|
||||
ML_SECRET,
|
||||
ML_DONTDRAW,
|
||||
ML_MAPPED,
|
||||
ML_REVEALED,
|
||||
-1
|
||||
};
|
||||
|
||||
if (arg0 == 0) return false;
|
||||
|
||||
int setflags = 0;
|
||||
int clearflags = 0;
|
||||
|
||||
for (int i = 0; flagtrans[i] != ML_PORTALCONNECT; i++, arg1 >>= 1, arg2 >>= 1)
|
||||
{
|
||||
if (arg1 & 1) setflags |= flagtrans[i];
|
||||
if (arg2 & 1) clearflags |= flagtrans[i];
|
||||
}
|
||||
|
||||
FLineIdIterator itr(arg0);
|
||||
int line;
|
||||
while ((line = itr.Next()) >= 0)
|
||||
{
|
||||
level.lines[line].flags = (level.lines[line].flags & ~clearflags) | setflags;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
FUNC(LS_Line_SetAutomapStyle)
|
||||
// Line_SetAutomapStyle (id, setflags, clearflags)
|
||||
{
|
||||
if (arg1 < AMLS_COUNT && arg1 >= 0) {
|
||||
FLineIdIterator itr(arg0);
|
||||
int line;
|
||||
while ((line = itr.Next()) >= 0)
|
||||
{
|
||||
level.lines[line].automapstyle = (AutomapLineStyle) arg1;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
FUNC(LS_ChangeCamera)
|
||||
|
@ -3713,6 +3761,8 @@ static lnSpecFunc LineSpecials[] =
|
|||
/* 278 */ LS_Sector_SetCeilingGlow,
|
||||
/* 279 */ LS_Floor_MoveToValueAndCrush,
|
||||
/* 280 */ LS_Ceiling_MoveToValueAndCrush,
|
||||
/* 281 */ LS_Line_SetAutomapFlags,
|
||||
/* 282 */ LS_Line_SetAutomapStyle,
|
||||
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue