Пример #1
0
        unsafe void DrawAnimationCore(AnimationData data, int texId, int size, byte *temp)
        {
            TerrainAtlas1D atlas  = game.TerrainAtlas1D;
            int            index  = atlas.Get1DIndex(texId);
            int            rowNum = atlas.Get1DRowId(texId);

            animPart.SetData(size, size, size * 4, (IntPtr)temp, false);

            if (data == null)
            {
                if (texId == 30)
                {
                    lavaAnim.Tick((int *)temp, size);
                }
                else if (texId == 14)
                {
                    waterAnim.Tick((int *)temp, size);
                }
            }
            else
            {
                FastBitmap.MovePortion(data.FrameX + data.State * size,
                                       data.FrameY, 0, 0, animsBuffer, animPart, size);
            }
            gfx.UpdateTexturePart(atlas.TexIds[index], 0, rowNum * game.TerrainAtlas.TileSize, animPart, game.Graphics.Mipmaps);
        }
Пример #2
0
        unsafe void DrawAnimationCore(AnimationData data, int texLoc, int size, byte *temp)
        {
            int index_1D = Atlas1D.Get1DIndex(texLoc);
            int rowId_1D = Atlas1D.Get1DRowId(texLoc);

            animPart.SetData(size, size, size * 4, (IntPtr)temp, false);

            if (data == null)
            {
                if (texLoc == 30)
                {
                    lavaAnim.Tick((int *)temp, size);
                }
                else if (texLoc == 14)
                {
                    waterAnim.Tick((int *)temp, size);
                }
            }
            else
            {
                FastBitmap.MovePortion(data.FrameX + data.State * size,
                                       data.FrameY, 0, 0, animsBuffer, animPart, size);
            }

            int dstY = rowId_1D * Atlas2D.TileSize;

            game.Graphics.UpdateTexturePart(Atlas1D.TexIds[index_1D], 0, dstY, animPart, game.Graphics.Mipmaps);
        }