本文整理汇总了C++中IDataStream::ReadInt32方法的典型用法代码示例。如果您正苦于以下问题:C++ IDataStream::ReadInt32方法的具体用法?C++ IDataStream::ReadInt32怎么用?C++ IDataStream::ReadInt32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDataStream
的用法示例。
在下文中一共展示了IDataStream::ReadInt32方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
void WBCompEldMesh::Load(const IDataStream& Stream) {
XTRACE_FUNCTION;
ASSERT(m_Mesh);
const uint Version = Stream.ReadUInt32();
if (Version >= VERSION_MESHNAME) {
const SimpleString MeshName = Stream.ReadString();
if (MeshName != m_MeshName) {
SetMesh(MeshName);
}
}
if (Version >= VERSION_TEXTURENAME) {
const SimpleString TextureName = Stream.ReadString();
if (TextureName != m_TextureName) {
SetTexture(TextureName);
}
}
if (Version >= VERSION_MESHSCALE) {
Stream.Read(sizeof(Vector), &m_Mesh->m_Scale);
}
if (Version >= VERSION_HIDDEN) {
m_Hidden = Stream.ReadBool();
}
if (Version >= VERSION_ANIMATION) {
const int AnimationIndex = Stream.ReadInt32();
const float AnimationTime = Stream.ReadFloat();
const int AnimationEndBehavior = Stream.ReadInt32();
const float AnimationPlayRate =
(Version >= VERSION_ANIMRATE) ? Stream.ReadFloat() : 1.0f;
if (m_Mesh->IsAnimated()) {
WB_MAKE_EVENT(SetAnim, GetEntity());
WB_SET_AUTO(SetAnim, Int, AnimationIndex, AnimationIndex);
WB_SET_AUTO(SetAnim, Float, AnimationTime, AnimationTime);
WB_SET_AUTO(SetAnim, Int, AnimationEndBehavior, AnimationEndBehavior);
WB_SET_AUTO(SetAnim, Float, AnimationPlayRate, AnimationPlayRate);
WB_QUEUE_EVENT(GetEventManager(), SetAnim, GetEntity());
}
}
}
示例2: Load
void WBCompEldHands::Load( const IDataStream& Stream )
{
XTRACE_FUNCTION;
const uint Version = Stream.ReadUInt32();
if( Version >= VERSION_HIDEHANDSREFS )
{
m_HideHandsRefs = Stream.ReadInt32();
}
}
示例3: Load
void EldritchRoom::Load( const IDataStream& Stream )
{
const uint Version = Stream.ReadUInt32();
if( Version >= VERSION_ROOMSCALARS )
{
m_RoomScalarX = Stream.ReadUInt32();
m_RoomScalarY = Stream.ReadUInt32();
m_RoomScalarZ = Stream.ReadUInt32();
}
if( Version >= VERSION_VOXELS )
{
const uint NumVoxels = Stream.ReadUInt32();
m_VoxelMap.Resize( NumVoxels );
Stream.Read( m_VoxelMap.MemorySize(), m_VoxelMap.GetData() );
}
if( Version >= VERSION_SPAWNERS )
{
const uint NumSpawners = Stream.ReadUInt32();
m_Spawners.Clear();
m_Spawners.Reserve( NumSpawners );
for( uint SpawnerIndex = 0; SpawnerIndex < NumSpawners; ++SpawnerIndex )
{
SSpawner& Spawner = m_Spawners.PushBack();
Spawner.m_SpawnerDef = Stream.ReadString();
Spawner.m_Location = Stream.ReadInt32();
if( Version >= VERSION_SPAWNER_ORIENTATION )
{
Spawner.m_Orientation = Stream.ReadUInt8();
}
}
}
}
示例4: Load
void ConfigManager::Load( const IDataStream& Stream )
{
uint Pos = Stream.GetPos();
if( 'FCCD' == Stream.ReadUInt32() )
{
uint NumContexts = Stream.ReadUInt32();
for( uint ContextIndex = 0; ContextIndex < NumContexts; ++ContextIndex )
{
HashedString ContextKey( Stream.ReadUInt32() );
uint NumVars = Stream.ReadUInt32();
VarMap& VarMap = GetInstance()->m_Vars[ ContextKey ];
for( uint VarIndex = 0; VarIndex < NumVars; ++VarIndex )
{
ConfigVar ConfigVar;
HashedString Key( Stream.ReadUInt32() );
ConfigVar.m_Type = ( ConfigVar::EVarType )Stream.ReadUInt8();
switch( ConfigVar.m_Type )
{
case ConfigVar::EVT_Bool:
ConfigVar.m_Bool = ( Stream.ReadUInt8() != 0 );
break;
case ConfigVar::EVT_Int:
ConfigVar.m_Int = Stream.ReadInt32();
break;
case ConfigVar::EVT_Float:
ConfigVar.m_Float = Stream.ReadFloat();
break;
case ConfigVar::EVT_String:
{
uint Length = Stream.ReadUInt32();
char* pString = AllocateString( Length + 1 );
Stream.Read( Length, pString );
pString[ Length ] = '\0';
StringManager::AddString( StringManager::ESL_Permanent, pString );
ConfigVar.m_String = pString;
ConfigVar.m_Hash = Stream.ReadUInt32();
if( ReverseHash::IsEnabled() )
{
ReverseHash::RegisterHash( ConfigVar.m_Hash, ConfigVar.m_String );
}
}
break;
default:
WARNDESC( "Bad config var type" );
break;
}
VarMap.Insert( Key, ConfigVar );
}
}
}
else
{
Stream.SetPos( Pos );
ConfigParser::Parse( Stream );
}
}