Esempio n. 1
0
        public MimGLTextureReader(MimFileReader mim, MapFileReader map, bool accessorsOwner)
        {
            try
            {
                _mim            = Exceptions.CheckArgumentNull(mim, "mim");
                _map            = Exceptions.CheckArgumentNull(map, "map");
                _accessorsOwner = accessorsOwner;

                if (_map.LayersCount != 1)
                {
                    throw new ArgumentException("map");
                }
            }
            catch
            {
                Dispose();
                throw;
            }
        }
Esempio n. 2
0
        public bool GetBackgroundReader(Location location)
        {
            ArchiveFileEntry mapEntry = (ArchiveFileEntry)_locationDirectory.Childs.TryGetValue(_name + ".map");
            ArchiveFileEntry mimEntry = (ArchiveFileEntry)_locationDirectory.Childs.TryGetValue(_name + ".mim");

            if (mapEntry == null || mimEntry == null)
            {
                return(true);
            }

            MimFileReader mimReader = new MimFileReader(mimEntry.OpenReadableContentStream());
            MapFileReader mapReader = new MapFileReader(mapEntry.OpenReadableContentStream());

            location.BackgroundReader = new MimGLTextureReader(mimReader, mapReader, true);

            location.SaveRequest &= ~LocationProperty.Background;
            location.Importable  &= ~LocationProperty.Background;
            return(true);
        }