本文整理汇总了C#中BlamLib类的典型用法代码示例。如果您正苦于以下问题:C# BlamLib类的具体用法?C# BlamLib怎么用?C# BlamLib使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BlamLib类属于命名空间,在下文中一共展示了BlamLib类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Reconstruct
internal override bool Reconstruct(BlamLib.Blam.CacheFile c)
{
//int index = BitmapGroup.Value & 0xFFFF;
//if (index != -1) System.Diagnostics.Debug.WriteLine(string.Format(
// "BitmapGroup: {0} {1}", index, c.Index.Tags[index].FileName));
return true;
}
示例2: ProcessDefinition
protected override void ProcessDefinition(XmlNode node, BlamLib.CheApe.ProjectState state, BlamLib.IO.XmlStream s)
{
StringIdFieldsInitialize(state);
switch (node.Name)
{
#region Tag Structs
case "structs":
s.SaveCursor(node);
ProcessTagStructs(state, s);
s.RestoreCursor();
break;
#endregion
#region Tag Blocks
case "blocks":
s.SaveCursor(node);
ProcessTagBlocks(state, s);
s.RestoreCursor();
break;
#endregion
#region Tag Groups
case "groups":
s.SaveCursor(node);
ProcessTagGroups(state, s);
s.RestoreCursor();
break;
#endregion
}
}
示例3: Write
public void Write(BlamLib.IO.EndianWriter s)
{
if(nullBuffer == null)
nullBuffer = new byte[ByteCount];
s.Write(nullBuffer);
}
示例4: InitializeStateForTagHierarchy
/// <summary>Initialize state for processing a tag hierarchy</summary>
/// <param name="args"></param>
/// <param name="instance"></param>
public void InitializeStateForTagHierarchy(BlamLib.Blam.CacheExtractionArguments args, BlamLib.Blam.CacheIndex.Item instance)
{
m_sender = TagExtractionSender.TagTree;
Arguments = args;
Instance = instance;
}
示例5: Read
public override void Read(BlamLib.IO.EndianReader s)
{
Blam.CacheFile.ValidateHeader(s, 0x800);
s.Seek(4);
version = s.ReadInt32();
if (version != 5) throw new InvalidCacheFileException(s.FileName);
fileLength = s.ReadInt32();
int xbox = s.ReadInt32(); // Xbox only field
offsetToIndex = s.ReadInt32();
s.ReadInt32(); // stream size
s.ReadInt32(); s.ReadInt32();
name = s.ReadTagString();
build = s.ReadTagString(); // Xbox only field. Always '400'
cacheType = (CacheType)s.ReadInt16();
s.ReadInt16();
s.ReadInt32(); // CRC
s.Seek((485 * sizeof(int)) + sizeof(uint), System.IO.SeekOrigin.Current);
CacheFile cf = s.Owner as CacheFile;
if (xbox != 0)
cf.EngineVersion = BlamVersion.Stubbs_Xbox;
else // no way to tell when it's mac, which just seems to use PC maps anyway (byte swaps everything when map is loaded)
cf.EngineVersion = BlamVersion.Stubbs_PC;
}
示例6: CheApe
public CheApe(BlamLib.BlamVersion engine)
{
InitializeComponent();
MainMenu.Renderer = MainForm.kOpenSauceIDEToolStripRenderer;
FileViewMenu.Renderer = MainForm.kOpenSauceIDEToolStripRenderer;
SetState(false);
#region FileViewRoot
this.FileViewRoot = new System.Windows.Forms.TreeNode("Project Files");
FileViewRoot.ContextMenuStrip = this.FileViewMenu;
FileViewRoot.Name = "FileViewRoot";
this.FileView.Nodes.Add(FileViewRoot);
#endregion
OpenDialog.DefaultExt = kFileExt;
OpenDialog.Filter = kFileFilter;
SaveDialog.DefaultExt = kFileExt;
SaveDialog.Filter = kFileFilter;
OpenProjDialog.Multiselect = false;
OpenProjDialog.Filter = BlamLib.IO.TagGroups.CheApeProject.Filter;
SaveProjDialog.Filter = BlamLib.IO.TagGroups.CheApeProject.Filter;
ProjectInterface = BlamLib.CheApe.Project.GetInterface(engine);
}
示例7: Read
public override void Read(BlamLib.IO.EndianReader s)
{
Blam.CacheFile.ValidateHeader(s, 0x800);
s.Seek(4);
s.ReadInt32(); // version, should be 5
fileLength = s.ReadInt32();
int xbox = s.ReadInt32(); // Xbox only field
offsetToIndex = s.ReadInt32();
s.ReadInt32(); // stream size
s.ReadInt32(); s.ReadInt32();
name = s.ReadTagString();
build = s.ReadTagString(); // Xbox only field. Always '400'
cacheType = (CacheType)s.ReadInt32();
s.ReadInt32(); // CRC
s.Seek((485 * sizeof(int)) + sizeof(uint), System.IO.SeekOrigin.Current);
CacheFile cf = s.Owner as CacheFile;
if (xbox != 0) cf.EngineVersion = BlamVersion.Stubbs_Xbox;
else cf.EngineVersion = BlamVersion.Stubbs_PC; // no way to tell when its mac...
}
示例8: InitializeStateForTagInstance
/// <summary>Initialize state for processing a single tag</summary>
/// <param name="instance"></param>
/// <param name="base_dir"></param>
/// <param name="name_override"></param>
public void InitializeStateForTagInstance(BlamLib.Blam.CacheIndex.Item instance, string base_dir, string name_override)
{
m_sender = TagExtractionSender.TagInstance;
Instance = instance;
BaseDirectory = base_dir;
NameOverride = name_override;
}
示例9: StringIdFieldsInitialize
void StringIdFieldsInitialize(BlamLib.CheApe.ProjectState state)
{
if (StringIdFieldDefinition != null) return;
// Will add itself to the import state in the ctor
StringIdFieldDefinition = new TagReference(state, kStringIdFieldDefinitionName, true, kStringIdGroupTag);
StringIdFieldHandlePadding = new Field(state, state.kTypeIndexPad, "", kStringIdPadSize.ToString());
}
示例10: GetShaderData
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary> Gets the shader data from the tag. </summary>
///
/// <param name="tagIndex"> The parent tag index. </param>
/// <param name="tagManager"> The tags' manager. </param>
///
/// <returns> The shader data. </returns>
private ModelShaderData GetShaderData(TagIndexBase tagIndex, BlamLib.Managers.TagManager tagManager)
{
var data = new ModelShaderData();
data.CollectData(tagIndex, tagManager);
return data;
}
示例11: Reconstruct
internal override bool Reconstruct(BlamLib.Blam.CacheFile c)
{
//PredictedResources.DeleteAll();
//EditorScenarioData.Delete();
LevelData.DeleteAll();
//SharedReferences.DeleteAll();
//SimulationDefinitionTable.DeleteAll();
return true;
}
示例12: CacheRead
internal byte[] CacheRead(BlamLib.Blam.CacheFile c)
{
// read the cache block...
byte[] bytes;
if (!CacheRead(c, out bytes)) return null;
if (c.EngineVersion == BlamVersion.Halo2_PC) // ...and perform zlib decompression
bytes = Util.ZLibBufferFromBytes(bytes, 0, GetPixelDataSize(c.EngineVersion));
return bytes;
}
示例13: CalculateSize
int CalculateSize(BlamLib.CheApe.ProjectState state, Field f)
{
int size = 0;
if (f.TypeIndex == state.kTypeIndexPad || f.TypeIndex == state.kTypeIndexSkip)
size = f.ToInt();
else
size = state.GetFieldSize(f.TypeIndex);
return size;
}
示例14: CalculateSize
int CalculateSize(BlamLib.CheApe.ProjectState state, Field f, int kUselessPadTypeIndex)
{
if (f.TypeIndex == state.kTypeIndexPad ||
f.TypeIndex == kUselessPadTypeIndex ||
f.TypeIndex == state.kTypeIndexSkip)
return f.ToInt();
//else if (f.TypeIndex == kStructTypeIndex)
// ((Struct)state.ImportedBlocks[f.ToString()]).Block.Latest.CalculateSize();
else
return state.GetFieldSize(f.TypeIndex);
}
示例15: GetScenarioData
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary> Gets the scenario data from the tag. </summary>
///
/// <param name="tagIndex"> Zero-based index of the tag. </param>
/// <param name="tagManager"> The tag's manager. </param>
///
/// <returns> The scenario data. </returns>
private ScenarioData GetScenarioData(TagIndexBase tagIndex, BlamLib.Managers.TagManager tagManager)
{
var data = new ScenarioData();
data.MessageSent += MessageRedirect;
data.CollectData(tagIndex, tagManager);
data.MessageSent -= MessageRedirect;
return data;
}