コード例 #1
0
        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;
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        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);
        }