/// <summary> Updates the underlying atlas bitmap, fields, and texture. </summary> public void UpdateState(BlockInfo info, Bitmap bmp) { AtlasBitmap = bmp; TileSize = bmp.Width / TilesPerRow; using (FastBitmap fastBmp = new FastBitmap(bmp, true, true)) info.RecalculateSpriteBB(fastBmp); }
/// <summary> Updates the underlying atlas bitmap, fields, and texture. </summary> public void UpdateState( BlockInfo info, Bitmap bmp ) { if( !FastBitmap.CheckFormat( bmp.PixelFormat ) ) { Utils.LogDebug( "Converting terrain atlas to 32bpp image" ); drawer.ConvertTo32Bpp( ref bmp ); } AtlasBitmap = bmp; elementSize = bmp.Width >> 4; using( FastBitmap fastBmp = new FastBitmap( bmp, true, true ) ) info.RecalculateSpriteBB( fastBmp ); }
/// <summary> Updates the underlying atlas bitmap, fields, and texture. </summary> public void UpdateState(BlockInfo info, Bitmap bmp) { if (!Platform.Is32Bpp(bmp)) { Utils.LogDebug("Converting terrain atlas to 32bpp image"); drawer.ConvertTo32Bpp(ref bmp); } AtlasBitmap = bmp; elementSize = bmp.Width / ElementsPerRow; using (FastBitmap fastBmp = new FastBitmap(bmp, true, true)) info.RecalculateSpriteBB(fastBmp); }
/// <summary> Updates the underlying atlas bitmap, fields, and texture. </summary> public void UpdateState(BlockInfo info, Bitmap bmp) { if (!FastBitmap.CheckFormat(bmp.PixelFormat)) { Utils.LogDebug("Converting terrain atlas to 32bpp image"); drawer.ConvertTo32Bpp(ref bmp); } AtlasBitmap = bmp; elementSize = bmp.Width >> 4; using (FastBitmap fastBmp = new FastBitmap(bmp, true, true)) info.RecalculateSpriteBB(fastBmp); }
/// <summary> Updates the underlying atlas bitmap </summary> public void UpdateState() { using (FastBitmap fastBmp = new FastBitmap(AtlasBitmap, true, true)) BlockInfo.RecalculateSpriteBB(fastBmp); }
/// <summary> Updates the underlying atlas bitmap, fields, and texture. </summary> public static void UpdateState(Bitmap bmp) { Atlas = bmp; ElemSize = bmp.Width / TilesPerRow; BlockInfo.RecalculateSpriteBB(); }