Ejemplo n.º 1
0
        private void LoadObject(DataFileReader reader, MapLayer layer, int x, int y)
        {
            GameObject o = new GameObject();

            o.Graphics.Index  = reader.ReadWord();
            o.Graphics.Color1 = reader.ReadByte();
            o.Graphics.Color2 = reader.ReadByte();
            o.Graphics.Color3 = reader.ReadByte();
            o.Bytes           = reader.ReadBytes();

            layer.SetObject(x, y, o);
        }
Ejemplo n.º 2
0
        public void Load(string filename)
        {
            Clear();

            using (DataFileReader reader = new DataFileReader(filename))
            {
                Name      = reader.ReadString();
                BackColor = reader.ReadByte();
                Bytes     = reader.ReadBytes();

                CommonWidth  = reader.ReadByte();
                CommonHeight = reader.ReadByte();

                int layerCount = reader.ReadByte();
                for (int i = 0; i < layerCount; i++)
                {
                    LoadLayer(reader);
                }
            }
        }