本文整理汇总了C#中BlamVersion类的典型用法代码示例。如果您正苦于以下问题:C# BlamVersion类的具体用法?C# BlamVersion怎么用?C# BlamVersion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BlamVersion类属于命名空间,在下文中一共展示了BlamVersion类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TagGroupFrom
/// <summary>
/// Get a tag group definition from a game name and four character tag
/// </summary>
/// <param name="game"></param>
/// <param name="group_tag"></param>
/// <returns></returns>
/// <remarks>
/// Does not handle Struct group tags.
///
/// If <paramref name="game"/> equals <see cref="BlamVersion.Unknown"/>, <see cref="MiscGroups"/> is used for finding the TagGroup
/// </remarks>
/// <exception cref="Debug.Exceptions.UnreachableException">When <paramref name="game"/> is an unhandled game</exception>
public static TagGroup TagGroupFrom(BlamVersion game, uint group_tag)
{
if (group_tag == uint.MaxValue) return TagGroup.Null;
if ((game & BlamVersion.Halo1) != 0) return Halo1.TagGroups.Groups.FindTagGroup(group_tag);
#if !NO_HALO2
else if ((game & BlamVersion.Halo2) != 0) return Halo2.TagGroups.Groups.FindTagGroup(group_tag);
#endif
#if !NO_HALO3
else if ((game & BlamVersion.Halo3) != 0) return Halo3.TagGroups.Groups.FindTagGroup(group_tag);
#endif
#if !NO_HALO_ODST
else if ((game & BlamVersion.HaloOdst) != 0) return HaloOdst.TagGroups.Groups.FindTagGroup(group_tag);
#endif
#if !NO_HALO_REACH
else if ((game & BlamVersion.HaloReach) != 0) return HaloReach.TagGroups.Groups.FindTagGroup(group_tag);
#endif
#if !NO_HALO4
else if ((game & BlamVersion.Halo4) != 0) return Halo4.TagGroups.Groups.FindTagGroup(group_tag);
#endif
else if ((game & BlamVersion.Stubbs) != 0) return Stubbs.TagGroups.Groups.FindTagGroup(group_tag);
else if (game == BlamVersion.Unknown) return MiscGroups.Groups.FindTagGroup(group_tag);
throw new Debug.Exceptions.UnreachableException(game);
}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:37,代码来源:MiscGroups.cs
示例2: ImplicitUpgradeCalculateFieldStartIndex
int ImplicitUpgradeCalculateFieldStartIndex(Definition def, int size_of, BlamVersion engine, uint flags)
{
int index;
if (!implicitUpgradeFieldIndexes.TryGetValue(size_of, out index))
{
int current_size_of = VersioningGetRealSizeOf(flags);
for (int x = def.Count - 1; x >= 0; x--)
{
var f = def[x];
//if(f.FieldType != FieldType.UselessPad)
current_size_of -= FieldUtil.Sizeof(f, engine, false, flags);
if (current_size_of == size_of)
{
implicitUpgradeFieldIndexes.Add(size_of, index = x);
break;
}
else if (current_size_of < size_of) // field layouts don't match up
return -1;
}
}
return index;
}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:25,代码来源:Version.cs
示例3: GetInterface
public static Interface GetInterface(BlamVersion v)
{
if ((v & BlamVersion.Halo1) != 0) return new Blam.Halo1.CheApe.Project.Interface();
#if !NO_HALO2
else if ((v & BlamVersion.Halo2) != 0) return new Blam.Halo2.CheApe.Project.Interface();
#endif
throw new Debug.Exceptions.UnreachableException(v);
}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:9,代码来源:Project.cs
示例4: ScanForScriptFunctions
static void ScanForScriptFunctions(BlamVersion engine, string path, string[] script_functions)
{
using (var handler = new CacheHandler<Blam.Halo3.CacheFile>(engine, path))
{
var cf = handler.CacheInterface;
cf.Read();
ScanForScriptFunctionsImpl(script_functions, handler.CacheInterface);
}
}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:10,代码来源:Scripting.cs
示例5: BuilderTagIndex
public BuilderTagIndex(BlamVersion version, Managers.ITagIndex source_index) : base(version, source_index)
{
int max_tag_count = 1024;
var g = Program.GetManager(version).FindGame(version);
if (g != null) max_tag_count = g.Tags.MaxCount;
Array = new Managers.DataArray<BuilderItem>(max_tag_count, "builder tag instances");
DataArraySet(Array);
}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:10,代码来源:Builder.cs
示例6: WriteBlankDocument
/// <summary>
/// Writes a blank xml document for someone to start filling in
/// </summary>
/// <param name="file"></param>
/// <param name="engine"></param>
public static void WriteBlankDocument(string file, BlamVersion engine)
{
// maybe I should use XmlTextWriter, but I rly don't care right now...
using (var io = new System.IO.StreamWriter(file))
{
io.WriteLine("<?xml version=\"1.0\" encoding=\"us-ascii\" standalone=\"yes\"?>");
io.WriteLine("<definitions game=\"{0}\">", engine);
io.Write("</definitions>");
}
}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:15,代码来源:Import.cs
示例7: EngineGetTestResultsPath
static string EngineGetTestResultsPath(BlamVersion engine)
{
switch (engine)
{
case BlamVersion.Halo2_Xbox: return kTestResultsPathXbox;
case BlamVersion.Halo2_Alpha: return kTestResultsPathXboxAlpha;
case BlamVersion.Halo2_PC: return kTestResultsPathPc;
default: return kTestResultsPath;
}
}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:11,代码来源:Halo2.cs
示例8: ConstructCacheBuilder
internal protected override Blam.Cache.BuilderBase ConstructCacheBuilder(BlamVersion game)
{
Blam.Cache.BuilderBase cb = null;
if ((game & BlamVersion.Stubbs) != 0)
{
cb = new Stubbs.Builder();
}
return cb;
}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:11,代码来源:Game.cs
示例9: LoadCacheFile
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;
}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:13,代码来源:Game.cs
示例10: InitializeScriptFunctionsList
public static void InitializeScriptFunctionsList(BlamVersion engine, out string[] script_functions)
{
switch (engine)
{
case BlamVersion.Halo3_Xbox: script_functions = new string[kScriptFunctionCountHalo3]; break;
case BlamVersion.HaloOdst_Xbox: script_functions = new string[kScriptFunctionCountHaloOdst]; break;
case BlamVersion.HaloReach_Beta: script_functions = new string[kScriptFunctionCountReachBeta]; break;
case BlamVersion.HaloReach_Xbox: script_functions = new string[kScriptFunctionCountReachRetail]; break;
default: script_functions = null; break;
}
for (int x = 0; x < script_functions.Length; x++)
script_functions[x] = "123";
}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:15,代码来源:Scripts.cs
示例11: CacheOutputInformation
void CacheOutputInformation(BlamVersion game)
{
string dir = null;
if (game == BlamVersion.Stubbs_PC)
dir = kMapsDirectoryPc;
else if (game == BlamVersion.Stubbs_Xbox)
dir = kMapsDirectoryXbox;
if(!string.IsNullOrEmpty(dir))
{
CacheFileOutputInfoArgs.TestThreadedMethod(TestContext,
CacheOutputInformation,
game, dir, kMapNames);
}
}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:15,代码来源:Stubbs.cs
示例12: EngineSettingsForm
public EngineSettingsForm(BlamVersion version)
{
InitializeComponent();
SetDialogName(version);
object settings = null;
switch (version.ToBuild())
{
case BlamBuild.Halo1: settings = BlamLib.Program.Halo1.Manager.Settings; break;
case BlamBuild.Halo2: settings = BlamLib.Program.Halo2.Manager.Settings; break;
case BlamBuild.Halo3: settings = BlamLib.Program.Halo3.Manager.Settings; break;
case BlamBuild.HaloOdst: settings = BlamLib.Program.HaloOdst.Manager.Settings; break;
case BlamBuild.HaloReach: settings = BlamLib.Program.HaloReach.Manager.Settings; break;
case BlamBuild.Stubbs: settings = BlamLib.Program.Stubbs.Manager.Settings; break;
}
PropGrid.SelectedObject = settings;
}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:19,代码来源:EngineSettingsForm.cs
示例13: SecurityAesDecrypt
protected static void SecurityAesDecrypt(BlamVersion game, Blam.CacheSectionType section_type, byte[] input, out byte[] output,
GetAesParametersProc GetAesParameters)
{
output = null;
using (var aesm = new Crypt.AesManaged())
{
aesm.KeySize = 128;
aesm.Padding = Crypt.PaddingMode.Zeros;
aesm.Mode = Crypt.CipherMode.CBC;
byte[] key, iv;
GetAesParameters(game, section_type, out key, out iv);
if (key != null && iv != null)
using (var ctx = aesm.CreateDecryptor(key, iv))
{
output = ctx.TransformFinalBlock(input, 0, input.Length);
}
}
}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:21,代码来源:GameGen3.cs
示例14: ProjectState
protected ProjectState(BlamVersion engine, Project proj)
{
this.engine = engine;
Managers.GameManager.Namespace nspace;
Managers.GameManager.Platform plat;
// Get the namespace of the engine we're using
Managers.GameManager.FromBlamVersion(engine, out nspace, out plat);
// Read the CheApe engine definition data we need for importing
definition = new XmlInterface(engine);
definition.Read(Managers.GameManager.GetRelativePath(nspace), "CheApe.xml");
InitializeTypeIndicies();
proj.OwnerState = this;
project = proj;
Managers.BlamDefinition gd = Program.GetManager(engine);
(gd as Managers.IScriptingController).ScriptingCacheOpen(engine);
scriptingInterface = gd[engine].GetResource<Scripting.XmlInterface>(Managers.BlamDefinition.ResourceScripts);
}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:22,代码来源:ProjectState.cs
示例15: ModelExtractor
/// <summary> Default constructor. </summary>
public ModelExtractor(BlamVersion gameVersion)
{
InitializeComponent();
// Force controls added to the control panel to dock to the top
mControlPanel.ControlAdded +=
(sender, e) =>
{
e.Control.Dock = DockStyle.Top;
};
// Create the controller
mController = new ModelExtractorController(gameVersion);
// Attach to controller state changes
mController.StateChanged += ControllerStateChanged;
SetState(ModelExtractorStateEnum.ExtractorClosed);
// Attach child controls to controller
mTagsPathControl.BindPath("TagsFolder", mController.GetExtractorSettings());
mDataPathControl.BindPath("DataFolder", mController.GetExtractorSettings());
mMessageList.Attach(mController);
mJobListControl.Attach(mController);
// Populate the model type list
foreach (var type in mController.GetExtractorFactory().GetFileTypes())
{
mModelTypeComboBox.Items.Add(String.Format("{0} (*.{1})", type.TypeName, type.TypeExtension));
mExtensions.Add(type.TypeExtension);
}
// Set the initial extractor type
mModelTypeComboBox.SelectedIndex = 0;
mModelTypeComboBox.SelectedIndexChanged += SelectedExtensionChanged;
SetExtractor();
}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:37,代码来源:ModelExtractor.cs
示例16: VertexBufferCacheClose
/// <summary>
/// <see cref="BlamLib.Managers.IVertexBufferController"/>
/// </summary>
/// <param name="game"></param>
/// <returns></returns>
public bool VertexBufferCacheClose(BlamVersion game)
{
int count = -1;
switch (game)
{
case BlamVersion.Halo1_Xbox: count = Interlocked.Decrement(ref VertexBufferCacheReferencesXbox); break;
case BlamVersion.Halo1_XboxX: count = Interlocked.Decrement(ref VertexBufferCacheReferencesXboxX);break;
case BlamVersion.Halo1_PC: //count = Interlocked.Decrement(ref VertexBufferCacheReferencesPC); break;
case BlamVersion.Halo1_PCX: //count = Interlocked.Decrement(ref VertexBufferCacheReferencesPCX);break;
case BlamVersion.Halo1_Mac: //count = Interlocked.Decrement(ref VertexBufferCacheReferencesMac);break;
case BlamVersion.Halo1_CE: count = Interlocked.Decrement(ref VertexBufferCacheReferencesCE); break;
default: throw new Debug.Exceptions.UnreachableException();
}
if(count == 0) // since it's pre-decrement assigned, it will equal to zero when nothing is using it anymore
{
base.CloseResource(game, Managers.BlamDefinition.ResourceVertexBuffers);
return true;
}
else if (count == -1) throw new Debug.Exceptions.UnreachableException();
return false;
}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:30,代码来源:Game.cs
示例17: Project
internal Project(BlamVersion v, string file_name)
{
engine = v;
fileName = file_name;
folder = System.IO.Path.GetDirectoryName(file_name) + "\\";
}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:6,代码来源:Project.cs
示例18: VertexBufferCacheOpen
/// <summary>
/// <see cref="BlamLib.Managers.IVertexBufferController"/>
/// </summary>
/// <param name="game"></param>
/// <returns></returns>
public bool VertexBufferCacheOpen(BlamVersion game)
{
int count = 0;
switch (game)
{
case BlamVersion.Halo1_Xbox: count = Interlocked.Increment(ref VertexBufferCacheReferencesXbox); break;
case BlamVersion.Halo1_XboxX: count = Interlocked.Increment(ref VertexBufferCacheReferencesXboxX);break;
case BlamVersion.Halo1_PC: //count = Interlocked.Increment(ref VertexBufferCacheReferencesPC); break;
case BlamVersion.Halo1_PCX: //count = Interlocked.Increment(ref VertexBufferCacheReferencesPCX);break;
case BlamVersion.Halo1_Mac: //count = Interlocked.Increment(ref VertexBufferCacheReferencesMac);break;
case BlamVersion.Halo1_CE: count = Interlocked.Increment(ref VertexBufferCacheReferencesCE); break;
default: throw new Debug.Exceptions.UnreachableException();
}
if(count == 1)
{
base.PrecacheResource(game, Managers.BlamDefinition.ResourceVertexBuffers);
return true;
}
else if (count == 0) throw new Debug.Exceptions.UnreachableException();
return false;
}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:30,代码来源:Game.cs
示例19: GetCacheFileFromLocation
public override Blam.CacheFile GetCacheFileFromLocation(BlamVersion ver, string cache_name) { return Program.HaloOdst.FromLocation(ver, cache_name); }
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:1,代码来源:Game.cs
示例20: ScriptingCacheClose
/// <summary>
/// <see cref="BlamLib.Managers.IScriptingController"/>
/// </summary>
/// <param name="game"></param>
/// <returns></returns>
public override bool ScriptingCacheClose(BlamVersion game)
{
int count = -1;
switch (game)
{
case BlamVersion.HaloOdst_Xbox: count = Interlocked.Decrement(ref ScriptingCacheReferencesXbox); break;
// case BlamVersion.HaloOdst_PC: count = Interlocked.Decrement(ref ScriptingCacheReferencesPC); break;
default: throw new Debug.Exceptions.UnreachableException();
}
if(count == 0) // since it's pre-decrement assigned, it will equal to zero when nothing is using it anymore
{
base.CloseResource(game, Managers.BlamDefinition.ResourceScripts);
return true;
}
else if (count == -1) throw new Debug.Exceptions.UnreachableException();
return false;
}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:26,代码来源:Game.cs
注:本文中的BlamVersion类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论