本文整理汇总了C#中HaloMap.Meta.Meta.ScanMetaItems方法的典型用法代码示例。如果您正苦于以下问题:C# Meta.ScanMetaItems方法的具体用法?C# Meta.ScanMetaItems怎么用?C# Meta.ScanMetaItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HaloMap.Meta.Meta
的用法示例。
在下文中一共展示了Meta.ScanMetaItems方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: loadBSP
/// <summary>
/// The load bsp. The BSP is loaded into memory.
/// </summary>
/// <param name="BSPNum">The bsp num.</param>
/// <remarks></remarks>
private void loadBSP(int BSPId)
{
this.Cursor = Cursors.WaitCursor;
//// Load the BSP viewer
Meta meta = new Meta(map);
meta.TagIndex = BSPId; // load BSP into MemoryStream (MS)
meta.ScanMetaItems(true, false);
BSPModel bsp = new BSPModel(ref meta);
this.Cursor = Cursors.Arrow;
if (bsp.BspNumber != -1)
{
BSPViewer bv = new BSPViewer(bsp, map);
bv.Dispose();
bv = null;
}
meta.Dispose();
GC.Collect();
}
示例2: GetMetaFromTagIndex
/// <summary>
/// The get meta from tag index.
/// </summary>
/// <param name="tag">The tag.</param>
/// <param name="map">The map.</param>
/// <param name="manualScan">The manual scan.</param>
/// <param name="parse">The parse.</param>
/// <returns></returns>
/// <remarks></remarks>
public static Meta GetMetaFromTagIndex(int tag, Map map, bool manualScan, bool parse)
{
map.OpenMap(MapTypes.Internal);
Meta meta = new Meta(map);
meta.TagIndex = tag;
meta.ScanMetaItems(manualScan, parse);
map.CloseMap();
meta.SortItemsByOffset();
return meta;
}
示例3: H2BSPWriteRawDataMetaChunk
/// <summary>
/// The h 2 bsp write raw data meta chunk.
/// </summary>
/// <param name="chunknumber">The chunknumber.</param>
/// <param name="bsp">The bsp.</param>
/// <param name="BSPNum">The bsp num.</param>
/// <remarks></remarks>
public void H2BSPWriteRawDataMetaChunk(int chunknumber, ref BSPModel bsp, int BSPNum)
{
BSPModel.BSPRawDataMetaChunk bspChunk = bsp.BSPRawDataMetaChunks[chunknumber];
int BSPId = map.Functions.ForMeta.FindMetaByID(map.BSP.sbsp[BSPNum].ident);
Meta meta = new Meta(map);
meta.TagIndex = BSPId; // decides which tag to load into MemoryStream (MS)
meta.ScanMetaItems(true, false);
BinaryWriter BW = new BinaryWriter(meta.MS);
BinaryReader BR = new BinaryReader(meta.MS);
int temp = 0;
BW.BaseStream.Position = bsp.BSPRawDataMetaChunksOffset;
BW.Write(bspChunk.VerticeCount);
BW.Write(bspChunk.FaceCount);
BW.BaseStream.Position = bsp.BSPRawDataMetaChunksOffset + 48;
BW.Write(bspChunk.HeaderSize - 8);
BW.BaseStream.Position = bsp.BSPRawDataMetaChunksOffset + 52;
temp = BR.ReadInt32(); // I dunno what this is or what value it is supposed to be! #1232
BW.BaseStream.Position = bsp.BSPRawDataMetaChunksOffset + 52;
BW.Write(temp); // I dunno what this is or what value it is supposed to be!
BW.BaseStream.Position = bsp.BSPRawDataMetaChunksOffset + 56;
BW.Write(bspChunk.RawDataChunkInfo.Length);
BW.Write(bspChunk.rawdatainfooffset + meta.magic + meta.offset);
// SO FAR SO GOOD UP TILL NOW!
// this.RawDataChunkInfo = new RawDataOffsetChunk[tempc];
int tempr = bspChunk.rawdatainfooffset;
for (int x = 0; x < bspChunk.RawDataChunkInfo.Length; x++)
{
// this.RawDataChunkInfo[x] = new RawDataOffsetChunk();
BW.BaseStream.Position = tempr + (x * 16) + 6;
BW.Write((UInt16)bspChunk.RawDataChunkInfo[x].ChunkSize);
BW.Write(bspChunk.RawDataChunkInfo[x].Size);
// I think this may be a safety for a messed up map?
// if (bspChunk.RawDataChunkInfo[x].ChunkSize == bspChunk.RawDataChunkInfo[x].Size) { bspChunk.RawDataChunkInfo[x].ChunkSize = 0; }
BW.Write(bspChunk.RawDataChunkInfo[x].Offset);
}
BW = map.BW;
BW.BaseStream.Position = meta.offset;
BW.Write(meta.MS.GetBuffer(), 0, meta.size);
if (bspChunk.RawDataChunkInfo.Length == 0)
{
return;
}
/*
BW = new BinaryWriter(((RawDataChunk)meta.raw.rawChunks[chunknumber]).MS);
bspChunk.SubMeshInfo = new ModelSubMeshInfo[bspChunk.RawDataChunkInfo[0].ChunkCount];
for (int x = 0; x < bspChunk.RawDataChunkInfo[0].ChunkCount; x++)
{
bspChunk.SubMeshInfo[x] = new ModelSubMeshInfo();
BR.BaseStream.Position = bspChunk.HeaderSize + bspChunk.RawDataChunkInfo[0].Offset + (x * 72) + 4;
bspChunk.SubMeshInfo[x].ShaderNumber = BR.ReadUInt16();
bspChunk.SubMeshInfo[x].IndiceStart = BR.ReadUInt16();
bspChunk.SubMeshInfo[x].IndiceCount = BR.ReadUInt16();
}
BR.BaseStream.Position = 40;
bspChunk.IndiceCount = BR.ReadUInt16();
int indicechunk = 0;
int verticechunk = 0;
int uvchunk = 0;
for (int x = 0; x < RawDataChunkInfo.Length; x++)
{
if (RawDataChunkInfo[x].ChunkSize == 2)
{
indicechunk = x;
break;
}
}
int normalchunk = 0;
for (int x = indicechunk; x < RawDataChunkInfo.Length; x++)
{
if (RawDataChunkInfo[x].ChunkCount == 1)
{
verticechunk = x;
uvchunk = x + 1;
normalchunk = x + 2;
break;
}
}
bspChunk.Indices = new short[bspChunk.RawDataChunkInfo[indicechunk].ChunkCount];
BR.BaseStream.Position = bspChunk.HeaderSize + bspChunk.RawDataChunkInfo[indicechunk].Offset;
//.........这里部分代码省略.........