예제 #1
0
 public void RegisterTextures(params string[] texNames)
 {
     for (int i = 0; i < texNames.Length; i++)
     {
         CachedTexture texture = new CachedTexture();
         texture.Name = texNames[i];
         Textures.Add(texture);
     }
 }
예제 #2
0
        void TextureChanged(object sender, TextureEventArgs e)
        {
            for (int i = 0; i < Textures.Count; i++)
            {
                CachedTexture tex = Textures[i];
                if (tex.Name != e.Name)
                {
                    continue;
                }

                game.UpdateTexture(ref tex.TexID, e.Name, e.Data, e.Name == "char.png");
                Textures[i] = tex; break;
            }
        }
예제 #3
0
        public void Dispose()
        {
            for (int i = 0; i < Textures.Count; i++)
            {
                CachedTexture tex = Textures[i];
                gfx.DeleteTexture(ref tex.TexID);
                Textures[i] = tex;
            }
            ContextLost();

            game.Events.TextureChanged     -= TextureChanged;
            game.Graphics.ContextLost      -= ContextLost;
            game.Graphics.ContextRecreated -= ContextRecreated;
        }
예제 #4
0
        void TextureChanged(string name, byte[] data)
        {
            for (int i = 0; i < Textures.Count; i++)
            {
                CachedTexture tex = Textures[i];
                if (!Utils.CaselessEq(tex.Name, name))
                {
                    continue;
                }

                game.UpdateTexture(ref tex.TexID, name, data, ref tex.SkinType);
                Textures[i] = tex;
                break;
            }
        }
예제 #5
0
        void TextureChanged(object sender, TextureEventArgs e)
        {
            for (int i = 0; i < Textures.Count; i++)
            {
                CachedTexture tex = Textures[i];
                if (!Utils.CaselessEq(tex.Name, e.Name))
                {
                    continue;
                }

                game.UpdateTexture(ref tex.TexID, e.Name, e.Data, ref tex.SkinType);
                Textures[i] = tex;
                break;
            }
        }
        public void Dispose()
        {
            game.Events.TextureChanged -= TextureChanged;
            for (int i = 0; i < Models.Count; i++)
            {
                Models[i].Instance.Dispose();
            }

            for (int i = 0; i < Textures.Count; i++)
            {
                CachedTexture tex = Textures[i];
                api.DeleteTexture(ref tex.TexID);
                Textures[i] = tex;
            }
            api.DeleteDynamicVb(ref vb);
        }