本文整理汇总了C#中Blamite.IO.FileSegmentGroup类的典型用法代码示例。如果您正苦于以下问题:C# FileSegmentGroup类的具体用法?C# FileSegmentGroup怎么用?C# FileSegmentGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FileSegmentGroup类属于Blamite.IO命名空间,在下文中一共展示了FileSegmentGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ThirdGenLanguageGlobals
public ThirdGenLanguageGlobals(StructureValueCollection values, FileSegmenter segmenter, IPointerConverter localePointerConverter, BuildInformation buildInfo)
{
LocaleArea = new FileSegmentGroup(localePointerConverter);
_languages = LoadLanguages(values, segmenter, buildInfo);
_alignment = buildInfo.SegmentAlignment;
}
示例2: ReflexiveData
public ReflexiveData(string name, uint offset, uint address, uint entrySize, uint pluginLine, FileSegmentGroup metaArea)
: base(name, offset, address, pluginLine)
{
_entrySize = entrySize;
_metaArea = metaArea;
_expanded = true;
}
示例3: WriteReflexive
/// <summary>
/// Writes data to a reflexive, reallocating the original.
/// </summary>
/// <param name="entries">The entries to write.</param>
/// <param name="oldCount">The old count.</param>
/// <param name="oldAddress">The old address.</param>
/// <param name="newCount">The number of entries to write.</param>
/// <param name="layout">The layout of the data to write.</param>
/// <param name="metaArea">The meta area of the cache file.</param>
/// <param name="allocator">The cache file's meta allocator.</param>
/// <param name="stream">The stream to manipulate.</param>
/// <returns>The address of the new reflexive, or 0 if the entry list is empty and the reflexive was freed.</returns>
public static uint WriteReflexive(IEnumerable<StructureValueCollection> entries, int oldCount, uint oldAddress,
int newCount, StructureLayout layout, FileSegmentGroup metaArea, MetaAllocator allocator, IStream stream)
{
if (newCount == 0)
{
// Free the old reflexive and return
if (oldCount > 0 && oldAddress != 0)
allocator.Free(oldAddress, oldCount*layout.Size);
return 0;
}
uint newAddress = oldAddress;
if (newCount != oldCount)
{
// Reallocate the reflexive
int oldSize = oldCount*layout.Size;
int newSize = newCount*layout.Size;
if (oldCount > 0 && oldAddress != 0)
newAddress = allocator.Reallocate(oldAddress, oldSize, newSize, stream);
else
newAddress = allocator.Allocate(newSize, stream);
}
// Write the new values
WriteReflexive(entries.Take(newCount), newAddress, layout, metaArea, stream);
return newAddress;
}
示例4: Load
private void Load(StructureValueCollection values, IReader reader, FileSegmentGroup metaArea,
EngineDescription buildInfo)
{
Name = new StringID(values.GetInteger("name stringid"));
LoadPermutations(values, reader, metaArea, buildInfo);
}
示例5: Load
private void Load(StructureValueCollection values, IReader reader, FileSegmentGroup metaArea, BuildInformation buildInfo)
{
ResourceIndex = new DatumIndex(values.GetInteger("resource datum index"));
LoadRegions(values, reader, metaArea, buildInfo);
LoadSections(values, reader, metaArea, buildInfo);
LoadBoundingBox(values, reader, metaArea, buildInfo);
}
示例6: FourthGenResourceLayoutTable
public FourthGenResourceLayoutTable(ITag playTag, FileSegmentGroup metaArea, MetaAllocator allocator,
EngineDescription buildInfo)
{
_tag = playTag;
_metaArea = metaArea;
_allocator = allocator;
_buildInfo = buildInfo;
}
示例7: ReadObjects
/// <summary>
/// Reads all child objects of this reflexive.
/// </summary>
/// <param name="values">The values read from the parent.</param>
/// <param name="reader">The stream to read from.</param>
/// <param name="metaArea">The meta area of the cache file.</param>
/// <param name="stringIDs">The string ID source for the cache file.</param>
/// <param name="buildInfo">The build info for the cache file.</param>
/// <returns>The objects that were read.</returns>
public ScriptObject[] ReadObjects(StructureValueCollection values, IReader reader, FileSegmentGroup metaArea, StringIDSource stringIDs, BuildInformation buildInfo)
{
int count = (int)values.GetInteger(_countEntryName);
uint address = (uint)values.GetInteger(_addressEntryName);
var layout = buildInfo.GetLayout(_layoutName);
var entries = ReflexiveReader.ReadReflexive(reader, count, address, layout, metaArea);
return entries.Select(e => ReadScriptObject(e, reader, metaArea, stringIDs, buildInfo)).ToArray();
}
示例8: Load
private void Load(StructureValueCollection values, IReader reader, FileSegmentGroup metaArea,
EngineDescription buildInfo)
{
ModelResourceIndex = new DatumIndex(values.GetInteger("model resource datum index"));
LoadSections(values, reader, metaArea, buildInfo);
LoadBoundingBoxes(values, reader, metaArea, buildInfo);
}
示例9: SegmentPointer
private SegmentPointer(FileSegment baseSegment, FileSegmentGroup baseGroup, int baseSegmentDelta)
{
_baseSegment = baseSegment;
_baseGroup = baseGroup;
_baseSegmentDelta = baseSegmentDelta;
_originalBaseSize = baseSegment.Size;
_baseBottomResizes = (baseSegment.ResizeOrigin == SegmentResizeOrigin.Beginning);
}
示例10: ThirdGenLanguage
public ThirdGenLanguage(GameLanguage language, StructureValueCollection values, FileSegmenter segmenter,
FileSegmentGroup localeArea, EngineDescription buildInfo)
{
Language = language;
_pointerLayout = buildInfo.Layouts.GetLayout("locale index table entry");
_encryptionKey = buildInfo.LocaleKey;
_sizeAlign = (_encryptionKey != null) ? AES.BlockSize : 1;
Load(values, segmenter, localeArea);
}
示例11: LoadSoundNames
private void LoadSoundNames(StructureValueCollection values, IReader reader, FileSegmentGroup metaArea, EngineDescription buildInfo)
{
var count = (int)values.GetInteger("number of sound names");
var address = values.GetInteger("sound name table address");
var layout = buildInfo.Layouts.GetLayout("sound names");
var entries = ReflexiveReader.ReadReflexive(reader, count, address, layout, metaArea);
SoundNames = entries.Select(e => new StringID(e.GetInteger("name index"))).ToArray();
}
示例12: Load
private void Load(StructureValueCollection values, IReader reader, FileSegmentGroup metaArea, BuildInformation buildInfo)
{
VertexFormat = (int)values.GetInteger("vertex format");
ExtraElementsPerVertex = (int)values.GetInteger("extra elements per vertex");
ExtraElementsType = (ExtraVertexElementType)values.GetInteger("extra element type");
LoadSubmeshes(values, reader, metaArea, buildInfo);
LoadVertexGroups(values, reader, metaArea, buildInfo, Submeshes);
}
示例13: ThirdGenLanguage
public ThirdGenLanguage(StructureValueCollection values, FileSegmenter segmenter, FileSegmentGroup localeArea, BuildInformation buildInfo)
{
_pointerLayout = buildInfo.GetLayout("locale index table entry");
_encryptionKey = buildInfo.LocaleKey;
_symbols = buildInfo.LocaleSymbols;
_localeArea = localeArea;
_sizeAlign = (_encryptionKey != null) ? AES.BlockSize : 1;
Load(values, segmenter, localeArea);
}
示例14: FourthGenZoneSetTable
public FourthGenZoneSetTable(FourthGenResourceGestalt gestalt, IReader reader, FileSegmentGroup metaArea,
MetaAllocator allocator, EngineDescription buildInfo)
{
_gestalt = gestalt;
_metaArea = metaArea;
_allocator = allocator;
_buildInfo = buildInfo;
Load(reader);
}
示例15: LoadSubmeshes
private void LoadSubmeshes(StructureValueCollection values, IReader reader, FileSegmentGroup metaArea, BuildInformation buildInfo)
{
int count = (int)values.GetInteger("number of submeshes");
uint address = values.GetInteger("submesh table address");
var layout = buildInfo.GetLayout("model submesh");
var entries = ReflexiveReader.ReadReflexive(reader, count, address, layout, metaArea);
Submeshes = (from entry in entries
select new ThirdGenModelSubmesh(entry)).ToArray();
}