FreakySources.Code.AsciimationDataGenerator.BytesToFrame C# (CSharp) 메소드

BytesToFrame() 정적인 개인적인 메소드

static private BytesToFrame ( byte frame ) : ].char[
frame byte
리턴 ].char[
        static char[,] BytesToFrame(byte[] frame)
        {
            var result = new char[FrameHeight, FrameWidth];
            int x = 0, y = 0, i = 0, tail;
            while (i < frame.Length)
            {
                var c = (char)frame[i];
                if (c != '\n')
                    result[y, x++] = c;
                if (c == '\n' || x == FrameWidth)
                {
                    tail = FrameWidth - x;
                    while (tail-- > 0)
                        result[y, x++] = ' ';
                    y++;
                    x = 0;
                }
                i++;
            }
            return result;
        }