public int[] stRAMPointers = new int[0], stROMPointers = new int[0]; //Addresses in RAM / ROM that shall point to the 0xF2 command public TextureInfo(string name) { if (name == null) { isCustom = true; UpdateCustom(); } else { image = TextureImage.GetImageByName(name, this); UpdateSizeInfo(); } customAddress = 0x07000000; }
public void Remove(TextureImage image) { string key = null; foreach (KeyValuePair <string, TextureImage> a in textures) { if (a.Value == image) { key = a.Key; break; } } if (key != null) { textures.Remove(key); } }
public static TextureImage GetImageByName(string name, TextureInfo user) { TextureImage existing; if (Main.instance.textureLibrary.textures.TryGetValue(name, out existing)) { existing.AddUser(user); return(existing); } if (!System.IO.File.Exists(name)) { return(new TextureImage(new Bitmap(1, 1), user)); } Bitmap source = (Bitmap)Bitmap.FromFile(name); TextureImage clone = new TextureImage(new Bitmap(source), user); source.Dispose(); Main.instance.textureLibrary.textures.Add(name, clone); return(clone); }