Пример #1
0
        private static VolumeResourceMap ReadResourceMap(byte[] data)
        {
            var map = new VolumeResourceMap();

            int offset = 0;

            // [0][1] = Offset of logdir
            int logOffset = (data[offset + 1] * 0x100) + data[offset];

            offset += 2;

            // [2][3] = Offset of picdir
            int picOffset = (data[offset + 1] * 0x100) + data[offset];

            offset += 2;

            // [4][5] = Offset of viewdir
            int viewOffset = (data[offset + 1] * 0x100) + data[offset];

            offset += 2;

            // [6][7] = Offset of snddir
            int sndOffset = (data[offset + 1] * 0x100) + data[offset];

            offset += 2;

            VolumeDecoder.ReadResourceMap(data, logOffset, picOffset - logOffset, map.LogicResources);
            VolumeDecoder.ReadResourceMap(data, picOffset, viewOffset - picOffset, map.PictureResources);
            VolumeDecoder.ReadResourceMap(data, viewOffset, sndOffset - viewOffset, map.ViewResources);
            VolumeDecoder.ReadResourceMap(data, sndOffset, data.Length - sndOffset, map.SoundResources);

            return(map);
        }
Пример #2
0
 private static void LoadResourceMapFile(byte[] data, VolumeResourceMapEntryCollection resourceMapEntries)
 {
     VolumeDecoder.ReadResourceMap(data, 0, data.Length, resourceMapEntries);
 }