Exemplo n.º 1
0
Arquivo: GFX.cs Projeto: biosp4rk/mzmr
        public void AddGfx(Gfx srcGfx, int x, int y)
        {
            int dstByteWidth = Width * 0x20;
            int dstIndex     = (y * dstByteWidth) + (x * 0x20);

            byte[] srcData      = srcGfx.Data;
            int    srcByteWidth = srcGfx.Width * 0x20;
            int    srcHeight    = srcData.Length / srcByteWidth;
            int    srcIndex     = 0;

            for (int j = 0; j < srcHeight; j++)
            {
                Array.Copy(srcData, srcIndex, Data, dstIndex, srcByteWidth);
                dstIndex += dstByteWidth;
                srcIndex += srcByteWidth;
            }
        }
Exemplo n.º 2
0
Arquivo: GFX.cs Projeto: biosp4rk/mzmr
        public void AddGfx(Gfx srcGfx, Rectangle srcRect, int x, int y)
        {
            int dstByteWidth = Width * 0x20;
            int dstIndex     = (y * dstByteWidth) + (x * 0x20);

            byte[] srcData      = srcGfx.Data;
            int    srcByteWidth = srcGfx.Width * 0x20;
            int    srcHeight    = srcRect.Height;
            int    copyLen      = srcRect.Width * 0x20;
            int    srcIndex     = (srcRect.Y * srcByteWidth) + (srcRect.X * 0x20);

            for (int j = 0; j < srcHeight; j++)
            {
                Array.Copy(srcData, srcIndex, Data, dstIndex, copyLen);
                dstIndex += dstByteWidth;
                srcIndex += srcByteWidth;
            }
        }