public BitmapRef GetImage(TextureItem item) { lock (PlaceholderImage) { return(new BitmapRef(PlaceholderImage)); } }
public TextureCollection(List <TexturePackage> packages) { _packages = packages; _items = new Dictionary <string, TextureItem>(); foreach (var item in packages.SelectMany(x => x.Items)) { var k = item.Key.ToLowerInvariant(); if (!_items.ContainsKey(k)) { _items.Add(k, item.Value); } } _recentTextures = new List <TextureItem>(); SelectedTexture = GetDefaultSelection(); Bitmap bmp = new Bitmap(64, 64); for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { bmp.SetPixel(i, j, Color.White); } } LastTextureCollectionID++; LightmapTexture = TextureHelper.Create("__lightmap" + LastTextureCollectionID.ToString(), bmp, 64, 64, TextureFlags.None); bmp.Dispose(); }
public void AddTexture(TextureItem item) { if (Items.ContainsKey(item.Name.ToLowerInvariant())) { return; } Items.Add(item.Name.ToLowerInvariant(), item); }
public static void LoadTextureItem(TextureItem item) { if (item == null || item.Package == null) { return; } item.Package.Provider.LoadTextures(new[] { item }); }
public BitmapRef GetImage(TextureItem item) { foreach (var ss in _streams) { if (ss.HasImage(item)) { return(ss.GetImage(item)); } } return(null); }
public BitmapRef GetImage(TextureItem item) { foreach (var root in item.Package.PackageRoot.Split(';')) { var file = Path.Combine(root, item.Name); if (File.Exists(file)) { return(Parse(file)); } } return(null); }
public BitmapRef GetImage(TextureItem item) { foreach (var root in item.Package.PackageRoot.Split(';')) { string name = item.Name.Substring("sprites/".Length); var file = Path.Combine(root, name); if (File.Exists(file)) { return(Parse(file)); } } return(null); }
public bool HasImage(TextureItem item) { return(item.Flags.HasFlag(TextureFlags.Missing)); }
public BitmapRef GetImage(TextureItem item) { foreach (var ss in _streams) { if (ss.HasImage(item)) return ss.GetImage(item); } return null; }
public bool HasImage(TextureItem item) { return _streams.Any(x => x.HasImage(item)); }
public bool HasImage(TextureItem item) { return(_packages.Any(x => x.Items.ContainsValue(item))); }
public BitmapRef GetImage(TextureItem item) { return(Parse(item.Name)); }