mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- allow assignment of line IDs through LevelCompatbility.
This commit is contained in:
parent
dd2ea206f9
commit
5e4ef04a4d
4 changed files with 46 additions and 0 deletions
|
@ -411,6 +411,27 @@ DEFINE_ACTION_FUNCTION(DLevelCompatibility, AddSectorTag)
|
|||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DLevelCompatibility, ClearLineIDs)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(DLevelCompatibility);
|
||||
PARAM_INT(line);
|
||||
self->Level->tagManager.RemoveLineIDs(line);
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DLevelCompatibility, AddLineID)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(DLevelCompatibility);
|
||||
PARAM_INT(line);
|
||||
PARAM_INT(tag);
|
||||
|
||||
if ((unsigned)line < self->Level->lines.Size())
|
||||
{
|
||||
self->Level->tagManager.AddLineID(line, tag);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DLevelCompatibility, SetThingSkills)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(DLevelCompatibility);
|
||||
|
|
|
@ -104,6 +104,28 @@ void FTagManager::RemoveSectorTags(int sect)
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void FTagManager::RemoveLineIDs(int line)
|
||||
{
|
||||
if (startForLine.Size() > (unsigned int)line)
|
||||
{
|
||||
int start = startForLine[line];
|
||||
if (start >= 0)
|
||||
{
|
||||
while (allIDs[start].target == line)
|
||||
{
|
||||
allTags[start].tag = allTags[start].target = -1;
|
||||
start++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void FTagManager::AddLineID(int line, int tag)
|
||||
{
|
||||
if (tag == -1) return; // For line IDs -1 means 'not set', unlike sectors.
|
||||
|
|
|
@ -66,6 +66,7 @@ public:
|
|||
void AddSectorTag(int sector, int tag);
|
||||
void AddLineID(int line, int tag);
|
||||
void RemoveSectorTags(int sect);
|
||||
void RemoveLineIDs(int line);
|
||||
|
||||
void DumpTags();
|
||||
};
|
||||
|
|
|
@ -1185,6 +1185,8 @@ class LevelCompatibility native play
|
|||
|
||||
protected native void ClearSectorTags(int sector);
|
||||
protected native void AddSectorTag(int sector, int tag);
|
||||
protected native void ClearLineIDs(int line);
|
||||
protected native void AddLineID(int line, int tag);
|
||||
protected native void OffsetSectorPlane(int sector, int plane, double offset);
|
||||
protected native void SetThingSkills(int thing, int skills);
|
||||
protected native void SetThingXY(int thing, double x, double y);
|
||||
|
|
Loading…
Reference in a new issue