mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 07:11:54 +00:00
- fixed some last issues with the tag manager.
This commit is contained in:
parent
db61c1cb57
commit
cad282142d
3 changed files with 32 additions and 5 deletions
|
@ -2223,7 +2223,7 @@ void P_LoadLineDefs2 (MapData * map)
|
||||||
|
|
||||||
mld = (maplinedef2_t *)mldf;
|
mld = (maplinedef2_t *)mldf;
|
||||||
ld = lines;
|
ld = lines;
|
||||||
for (i = numlines; i > 0; i--, mld++, ld++)
|
for (i = 0; i < numlines; i++, mld++, ld++)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
|
|
|
@ -269,6 +269,29 @@ bool FTagManager::LineHasID(const line_t *line, int tag) const
|
||||||
return LineHasID(lineindex(line), tag);
|
return LineHasID(lineindex(line), tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void FTagManager::DumpTags()
|
||||||
|
{
|
||||||
|
for (unsigned i = 0; i < allTags.Size(); i++)
|
||||||
|
{
|
||||||
|
Printf("Sector %d, tag %d\n", allTags[i].target, allTags[i].tag);
|
||||||
|
}
|
||||||
|
for (unsigned i = 0; i < allIDs.Size(); i++)
|
||||||
|
{
|
||||||
|
Printf("Line %d, ID %d\n", allIDs[i].target, allIDs[i].tag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CCMD(dumptags)
|
||||||
|
{
|
||||||
|
tagManager.DumpTags();
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// RETURN NEXT SECTOR # THAT LINE TAG REFERS TO
|
// RETURN NEXT SECTOR # THAT LINE TAG REFERS TO
|
||||||
|
@ -290,7 +313,7 @@ int FSectorTagIterator::Next()
|
||||||
{
|
{
|
||||||
while (start >= 0 && tagManager.allTags[start].tag != searchtag) start = tagManager.allTags[start].nexttag;
|
while (start >= 0 && tagManager.allTags[start].tag != searchtag) start = tagManager.allTags[start].nexttag;
|
||||||
if (start == -1) return -1;
|
if (start == -1) return -1;
|
||||||
ret = start;
|
ret = tagManager.allTags[start].target;
|
||||||
start = start = tagManager.allTags[start].nexttag;
|
start = start = tagManager.allTags[start].nexttag;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -324,9 +347,7 @@ int FLineIdIterator::Next()
|
||||||
{
|
{
|
||||||
while (start >= 0 && tagManager.allIDs[start].tag != searchtag) start = tagManager.allIDs[start].nexttag;
|
while (start >= 0 && tagManager.allIDs[start].tag != searchtag) start = tagManager.allIDs[start].nexttag;
|
||||||
if (start == -1) return -1;
|
if (start == -1) return -1;
|
||||||
int ret = start;
|
int ret = tagManager.allIDs[start].target;
|
||||||
start = start = tagManager.allIDs[start].nexttag;
|
start = start = tagManager.allIDs[start].nexttag;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,10 @@ class FTagManager
|
||||||
return sect >= 0 && sect < (int)startForSector.Size() && startForSector[sect] >= 0;
|
return sect >= 0 && sect < (int)startForSector.Size() && startForSector[sect] >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool LineHasIDs(int sect) const
|
||||||
|
{
|
||||||
|
return sect >= 0 && sect < (int)startForLine.Size() && startForLine[sect] >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Clear()
|
void Clear()
|
||||||
|
@ -59,6 +63,8 @@ public:
|
||||||
void AddSectorTag(int sector, int tag);
|
void AddSectorTag(int sector, int tag);
|
||||||
void AddLineID(int line, int tag);
|
void AddLineID(int line, int tag);
|
||||||
void RemoveSectorTags(int sect);
|
void RemoveSectorTags(int sect);
|
||||||
|
|
||||||
|
void DumpTags();
|
||||||
};
|
};
|
||||||
|
|
||||||
extern FTagManager tagManager;
|
extern FTagManager tagManager;
|
||||||
|
|
Loading…
Reference in a new issue