Exemple #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;
            }
        }
Exemple #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();
        }
        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);
        }
Exemple #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);
        }