| 563 | //========================================================================== |
| 564 | |
| 565 | void 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 | // |
nothing calls this directly
no test coverage detected