Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        public void Read()
        {
            foreach (var subChunk in SubData.Chunks)
            {
                switch (subChunk.Name)
                {
                case "MOPY":
                    MOPY = new MOPY(subChunk);
                    break;

                case "MOVI":
                    MOVI = new MOVI(subChunk);
                    break;

                case "MOVT":
                    MOVT = new MOVT(subChunk);
                    break;

                case "MONR":
                    MONR = new MONR(subChunk);
                    break;

                case "MODR":
                    MODR = new MODR(subChunk);
                    break;

                case "MLIQ":
                    MLIQ = new MLIQ(subChunk);
                    break;
                }
            }

            Generate();
        }
Ejemplo n.º 3
0
        private MOPY[] ReadMOPYChunk(uint size, BinaryReader bin)
        {
            var numMaterials = size / 2;
            var materials    = new MOPY[numMaterials];

            for (var i = 0; i < numMaterials; i++)
            {
                materials[i] = bin.Read <MOPY>();
            }
            return(materials);
        }
Ejemplo n.º 4
0
        private MOPY[] ReadMOPYChunk(BlizzHeader subchunk, BinaryReader subbin)
        {
            var numMaterials = subchunk.Size / 2;
            //Console.WriteLine(numMaterials + " material infos!");
            var materials = new MOPY[numMaterials];

            for (var i = 0; i < numMaterials; i++)
            {
                materials[i] = subbin.Read <MOPY>();
            }
            return(materials);
        }