Exemplo n.º 1
0
 public static void InteropReadNodes(Blam.CacheFile cf, int cache_offset,
                                     TagInterface.IBlock hs_nodes)
 {
     cf.InputStream.Seek(cache_offset, System.IO.SeekOrigin.Begin);
     hs_nodes.ReadHeader(cf);
     hs_nodes.Read(cf);
 }
        static IMultilingualUnicodeStringReference AddOrGetReferenceByName(Blam.CacheFile c,
                                                                           IMultilingualUnicodeStringList list, Blam.StringId name)
        {
            // See if a reference already exists for [name]...
            foreach (var sref in list.StringRefs)
            {
                if (sref.Name.Handle == name)
                {
                    return(sref);
                }
            }

            // one doesn't, so add it and return the new block data
            IMultilingualUnicodeStringReference sr = list.NewReference();

            // Initialize name id
            sr.Name.Handle  = name;
            sr.Name.OwnerId = c.TagIndexManager.IndexId;

            // Initialize all the offsets to be invalid
            foreach (var lang_offset in sr.LanguageOffsets)
            {
                lang_offset.Value = -1;
            }

            return(sr);
        }
        void InitializeBspTags(IO.EndianReader s, Blam.CacheFile cache)
        {
            // Seek to the scenario's scenario_structure_bsps_block tag_block field
            s.Seek(items[0].Offset + 1444, System.IO.SeekOrigin.Begin);
            bspTags = new Item[s.ReadInt32()];
            uint sbsp_offset = s.ReadPointer();

            // Seek to the scenario_structure_bsps_block definitions
            s.Seek(sbsp_offset, System.IO.SeekOrigin.Begin);
            DatumIndex    di   = new DatumIndex();
            CacheItemBase item = null;

            // Process each definition's runtime data
            for (int x = 0; x < bspTags.Length; x++)
            {
                s.Seek(28, System.IO.SeekOrigin.Current);
                di.Read(s);
                item       = items[di.Index];
                bspTags[x] = item as CacheItemBase;
                // Seek back to the beginning of the definition so the following stream code works
                s.Seek(-Halo1.Tags.scenario_structure_bsps_block.kSizeOf, System.IO.SeekOrigin.Current);

                // We're actually selectively reading scenario_structure_bsps_block fields here

                // The offset actually points to the bsp header, and the bsp comes after that header
                item.Offset = s.ReadInt32() + Halo1.Tags.scenario_structure_bsps_header.kSizeOf;
                item.Size   = s.ReadInt32();
                cache.BspAddressMasks.Add(s.ReadUInt32() - (uint)item.Offset);                 // won't count the header
                item.BspIndex = bspCount++;
                // Seek to the end of this definition, and thus, the start of the next definition
                s.Seek(20, System.IO.SeekOrigin.Current);
            }
        }
Exemplo n.º 4
0
        internal override bool Reconstruct(Blam.CacheFile c)
        {
            bool result = true;

            if (c.EngineVersion == BlamVersion.Halo2_Alpha)
            {
                return(result);
            }

            // remove 'geometry postprocessed'
            Flags.Value = 0;

            // recreate the section data
            if (SectionData.Count != 1)
            {
                render_model_section_data_block section_data;
                SectionData.Add(out section_data);

                result = section_data.Reconstruct(c, SectionInfo.Value, GeometryBlockInfo.Value);
            }

            GeometryBlockInfo.Value.ClearPostReconstruction();

            return(result);
        }
Exemplo n.º 5
0
        internal protected override Blam.CacheFile LoadCacheFile(BlamVersion game, string file_path, bool is_resource)
        {
            Blam.CacheFile cf = null;

            if ((game & BlamVersion.Halo1) != 0)
            {
                if (is_resource && game.IsPc())                 // hacks 'r us. f*****g data file cache...
                {
                    if (file_path.Contains("bitmaps.map"))
                    {
                        return(new BitmapCacheFile(game, file_path));
                    }
                    else if (file_path.Contains("sounds.map"))
                    {
                        return(new SoundCacheFile(game, file_path));
                    }
                    else if (file_path.Contains("loc.map"))
                    {
                        return(new LocCacheFile(game, file_path));
                    }
                }
                else
                {
                    cf = new Halo1.CacheFile(file_path);
                }
            }

            return(cf);
        }
        public override void ReadFromCache(Blam.CacheFile cf)
        {
            int count = this.Count.Value;

            if (count > 0)
            {
                var  cache         = cf as Cache.CacheFileGen3;
                var  cache_interop = (cache.Header as Cache.CacheHeaderGen3).Interop;
                uint offset;

                #region Read the string references
                offset = GetOffsetReferences(cache_interop);

                cache.InputStream.Seek(offset);
                InitializeStringReferences(count, cache.StringIds.Definition);
                for (int x = 0; x < mStringReferences.Length; x++)
                {
                    mStringReferences[x].Read(cf.InputStream);
                }
                #endregion

                #region Read the string data buffer
                offset = GetOffsetStrings(cache_interop);

                cache.InputStream.Seek(offset);
                mStringData = cache.DecryptCacheSegmentBytes(CacheSectionType.Localization, (int)offset, Size.Value);
                #endregion
            }
        }
Exemplo n.º 7
0
        internal protected override Blam.CacheFile LoadCacheFile(BlamVersion game, string file_path, bool is_resource)
        {
            Blam.CacheFile cf = null;

            if ((game & BlamVersion.Halo2) != 0)
            {
                cf = new Halo2.CacheFile(file_path);
            }

            return(cf);
        }
Exemplo n.º 8
0
        public static void InteropReadTagData(Blam.CacheFile cf,
                                              TagInterface.IBlock hs_scripts, int cache_offset_scripts,
                                              TagInterface.IBlock hs_globals, int cache_offset_globals)
        {
            cf.InputStream.Position = cache_offset_scripts;
            hs_scripts.ReadHeader(cf);
            hs_scripts.Read(cf);

            cf.InputStream.Position = cache_offset_globals;
            hs_globals.ReadHeader(cf);
            hs_globals.Read(cf);
        }
Exemplo n.º 9
0
        internal protected override Blam.CacheFile LoadCacheFile(BlamVersion game, string file_path, bool is_resource)
        {
            Blam.CacheFile cf = null;

            if ((game & BlamVersion.HaloOdst) != 0)
            {
//				if (is_resource)
//					return null;
                /*else*/ cf = new HaloOdst.CacheFile(file_path);
            }

            return(cf);
        }
Exemplo n.º 10
0
        public static void InteropReadStringData(Blam.CacheFile cf, int cache_offset,
                                                 out Util.StringPool strings_pool, byte k_pad_character)
        {
            strings_pool = new Util.StringPool();

            cf.InputStream.Seek(cache_offset, System.IO.SeekOrigin.Begin);
            var hs_strings = new BlamLib.TagInterface.Data();

            hs_strings.ReadHeader(cf);
            if (hs_strings.Size == 0)
            {
                return;
            }
            hs_strings.Read(cf);

            int  offset = 0;
            byte btchar = 0;

            while (true)
            {
                var stringEntry = new System.Text.StringBuilder();
                try
                {
                    do
                    {
                        if (offset < hs_strings.Size)
                        {
                            btchar = hs_strings[offset];

                            if (btchar != 0)
                            {
                                stringEntry.Append((char)btchar);
                            }
                        }

                        offset++;
                    } while ((btchar != 0 && btchar != k_pad_character) && offset < hs_strings.Size);
                }
                catch (IndexOutOfRangeException ex)
                {
                    throw new BlamLib.Debug.ExceptionLog("Offset was outside the bounds of the data array. {0}{1}", BlamLib.Program.NewLine, ex);
                }

                strings_pool.Add(stringEntry.ToString());

                if (btchar == k_pad_character)
                {
                    break;
                }
            }
        }
        public void ReconstructTagData(Blam.CacheFile c,
                                       IMultilingualUnicodeStringList list, int this_lang)
        {
            for (int x = 0, dst_offset = mTagDataOffset, size; x < mReferenceCount; x++, dst_offset += size)
            {
                var dst = list.StringData.Value;

                Blam.StringId name;
                size = mPack.CopyStringReferenceData(mReferenceIndex + x, dst, dst_offset, out name);

                var sref = AddOrGetReferenceByName(c, list, name);
                sref.LanguageOffsets[this_lang].Value = dst_offset;
            }
        }
Exemplo n.º 12
0
        internal override bool Reconstruct(Blam.CacheFile c)
        {
            var rsrc_cache = Program.Halo2.FromLocation(c as Halo2.CacheFile, GetOffset());

            // the shared cache isn't loaded, break
            if (rsrc_cache == null)
            {
                return(false);
            }

            rsrc_cache.InputStream.Seek(GetOffset().Offset);
            Data = rsrc_cache.InputStream.ReadBytes(GetSize());

            return(true);
        }
        protected override void ReadTagInstances(IO.EndianReader s, Blam.CacheFile cache)
        {
            // Read the tag index items
            items = new CacheItem[tagCount];

            for (int x = 0; x < tagCount; x++)
            {
                (items[x] = new CacheItem()).Read(s);
            }

            // Read the tag filename strings
            foreach (CacheItem ci in items)
            {
                ci.ReferenceName = cache.References.AddOptimized(ci.GroupTag, s.ReadCString());
            }
        }
Exemplo n.º 14
0
            internal override bool Reconstruct(Blam.CacheFile c)
            {
                bool result = true;

                if (CacheData.Count != 1)
                {
                    lightmap_vertex_buffer_bucket_cache_data_block cache_data;
                    CacheData.Add(out cache_data);

                    result = cache_data.Reconstruct(c, this, GeometryBlockInfo);
                }

                GeometryBlockInfo.Value.ClearPostReconstruction();

                return(result);
            }
Exemplo n.º 15
0
        /// <summary>
        /// Little hack for <see cref="CacheTagIndex"/>
        /// </summary>
        /// <param name="item"></param>
        /// <param name="cache"></param>
        /// <param name="ignore_group_hack">Hack used for Halo 2/3 where the sound definitions use different group tags</param>
        internal void Read(Blam.CacheIndex.Item item, Blam.CacheFile cache, bool ignore_group_hack)
        {
            Debug.Assert.If(InCache, "Tried to read a cache tag while we were NOT in a cache. {0}:{1}.{2}", engine, Name, tagGroup.Name);
            // HACK: for Halo 2/3 sound groups
            if (!ignore_group_hack && tagGroup.ID != item.GroupTag.ID)
            {
                Debug.Assert.If(false, "Tried to read a cache tag with a non-matching cache tag datum. {0}:{1} [{2} !{3}",
                                engine, Name, tagGroup.TagToString(), item.GroupTag.TagToString());
            }

            cache.InputStream.Seek(item.Offset);

            VersionCtorAttribute upgrade_parameters;
            bool needs_upgrading = false;

            if (cache.EngineVersion.SupportsTagVersioning())
            {
                if ((upgrade_parameters = tagDefinition.VersionForEngine(cache.EngineVersion)) != null)
                {
                    needs_upgrading = true;
                    // It is ASSUMED that the group tag won't ever be needed for version construction
                    tagDefinition = tagDefinition.NewInstance((tagDefinition as IStructureOwner).OwnerObject, upgrade_parameters.Major, upgrade_parameters.Minor);
                    flags.Add(IO.ITagStreamFlags.DefinitionWasUpgraded);
                }
                else
                {
                    needs_upgrading = false;
                }
            }

            tagDefinition.Read(cache);

            if (needs_upgrading)
#if DEBUG
            { if (!tagDefinition.Upgrade())
              {
                  Debug.Assert.If(false, "Failed to upgrade tag group. {0} {1}", tagDefinition.GetType().Name, tagDefinition.ToVersionString());
              }
            }
#else
            { tagDefinition.Upgrade(); }
#endif
        }
Exemplo n.º 16
0
        /* _bump
         * objects\characters - 0xA
         * objects\weapons - 0x6
         * scenarios\objects - 0x4
         * objects - 0xC
         * ui\hud - 0xF
         * ui - 0x10
         * scenarios\skies - 0x11
         * fp_arms - 0x12
         * rasterizer - 0x13
         * scenarios && (lightmap_bitmaps || lightmap_truecolor_bitmaps) - 0x1
         * 0x3
         *
         * 30h
         * 1
         * 5
         * 2
         * 0Fh
         * 3
         * 3
         * 4
         * 20h
         * 5
         * 22h
         * 6
         * 2Eh
         * 7
         * 2Ah
         * 8
         * 19h
         * 9
         * 23h
         * 0Ah
         *
         * 16h
         * 0Bh
         * 1Ch
         * 0Ch
         * 26h
         * 0Dh
         * 23h
         * 0Eh
         * 24h
         * 0Fh
         * 0
         * 10h
         * 0Bh
         * 11h
         * 0Eh
         * 12h
         * 0Ch
         * 13h
         * 0
         */
        #endregion

        internal override bool Reconstruct(Blam.CacheFile c)
        {
            //CompressedColorPlateData.Delete();

            Flags.Remove(1 << 5);             // remove "UNUSED"

            // just checking the sanity...you never know if there will be a silly
            // user building (with unofficial tools!) a cache with an empty bitmap
            if (Bitmaps.Count < 1)
            {
                return(true);
            }

            int tag = Bitmaps[0].OwnerTagIndex;

            string filename = c.GetReferenceName(c.LocateTagByDatum((
                                                                        c.ExtractionState.CurrentTag == DatumIndex.Null ? tag : (int)c.ExtractionState.CurrentTag)));

            using (var ms = new System.IO.MemoryStream())
            {
                byte[] buffer;

                // read all of the bitmap data cache blocks
                for (int x = 0; x < Bitmaps.Count; x++)
                {
                    if ((buffer = Bitmaps[x].CacheRead(c)) == null)
                    {
                        Debug.LogFile.WriteLine("Failed to load bitmap data for '{0}' [{1}]", filename, x);
                    }
                    else
                    {
                        ms.Write(buffer, 0, buffer.Length);
                    }
                }

                // reset the pixel data
                ProcessedPixelData.Reset(ms.ToArray());
                buffer = null;
            }

            return(true);
        }
Exemplo n.º 17
0
            internal bool Reconstruct(Blam.CacheFile c,
                                      global_geometry_section_info_struct section,
                                      geometry_block_info_struct gbi)
            {
                Section.Value.Reconstruct(c, section, gbi);
                PointData.Value.Reconstruct(c, section, gbi);

                int index = 0;

                byte[][] data = gbi.GeometryBlock;

                if (data == null)
                {
                    return(false);
                }

                foreach (geometry_block_resource_block gb in gbi.Resources)
                {
                    using (IO.EndianReader er = new BlamLib.IO.EndianReader(data[index]))
                    {
                        switch (gb.Type.Value)
                        {
                            #region TagBlock
                        case (int)geometry_block_resource_type.TagBlock:
                            int count = gb.GetCount();
                            switch (gb.PrimaryLocater.Value)
                            {
                            case OffsetNodeMap:
                                NodeMap.Resize(count);
                                NodeMap.Read(er);
                                break;
                            }
                            break;
                            #endregion
                        }

                        index++;
                    }
                }

                return(true);
            }
Exemplo n.º 18
0
        bool ReadVertexBufferHack(Blam.CacheFile c,
                                  geometry_block_info_struct gbi)
        {
            var rsrc_cache = Program.Halo2.FromLocation(c as Halo2.CacheFile, gbi.GetBlockOffset());

            // the shared cache isn't loaded, break
            if (rsrc_cache == null)
            {
                return(false);
            }

            // seek to the actual data
            var er = rsrc_cache.InputStream;

            er.Seek(gbi.GetBlockOffset().Offset + 8);

            VertexBuffers.Add();
            VertexBuffers.Read(er);

            return(true);
        }
        public override void ReadFromCache(Blam.CacheFile cf)
        {
            int count = this.Count.Value;

            if (count > 0)
            {
                var cache = cf as Halo2.CacheFile;

                #region Read the string references
                var rsrc_offset = GetOffsetReferences();
                var rsrc_cache  = Program.Halo2.FromLocation(cache, rsrc_offset);

                if (rsrc_cache != null)
                {
                    rsrc_cache.InputStream.Seek(rsrc_offset.Offset);
                    InitializeStringReferences(count, cache.StringIds.Definition);
                    for (int x = 0; x < mStringReferences.Length; x++)
                    {
                        mStringReferences[x].Read(cf.InputStream);
                    }
                }
                #endregion

                #region Read the string data buffer
                rsrc_offset = GetOffsetStrings();
                rsrc_cache  = Program.Halo2.FromLocation(cache, rsrc_offset);

                if (rsrc_cache != null)
                {
                    rsrc_cache.InputStream.Seek(rsrc_offset.Offset);
                    mStringData = rsrc_cache.InputStream.ReadBytes(Size.Value);
                }
                else                 // just in case references was valid but somehow the string data buffer wasn't, can't have one without the other
                {
                    mStringReferences = null;
                }
                #endregion
            }
        }
Exemplo n.º 20
0
        internal override bool Reconstruct(Blam.CacheFile c)
        {
            byte[][] data = null;
            int      x;

            var rsrc_cache = Program.Halo2.FromLocation(c as Halo2.CacheFile, GetBlockOffset());

            // the shared cache isn't loaded, break
            if (rsrc_cache == null)
            {
                return(false);
            }

            data = new byte[Resources.Count][];
            for (x = 0; x < Resources.Count; x++)
            {
                Reconstruct(x, rsrc_cache, out data[x]);
            }

            GeometryBlock = data;

            return(true);
        }
Exemplo n.º 21
0
                internal bool Reconstruct(Blam.CacheFile c,
                                          lightmap_vertex_buffer_bucket_block buffer_bucket,
                                          geometry_block_info_struct gbi)
                {
                    int index = 0;
                    int x;

                    byte[][] data = gbi.GeometryBlock;

                    if (data == null)
                    {
                        return(false);
                    }

                    foreach (geometry_block_resource_block gb in gbi.Resources)
                    {
                        using (IO.EndianReader er = new BlamLib.IO.EndianReader(data[index]))
                        {
                            switch (gb.Type.Value)
                            {
                                #region TagBlock
                            case (int)geometry_block_resource_type.TagBlock:
                                int count = gb.GetCount();
                                switch (gb.PrimaryLocater.Value)
                                {
                                case OffsetVertexBuffers:
                                    VertexBuffers.Resize(count);
                                    VertexBuffers.Read(er);
                                    break;
                                }
                                break;

                                #endregion
                                #region VertexBuffer
                            case (int)geometry_block_resource_type.VertexBuffer:
                                var vb_defs = (c.TagIndexManager as InternalCacheTagIndex).kVertexBuffers;

                                var stream_readers = new Render.VertexBufferInterface.StreamReader[VertexBuffers.Count];
                                for (x = 0; x < VertexBuffers.Count; x++)
                                {
                                    VertexBuffers[x].VertexBuffer.InitializeStreamReader(vb_defs, out stream_readers[x]);
                                }

                                int vertex_count = gb.Size.Value / VertexBuffers[0].VertexBuffer.StrideSize;
                                if (buffer_bucket.RawVertices.Count == 0)
                                {
                                    buffer_bucket.RawVertices.Resize(vertex_count);
                                }
                                for (x = 0; x < vertex_count; x++)
                                {
                                    buffer_bucket.RawVertices[x].Reconstruct(buffer_bucket, gb,
                                                                             er, stream_readers);
                                }
                                break;
                                #endregion
                            }
                        }

                        index++;
                    }

                    VertexBuffers.DeleteAll();

                    return(true);
                }
 public abstract void ReadFromCache(Blam.CacheFile cf);
Exemplo n.º 23
0
		/// <summary>
		/// Create a new tag index
		/// </summary>
		/// <param name="cache_file">cache file this tag index is managing</param>
		internal CacheTagIndex(Blam.CacheFile cache_file) : base()
		{
			cacheFile = cache_file;

			base.ArrayInitialize(kDefaultArrayName);
		}
Exemplo n.º 24
0
 internal bool Reconstruct(Blam.CacheFile c,
                           global_geometry_section_info_struct section_info,
                           geometry_block_info_struct gbi)
 {
     return(Geometry.Value.Reconstruct(c, section_info, gbi));
 }
Exemplo n.º 25
0
        bool ReconstructRawPcaData(Blam.CacheFile c,
                                   geometry_block_info_struct gbi)
        {
            int index = 0;
            int x;

            byte[][] data = gbi.GeometryBlock;

            if (data == null)
            {
                return(false);
            }

            foreach (geometry_block_resource_block gb in gbi.Resources)
            {
                using (IO.EndianReader er = new BlamLib.IO.EndianReader(data[index]))
                {
                    switch (gb.Type.Value)
                    {
                        #region TagBlock
                    case (int)geometry_block_resource_type.TagBlock:
                        int count = gb.GetCount();
                        switch (gb.PrimaryLocater.Value)
                        {
                        case OffsetVertexBuffers:
                            VertexBuffers.Resize(count);
                            VertexBuffers.Read(er);
                            break;
                        }
                        break;

                        #endregion
                        #region VertexBuffer
                    case (int)geometry_block_resource_type.VertexBuffer:
                        var vb_defs = (c.TagIndexManager as InternalCacheTagIndex).kVertexBuffers;

                        // HACK: Figure out why we PRT stores the vertex buffer in the geometry block info's
                        // "section data" and not in a tag block resource
                        if (VertexBuffers.Count == 0 && !ReadVertexBufferHack(c, gbi))
                        {
                            break;
                        }

                        var stream_readers = new Render.VertexBufferInterface.StreamReader[VertexBuffers.Count];
                        for (x = 0; x < VertexBuffers.Count; x++)
                        {
                            VertexBuffers[x].VertexBuffer.InitializeStreamReader(vb_defs, out stream_readers[x]);
                        }

                        int vertex_count = gb.Size.Value / VertexBuffers[0].VertexBuffer.StrideSize;
                        if (RawPcaData.Count == 0)
                        {
                            RawPcaData.Resize(vertex_count * 5);                                     // 5x as there are 5 fields in the Pca data
                        }
                        for (x = 0; x < vertex_count; x++)
                        {
                            ReconstructRawPcaData(x, gb, er, stream_readers);
                        }
                        break;
                        #endregion
                    }
                }
                index++;
            }

            VertexBuffers.DeleteAll();

            return(true);
        }
        /// <summary>
        /// Create a new tag index
        /// </summary>
        /// <param name="cache_file">cache file this tag index is managing</param>
        internal CacheTagIndex(Blam.CacheFile cache_file) : base()
        {
            cacheFile = cache_file;

            base.ArrayInitialize(kDefaultArrayName);
        }
 protected abstract void ReadTagInstances(IO.EndianReader s, Blam.CacheFile cache);
Exemplo n.º 28
0
        /// <summary></summary>
        /// <param name="c"></param>
        /// <param name="section_info">Can be null if tag data doesn't have it</param>
        /// <param name="gbi"></param>
        /// <returns></returns>
        internal bool Reconstruct(Blam.CacheFile c,
                                  global_geometry_section_info_struct section_info,
                                  geometry_block_info_struct gbi)
        {
            int index = 0;
            int x;

            byte[][] data = gbi.GeometryBlock;

            if (data == null)
            {
                return(false);
            }

            foreach (geometry_block_resource_block gb in gbi.Resources)
            {
                using (IO.EndianReader er = new BlamLib.IO.EndianReader(data[index]))
                {
                    switch (gb.Type.Value)
                    {
                        #region TagBlock
                    case (int)geometry_block_resource_type.TagBlock:
                        int count = gb.GetCount();
                        switch (gb.PrimaryLocater.Value)
                        {
                        case OffsetParts:
                            Parts.Resize(count);
                            Parts.Read(er);
                            break;

                        case OffsetSubparts:
                            Subparts.Resize(count);
                            Subparts.Read(er);
                            break;

                        case OffsetVisibilityBounds:
                            VisibilityBounds.Resize(count);
                            VisibilityBounds.Read(er);
                            break;

                        case OffsetStripIndices:
                            StripIndices.Resize(count);
                            StripIndices.Read(er);
                            break;

                        case OffsetMoppReorderTable:
                            MoppReorderTable.Resize(count);
                            MoppReorderTable.Read(er);
                            break;

                        case OffsetVertexBuffers:
                            VertexBuffers.Resize(count);
                            VertexBuffers.Read(er);
                            break;
                        }
                        break;

                        #endregion
                        #region TagData
                    case (int)geometry_block_resource_type.TagData:
                        switch (gb.PrimaryLocater.Value)
                        {
                        case OffsetVisibilityMoppCode:
                            VisibilityMoppCode.Reset(er.ReadBytes(gb.Size));
                            break;
                        }
                        break;

                        #endregion
                        #region VertexBuffer
                    case (int)geometry_block_resource_type.VertexBuffer:
                        var vb_defs = (c.TagIndexManager as InternalCacheTagIndex).kVertexBuffers;

                        var stream_readers = new Render.VertexBufferInterface.StreamReader[VertexBuffers.Count];
                        for (x = 0; x < VertexBuffers.Count; x++)
                        {
                            VertexBuffers[x].VertexBuffer.InitializeStreamReader(vb_defs, out stream_readers[x]);
                        }

                        if (RawVertices.Count == 0)
                        {
                            int vertex_count = section_info != null ?
                                               section_info.TotalVertexCount :
                                               gb.Size.Value / VertexBuffers[0].VertexBuffer.StrideSize;

                            RawVertices.Resize(vertex_count);
                        }

                        for (x = 0; x < RawVertices.Count; x++)
                        {
                            RawVertices[x].Reconstruct(section_info, gb,
                                                       er, stream_readers);
                        }
                        break;
                        #endregion
                    }
                }

                index++;
            }

            VertexBuffers.DeleteAll();

            return(true);
        }
Exemplo n.º 29
0
 public InternalCacheTagIndex(Blam.CacheFile cf) : base(cf)
 {
 }