MCPcopy Create free account
hub / github.com/ZDoom/Raze / AddGroup

Method AddGroup

source/common/textures/texturemanager.cpp:565–609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

563//==========================================================================
564
565void FTextureManager::AddGroup(int wadnum, int ns, ETextureType usetype)
566{
567 int firsttx = fileSystem.GetFirstEntry(wadnum);
568 int lasttx = fileSystem.GetLastEntry(wadnum);
569
570 if (!usefullnames)
571 {
572 // Go from first to last so that ANIMDEFS work as expected. However,
573 // to avoid duplicates (and to keep earlier entries from overriding
574 // later ones), the texture is only inserted if it is the one returned
575 // by doing a check by name in the list of wads.
576
577 for (; firsttx <= lasttx; ++firsttx)
578 {
579 auto Name = fileSystem.GetFileShortName(firsttx);
580 if (fileSystem.GetFileNamespace(firsttx) == ns)
581 {
582 if (fileSystem.CheckNumForName(Name, ns) == firsttx)
583 {
584 CreateTexture(firsttx, usetype);
585 }
586 progressFunc();
587 }
588 else if (ns == ns_flats && fileSystem.GetFileFlags(firsttx) & RESFF_MAYBEFLAT)
589 {
590 if (fileSystem.CheckNumForName(Name, ns) < firsttx)
591 {
592 CreateTexture(firsttx, usetype);
593 }
594 progressFunc();
595 }
596 }
597 }
598 else
599 {
600 // The duplicate check does not work with this (yet.)
601 for (; firsttx <= lasttx; ++firsttx)
602 {
603 if (fileSystem.GetFileNamespace(firsttx) == ns)
604 {
605 CreateTexture(firsttx, usetype);
606 }
607 }
608 }
609}
610
611//==========================================================================
612//

Callers

nothing calls this directly

Calls 6

GetLastEntryMethod · 0.80
GetFileShortNameMethod · 0.80
GetFileNamespaceMethod · 0.80
GetFileFlagsMethod · 0.80
GetFirstEntryMethod · 0.45
CheckNumForNameMethod · 0.45

Tested by

no test coverage detected