本文整理汇总了C#中libJT.Utilities.ByteReader.ReadU16方法的典型用法代码示例。如果您正苦于以下问题:C# ByteReader.ReadU16方法的具体用法?C# ByteReader.ReadU16怎么用?C# ByteReader.ReadU16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libJT.Utilities.ByteReader
的用法示例。
在下文中一共展示了ByteReader.ReadU16方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadV8
protected override void ReadV8(ByteReader reader)
{
base.ReadV8(reader);
DataFlags = reader.ReadU16();
if (( DataFlags & 0x0001 ) == 0x0001) {
// Pattern bits are valid
if (( DataFlags & 0x0002 ) == 0x0002) {
float c = reader.ReadF32();
AmbientColor = new[] {c, c, c, 1.0f};
} else {
AmbientColor = reader.ReadRGBA();
}
DiffuseColor = reader.ReadRGBA();
if ( ( DataFlags & 0x0004 ) == 0x0004 ) {
float c = reader.ReadF32();
SpecularColor = new[] { c, c, c, 1.0f };
} else {
SpecularColor = reader.ReadRGBA();
}
if ( ( DataFlags & 0x0008 ) == 0x0008 ) {
float c = reader.ReadF32();
EmissionColor = new[] { c, c, c, 1.0f };
} else {
EmissionColor = reader.ReadRGBA();
}
} else {
AmbientColor = reader.ReadRGBA();
DiffuseColor = reader.ReadRGBA();
SpecularColor = reader.ReadRGBA();
EmissionColor = reader.ReadRGBA();
}
Shininess = reader.ReadF32();
}
示例2: ReadV8
protected override void ReadV8(ByteReader reader)
{
base.ReadV8( reader );
ushort storedMask = reader.ReadU16();
for ( int i = 0; i < 16; i++ ) {
if ( ( storedMask & 0x8000 ) == 0x8000 ) {
Transform[i] = reader.ReadF32();
}
storedMask <<= 1;
}
}