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

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

public FetchRes ( uint id ) : byte[]
id uint
Результат byte[]
        public byte[] FetchRes(uint id)
        {
            MemHandle memHandle = ResHandle(id);
            if (memHandle == null)
            {
                // TODO:warning("fetchRes:: resource %d out of bounds", id);
                return null;
            }
            if (memHandle.data == null)
                throw new InvalidOperationException($"fetchRes:: resource {id} is not open");
            return memHandle.data;
        }

Usage Example

Пример #1
0
 public ControlButton(ushort x, ushort y, uint resId, ButtonIds id, byte flag, ResMan pResMan, byte[] screenBuf,
     ISystem system)
 {
     _x = x;
     _y = y;
     _id = id;
     _flag = flag;
     _resId = resId;
     _resMan = pResMan;
     _frameIdx = 0;
     _resMan.ResOpen(_resId);
     FrameHeader tmp = new FrameHeader(_resMan.FetchFrame(_resMan.FetchRes(_resId), 0));
     _width = _resMan.ReadUInt16(tmp.width);
     _width = (ushort)((_width > Screen.SCREEN_WIDTH) ? Screen.SCREEN_WIDTH : _width);
     _height = _resMan.ReadUInt16(tmp.height);
     if ((x == 0) && (y == 0))
     { // center the frame (used for panels);
         _x = (ushort)((((640 - _width) / 2) < 0) ? 0 : ((640 - _width) / 2));
         _y = (ushort)((((480 - _height) / 2) < 0) ? 0 : ((480 - _height) / 2));
     }
     _dstBuf = new ByteAccess(screenBuf, _y * Screen.SCREEN_WIDTH + _x);
     _system = system;
 }
All Usage Examples Of NScumm.Sword1.ResMan::FetchRes