src/file.cpp

changeset 418
c435027ee5cd
parent 417
14bfeed046f3
child 421
7d26db0be944
equal deleted inserted replaced
417:14bfeed046f3 418:c435027ee5cd
640 if (comm == fmt ("BFC %1", LDBFCObject::statements [i])) 640 if (comm == fmt ("BFC %1", LDBFCObject::statements [i]))
641 return new LDBFCObject ((LDBFCObject::Type) i); 641 return new LDBFCObject ((LDBFCObject::Type) i);
642 642
643 // MLCAD is notorious for stuffing these statements in parts it 643 // MLCAD is notorious for stuffing these statements in parts it
644 // creates. The above block only handles valid statements, so we 644 // creates. The above block only handles valid statements, so we
645 // need to handle MLCAD-style invertnext separately. 645 // need to handle MLCAD-style invertnext, clip and noclip separately.
646 if (comm == "BFC CERTIFY INVERTNEXT") 646 struct {
647 return new LDBFCObject (LDBFCObject::InvertNext); 647 const char* a;
648 LDBFCObject::Type b;
649 } BFCData[] = {
650 { "INVERTNEXT", LDBFCObject::InvertNext },
651 { "NOCLIP", LDBFCObject::NoClip },
652 { "CLIP", LDBFCObject::Clip }
653 };
654
655 for (const auto& i : BFCData)
656 if (comm == fmt ("BFC CERTIFY %1", i.a))
657 return new LDBFCObject (i.b);
648 } 658 }
649 659
650 if (tokens.size() > 2 && tokens[1] == "!LDFORGE") { 660 if (tokens.size() > 2 && tokens[1] == "!LDFORGE") {
651 // Handle LDForge-specific types, they're embedded into comments too 661 // Handle LDForge-specific types, they're embedded into comments too
652 if (tokens[2] == "VERTEX") { 662 if (tokens[2] == "VERTEX") {

mercurial