| 590 | //========================================================================== |
| 591 | |
| 592 | void FMapInfoParser::ParseTextureFlags() |
| 593 | { |
| 594 | int num = -1; |
| 595 | |
| 596 | // this block deliberately uses a 'flag = texture, texture...' syntax because it is a lot easier to handle than doing the reverse |
| 597 | sc.MustGetStringName("{"); |
| 598 | while (!sc.CheckString("}")) |
| 599 | { |
| 600 | // Do not use internal lookup here because this code must be able to gracefully skip the definition if the flag constant does not exist. |
| 601 | // This also blocks passing in literal numbers which is quite intentional. |
| 602 | sc.MustGetString(); |
| 603 | FName cname(sc.String, true); |
| 604 | auto lookup = cname == NAME_None ? nullptr : sc.LookupSymbol(cname); |
| 605 | num = 0; |
| 606 | if (lookup) num = int(lookup->Number); |
| 607 | else |
| 608 | sc.ScriptMessage("'%s': Unknown texture flag", sc.String); |
| 609 | ParseAssign(); |
| 610 | do |
| 611 | { |
| 612 | sc.MustGetString(); |
| 613 | // this must also get null textures and ones not yet loaded. |
| 614 | auto tex = TexMan.CheckForTexture(sc.String, ETextureType::Any, texlookupflags); |
| 615 | |
| 616 | if (!tex.isValid()) |
| 617 | { |
| 618 | sc.ScriptMessage("textureflags:Unknown texture name '%s'", sc.String); |
| 619 | } |
| 620 | else |
| 621 | { |
| 622 | AccessExtInfo(tex).flags |= num; |
| 623 | } |
| 624 | |
| 625 | } while (sc.CheckString(",")); |
| 626 | } |
| 627 | } |
| 628 | |
| 629 | //========================================================================== |
| 630 | // |
nothing calls this directly
no test coverage detected