示例#1
0
        void TextureChangedCore(object sender, TextureEventArgs e)
        {
            byte[] data = e.Data;
            if (e.Name == "terrain.png")
            {
                MemoryStream stream = new MemoryStream(data);
                Bitmap       atlas  = Platform.ReadBmp(stream);
                if (ChangeTerrainAtlas(atlas, null))
                {
                    return;
                }
                atlas.Dispose();
            }
            else if (e.Name == "cloud.png" || e.Name == "clouds.png")
            {
                UpdateTexture(ref CloudsTex, e.Name, data, false);
            }
            else if (e.Name == "default.png")
            {
                MemoryStream stream = new MemoryStream(data);
                Bitmap       bmp    = Platform.ReadBmp(stream);
                if (!Platform.Is32Bpp(bmp))
                {
                    Drawer2D.ConvertTo32Bpp(ref bmp);
                }

                Drawer2D.SetFontBitmap(bmp);
                Events.RaiseChatFontChanged();
            }
        }
示例#2
0
 void TextureChangedCore(object sender, TextureEventArgs e)
 {
     if (Utils.CaselessEq(e.Name, "terrain.png"))
     {
         Bitmap atlas = Platform.ReadBmp(Drawer2D, e.Data);
         if (ChangeTerrainAtlas(atlas))
         {
             return;
         }
         atlas.Dispose();
     }
     else if (Utils.CaselessEq(e.Name, "default.png"))
     {
         Bitmap bmp = Platform.ReadBmp(Drawer2D, e.Data);
         Drawer2D.SetFontBitmap(bmp);
         Events.RaiseChatFontChanged();
     }
 }
示例#3
0
 void TextureChangedCore(string name, byte[] data)
 {
     if (Utils.CaselessEq(name, "terrain.png"))
     {
         Bitmap atlas = Platform.ReadBmp(Drawer2D, data);
         if (ChangeTerrainAtlas(atlas))
         {
             return;
         }
         atlas.Dispose();
     }
     else if (Utils.CaselessEq(name, "default.png"))
     {
         Bitmap bmp = Platform.ReadBmp(Drawer2D, data);
         Drawer2D.SetFontBitmap(bmp);
         Events.RaiseChatFontChanged();
     }
 }
示例#4
0
 void TextureChangedCore(object sender, TextureEventArgs e)
 {
     byte[] data = e.Data;
     if (e.Name == "terrain.png")
     {
         Bitmap atlas = Platform.ReadBmp32Bpp(Drawer2D, data);
         if (ChangeTerrainAtlas(atlas))
         {
             return;
         }
         atlas.Dispose();
     }
     else if (e.Name == "cloud.png" || e.Name == "clouds.png")
     {
         UpdateTexture(ref CloudsTex, e.Name, data, false);
     }
     else if (e.Name == "default.png")
     {
         Bitmap bmp = Platform.ReadBmp32Bpp(Drawer2D, data);
         Drawer2D.SetFontBitmap(bmp);
         Events.RaiseChatFontChanged();
     }
 }