public LWLayer MakeLayer(U4 number, string name, ushort flags, Vector3 pivot, int parent) { var layer = new LWLayer(name, flags, Vector3.Zero, parent); layers[number] = layer; return(layer); }
private LWModelParser(string fname) { string final_file_name = fname; //fix_file_name( "Data/Objects/", fname.c_str() ); model = new LWModel(); #if !DEBUG try #endif { f = new LWFile(final_file_name); f.Push(8); // Root domain only allows reading of first 8 bytes of FORM and length ID form = f.ReadID4(); // FORM f.Len = f.ReadU4(); f.Push(f.Len); // file length-8; File data domain allows reading of rest of the file f.Type = f.ReadID4(); // LWOB, LWLO, LWO2 if (f.Type.value == ID.LWOB) { currentLayer = model.MakeLayer(0, "", 0, Vector3.Zero, -1); } while (f.Left() > 0) /*f.BytesRead() - 8 < f.Len*/ { LAYRchunk(); } } #if !DEBUG catch (System.Exception) { throw; } #endif f.Close(); }