NScumm.Sword1.ResMan.FetchFrame C# (CSharp) Метод

FetchFrame() публичный Метод

public FetchFrame ( byte resourceData, uint frameNo ) : ByteAccess
resourceData byte
frameNo uint
Результат ByteAccess
        public ByteAccess FetchFrame(byte[] resourceData, uint frameNo)
        {
            uint frameFile = 0;
            var idxData = Header.Size;
            if (_isBigEndian)
            {
                if (frameNo >= resourceData.ToUInt32BigEndian(idxData))
                    throw new InvalidOperationException($"fetchFrame:: frame {frameNo} doesn't exist in resource.");
                frameFile += resourceData.ToUInt32BigEndian((int)(idxData + (frameNo + 1) * 4));
            }
            else
            {
                if (frameNo >= resourceData.ToUInt32(idxData))
                    throw new InvalidOperationException($"fetchFrame:: frame {frameNo} doesn't exist in resource.");
                frameFile += resourceData.ToUInt32((int)(idxData + (frameNo + 1) * 4));
            }
            return new ByteAccess(resourceData, (int)frameFile);
        }

Usage Example

Пример #1
0
 private int CharWidth(byte ch)
 {
     if (ch < ' ')
     {
         ch = 64;
     }
     return(_resMan.ReadUInt16(new FrameHeader(_resMan.FetchFrame(_font, (uint)(ch - ' '))).width));
 }
All Usage Examples Of NScumm.Sword1.ResMan::FetchFrame