コード例 #1
0
        internal static W3dSoundRObj Parse(BinaryReader reader, W3dParseContext context)
        {
            return(ParseChunk(reader, context, header =>
            {
                var result = new W3dSoundRObj();

                ParseChunks(reader, context.CurrentEndPosition, chunkType =>
                {
                    switch (chunkType)
                    {
                    case W3dChunkType.W3D_CHUNK_SOUNDROBJ_HEADER:
                        result.Header = W3dSoundRObjHeader.Parse(reader, context);
                        break;

                    case W3dChunkType.W3D_CHUNK_SOUNDROBJ_DEFINITION:
                        result.Definition = W3dSoundRObjDefinition.Parse(reader, context);
                        break;

                    default:
                        throw CreateUnknownChunkException(chunkType);
                    }
                });

                return result;
            }));
        }
コード例 #2
0
        internal static W3dSoundRObjDefinition Parse(BinaryReader reader, W3dParseContext context)
        {
            return(ParseChunk(reader, context, header =>
            {
                var result = new W3dSoundRObjDefinition
                {
                    UnknownBytes = reader.ReadBytes((int)context.CurrentEndPosition - (int)reader.BaseStream.Position)
                };

                // TODO: Determine W3dSoundRObjDefinition Chunk Structure (Currently Unknown)

                /*
                 * var chunkA = reader.ReadUInt32() >> 8;
                 * var chunkASize = reader.ReadUInt32();
                 * var chunkAArray = reader.ReadBytes((int) chunkASize);
                 *
                 * var Flag2 = reader.ReadUInt32() >> 8;
                 * var tmp = reader.ReadBytes(4); // unknown
                 *
                 * var chunkB = reader.ReadUInt32() >> 8;
                 * var chunkBSize = reader.ReadUInt32();
                 * var chunkBArray = reader.ReadBytes((int) chunkBSize);
                 */

                return result;
            }));
        }