internal void DownloadTexturePack(string url)
        {
            if (game.DeniedUrls.Has(url))
            {
                return;
            }
            string   path = TextureCache.MakePath(url), etag = null;
            DateTime lastModified = DateTime.MinValue;

            if (File.Exists(path))
            {
                lastModified = TextureCache.GetLastModified(url, path, game.LastModified);
                etag         = TextureCache.GetETag(url, path, game.ETags);
            }

            TexturePack.ExtractCurrent(game, url);
            if (url.Contains(".zip"))
            {
                game.Downloader.AsyncGetData(url, true, "texturePack", lastModified, etag);
            }
            else
            {
                game.Downloader.AsyncGetImage(url, true, "terrain", lastModified, etag);
            }
        }
Exemple #2
0
        static void SetMipmaps(Game g, string v)
        {
            g.Graphics.Mipmaps = SetBool(v, OptionsKey.Mipmaps);

            string url = g.World.TextureUrl;

            // always force a reload from cache
            g.World.TextureUrl = "~`#$_^*()@";
            TexturePack.ExtractCurrent(g, url);
            g.World.TextureUrl = url;
        }
Exemple #3
0
        internal void DownloadTexturePack(string url)
        {
            if (TextureCache.HasDenied(url))
            {
                return;
            }
            string   etag         = null;
            DateTime lastModified = DateTime.MinValue;

            if (TextureCache.HasUrl(url))
            {
                lastModified = TextureCache.GetLastModified(url);
                etag         = TextureCache.GetETag(url);
            }

            TexturePack.ExtractCurrent(game, url);
            game.Downloader.AsyncGetData(url, true, "texturePack", lastModified, etag);
        }
        void DownloadTexturePack(string url)
        {
            if (game.DeniedUrls.HasEntry(url))
            {
                return;
            }
            DateTime lastModified = TextureCache.GetLastModified(url, game.LastModified);
            string   etag         = TextureCache.GetETag(url, game.ETags);

            TexturePack.ExtractCurrent(game, url);
            if (url.Contains(".zip"))
            {
                game.Downloader.AsyncGetData(url, true, "texturePack", lastModified, etag);
            }
            else
            {
                game.Downloader.AsyncGetImage(url, true, "terrain", lastModified, etag);
            }
        }