public static MQOFile load(TextReader tr, bool triangle_only = false) { MQOFile mqo = new MQOFile(); if (!mqo.parse(tr, triangle_only)) { mqo.Dispose(); mqo = null; } return(mqo); }
internal bool parse(TextReader tr, bool triangle_only = false) { while (true) { string str = tr.ReadLine().Trim(); if (str.StartsWith("vertex ")) { if (!parseVertex(tr)) { Dispose(); return(false); } continue; } else if (str.StartsWith("face ")) { if (!parseFace(tr, triangle_only)) { Dispose(); return(false); } continue; } else if (str.EndsWith("{")) { if (!MQOFile.skipBlock(tr)) { Dispose(); return(false); } continue; } else if (str.EndsWith("}")) { return(true); } else { MQOAttribute ma = MQOAttribute.parse(str); if (ma == null) { Dispose(); return(false); } Attribute.Add(ma); continue; } } }
public static MQOFile load(TextReader tr, bool triangle_only=false) { MQOFile mqo = new MQOFile(); if (!mqo.parse(tr, triangle_only)) { mqo.Dispose(); mqo = null; } return mqo; }