TerrainDisplay.MPQ.WMO.WMOGroupParser.ReadMOPY C# (CSharp) Method

ReadMOPY() static private method

static private ReadMOPY ( BinaryReader file, WMOGroup group, uint size ) : void
file System.IO.BinaryReader
group WMOGroup
size uint
return void
        static void ReadMOPY(BinaryReader file, WMOGroup group, uint size)
        {
            group.TriangleCount = size / 2;
            // materials
            /*  0x01 - inside small houses and paths leading indoors
             *  0x02 - ???
             *  0x04 - set on indoor things and ruins
             *  0x08 - ???
             *  0x10 - ???
             *  0x20 - Always set?
             *  0x40 - sometimes set-
             *  0x80 - ??? never set
             *
             */
            group.TriangleMaterials = new MOPY[group.TriangleCount];

            for (var i = 0; i < group.TriangleCount; i++)
            {
                var t = new MOPY
                {
                    Flags = (MOPY.MaterialFlags)file.ReadByte(),
                    MaterialIndex = file.ReadByte()
                };
                group.TriangleMaterials[i] = t;
            }
        }