本文整理汇总了C#中BlamLib.ReadInt16方法的典型用法代码示例。如果您正苦于以下问题:C# BlamLib.ReadInt16方法的具体用法?C# BlamLib.ReadInt16怎么用?C# BlamLib.ReadInt16使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlamLib
的用法示例。
在下文中一共展示了BlamLib.ReadInt16方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
public override void Read(BlamLib.IO.EndianReader s)
{
int pos = 0;
Blam.CacheFile.ValidateHeaderAdjustEndian(s, 0x800);
s.Seek(4);
Halo1.Version ver = (Halo1.Version)(version = s.ReadInt32());
fileLength = s.ReadInt32();
if (fileLength < s.Length) throw new Debug.ExceptionLog("Compressed map editing not available yet!");
s.ReadInt32();
if (ver == Halo1.Version.PC_Demo)
{
pos = s.Position;
s.Position = 0x5EC;
offsetToIndex = s.ReadInt32();
s.Position = pos;
}
else
offsetToIndex = s.ReadInt32();
tagBufferSize = s.ReadInt32();
s.ReadInt32(); s.ReadInt32();
if (ver == Halo1.Version.PC_Demo)
{
pos = s.Position;
s.Position = 0x5E8;
name = s.ReadTagString();
s.Position = pos;
}
else
name = s.ReadTagString();
build = s.ReadTagString();
cacheType = (CacheType)s.ReadInt16();
s.ReadInt16();
s.ReadInt32(); // CRC
s.ReadInt32();
s.Seek((484 * sizeof(int)) + sizeof(uint), System.IO.SeekOrigin.Current);
CacheFile cache = s.Owner as CacheFile;
if (ver == Halo1.Version.Xbox) cache.EngineVersion = BlamVersion.Halo1_Xbox;
else if (ver == Halo1.Version.PC || ver == Halo1.Version.PC_Demo)
{
if(s.State == IO.EndianState.Big) cache.EngineVersion = BlamVersion.Halo1_XboxX;
else
{
// Interestingly, HaloPC is build 01.00.00.0564, HA10 is build 01.00.01.0563
// Little
if(build == "01.00.01.0563") cache.EngineVersion = BlamVersion.Halo1_PCX;
else cache.EngineVersion = BlamVersion.Halo1_PC;
}
}
else if (ver == Halo1.Version.CE) cache.EngineVersion = BlamVersion.Halo1_CE;
}
示例2: Read
public override void Read(BlamLib.IO.EndianReader s)
{
base.Read(s);
Flags = s.ReadUInt32();
ScoreToWin = s.ReadInt16();
MovingHill = s.ReadByte();
MovingHillOrder = s.ReadByte();
InsideHillPoints = s.ReadByte();
OutsideHillPoints = s.ReadByte();
UncontestedHillBonus = s.ReadByte();
KillPoints = s.ReadByte();
HillTraits.Read(s);
}
示例3: Read
public void Read(BlamLib.IO.EndianReader s, IO.ITagStream ts)
{
bool upgrade = ts.Flags.Test(IO.ITagStreamFlags.Halo2OldFormat_Fieldset);
GroupTag = s.ReadTagUInt();
if(!upgrade)
{
Index = s.ReadInt32();
Count = s.ReadInt32();
}
else
{
Index = s.ReadInt16();
Count = s.ReadInt16();
}
Size = s.ReadInt32();
++Index;
}
示例4: Read
public override void Read(BlamLib.IO.EndianReader s)
{
bool is_beta = false;
bool is_odst = !((s.Owner as Blam.CacheFile).EngineVersion == BlamVersion.Halo3);
Blam.CacheFile.ValidateHeader(s, kSizeOf);
s.Seek(4);
version = s.ReadInt32(); is_beta = version == 9;
if (version != 9 && version != 11) throw new InvalidCacheFileException(s.FileName);
fileLength = s.ReadInt32();
s.ReadInt32();
tagIndexAddress = s.ReadUInt32();
memoryBufferOffset = s.ReadInt32();
memoryBufferSize = s.ReadInt32();
sourceFile = s.ReadAsciiString(256);
build = s.ReadTagString();
cacheType = (Blam.CacheType)s.ReadInt16();
if (is_beta)
{
s.ReadInt16(); sharedType = Cache.SharedType.Beta;
ReadBeta(s);
return;
}
else
sharedType = (Cache.SharedType)s.ReadInt16();
s.ReadBool();
s.ReadBool(); // false if it belongs to a untracked build
s.ReadBool();
s.ReadByte(); // appears to be an ODST-only field
s.ReadInt32(); s.ReadInt32();
s.ReadInt32(); s.ReadInt32(); s.ReadInt32();
#region string id table
// 0x158
// old 128 byte aligned string table not used after the Delta builds of Halo 3
stringIdsCount = s.ReadInt32();
stringIdsBufferSize = s.ReadInt32(); // cstring buffer total size in bytes
stringIdIndicesOffset = s.ReadInt32();
stringIdsBufferOffset = s.ReadInt32(); // cstring buffer
#endregion
#region filetimes?
// pretty sure this is a flags field
// used to tell which of the following 64bit values
// are used. Damn sure this are FILETIME structures, but
// hex workshop doesn't like them so I can't be for sure...
needsShared = s.ReadInt32() != 0; // just a little 'hack' if you will. if zero, the map is self reliant, so no worries
Filetime.dwHighDateTime = s.ReadInt32();
Filetime.dwLowDateTime = s.ReadInt32();
if (s.ReadInt32() != 0) flags.Add(CacheHeaderFlags.DependsOnMainMenu); s.ReadInt32();
if (s.ReadInt32() != 0) flags.Add(CacheHeaderFlags.DependsOnShared); s.ReadInt32();
if (s.ReadInt32() != 0) flags.Add(CacheHeaderFlags.DependsOnCampaign); s.ReadInt32();
#endregion
name = s.ReadTagString();
s.ReadInt32();
scenarioPath = s.ReadAsciiString(256);
s.ReadInt32(); // minor version, normally not used
#region tag names
tagNamesCount = s.ReadInt32();
tagNamesBufferOffset = s.ReadInt32(); // cstring buffer
tagNamesBufferSize = s.ReadInt32(); // cstring buffer total size in bytes
tagNameIndicesOffset = s.ReadInt32();
#endregion
checksum = s.ReadUInt32(); // 0x2C4
s.Seek(32, System.IO.SeekOrigin.Current); // these bytes are always the same
baseAddress = s.ReadUInt32(); // expected base address
xdkVersion = s.ReadInt32(); // xdk version
#region memory partitions
// 0x2E8
// memory partitions
memoryPartitions = new Partition[6];
memoryPartitions[0].BaseAddress = s.ReadUInt32(); // cache resource buffer
memoryPartitions[0].Size = s.ReadInt32();
// readonly
memoryPartitions[1].BaseAddress = s.ReadUInt32(); // sound cache resource buffer
memoryPartitions[1].Size = s.ReadInt32();
memoryPartitions[2].BaseAddress = s.ReadUInt32(); // global tags buffer
memoryPartitions[2].Size = s.ReadInt32();
memoryPartitions[3].BaseAddress = s.ReadUInt32(); // shared tag blocks?
memoryPartitions[3].Size = s.ReadInt32();
memoryPartitions[4].BaseAddress = s.ReadUInt32(); // address
memoryPartitions[4].Size = s.ReadInt32();
// readonly
memoryPartitions[5].BaseAddress = s.ReadUInt32(); // map tags buffer
memoryPartitions[5].Size = s.ReadInt32();
#endregion
//.........这里部分代码省略.........
示例5: Read
public void Read(BlamLib.IO.EndianReader s)
{
X = s.ReadInt16();
Y = s.ReadInt16();
Z = s.ReadInt16();
W = s.ReadInt16();
}