コード例 #1
0
 /// <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);
 }
コード例 #2
0
        /// <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 );
        }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
        /// <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);
        }
コード例 #5
0
 /// <summary> Updates the underlying atlas bitmap </summary>
 public void UpdateState()
 {
     using (FastBitmap fastBmp = new FastBitmap(AtlasBitmap, true, true))
         BlockInfo.RecalculateSpriteBB(fastBmp);
 }
コード例 #6
0
 /// <summary> Updates the underlying atlas bitmap, fields, and texture. </summary>
 public static void UpdateState(Bitmap bmp)
 {
     Atlas    = bmp;
     ElemSize = bmp.Width / TilesPerRow;
     BlockInfo.RecalculateSpriteBB();
 }