示例#1
0
文件: Frame.cs 项目: Uhha/Fo2
        public Frame(FrameDirecion parent, int previousFrame, int width, int height, int offsetX, int offsetY, int widthSpr, int heightSpr, byte[] bytes, int pixelDataSize, int startingPoint) 
        {
            _parent = parent;
            _previousFrame = previousFrame;
            _width = width;
            _hight = height;
            _offsetX = offsetX;
            _offsetY = offsetY;
            _widthSpr = widthSpr;
            _heightSpr = heightSpr;

            byte[] textureArray = new byte[pixelDataSize * 4];
            for (int i = 0; i < textureArray.Length; i++,startingPoint++)
            {
                HelperFuncts.GetPalleteColor(bytes[startingPoint], out textureArray[i], out textureArray[++i], out textureArray[++i], out textureArray[++i]);
            }
            _texture = new Texture2D(HelperFuncts.GraphicsDevicePointer, _width, _hight);
            _texture.SetData<byte>(textureArray);
            
        }
示例#2
0
文件: FRM.cs 项目: Uhha/Fo2
 private void InitializeDirections(int numberOfFrames, byte[] bytes)
 {
     int directionOffset = -1;
     _directions[0] = new FrameDirecion(this, numberOfFrames, 0);
     _numberOfDirections++;
     int bytePos = 38;
     for (int i = 1; i < 6; i++)
     {
         directionOffset = HelperFuncts.SumTwoBytes(bytes[bytePos], bytes[++bytePos], bytes[++bytePos], bytes[++bytePos]);
         if (directionOffset > 0)
         {
             _directions[i] = new FrameDirecion(this, numberOfFrames, directionOffset);
             _numberOfDirections++;
         }
         bytePos++;
     }
 }