当前位置: 首页>>代码示例>>C++>>正文


C++ IDataStream::ReadString方法代码示例

本文整理汇总了C++中IDataStream::ReadString方法的典型用法代码示例。如果您正苦于以下问题:C++ IDataStream::ReadString方法的具体用法?C++ IDataStream::ReadString怎么用?C++ IDataStream::ReadString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDataStream的用法示例。


在下文中一共展示了IDataStream::ReadString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Load

void WBCompEldFrobbable::Load(const IDataStream& Stream) {
  XTRACE_FUNCTION;

  const uint Version = Stream.ReadUInt32();

  if (Version >= VERSION_ISFROBBABLE) {
    m_IsFrobbable = Stream.ReadBool();
  }

  if (Version >= VERSION_HOLDRELEASEMODE) {
    m_HoldReleaseMode = Stream.ReadBool();
  }

  if (Version >= VERSION_FRIENDLYNAME) {
    m_FriendlyName = Stream.ReadString();
  }

  if (Version >= VERSION_FROBVERB) {
    m_FrobVerb = Stream.ReadString();
  }

  if (Version >= VERSION_BOUNDS) {
    Stream.Read(sizeof(Vector), &m_BoundOffset);
    Stream.Read(sizeof(Vector), &m_BoundExtents);
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:26,代码来源:wbcompeldfrobbable.cpp

示例2: 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());
    }
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:46,代码来源:wbcompeldmesh.cpp

示例3: ReadPackFile

void FilePacker::ReadPackFile( const IDataStream& Stream )
{
	Stream.Read( sizeof( SPackageFileHeader ), &m_Header );
	ASSERT( m_Header.m_MagicID == 'KPCD' );

	for( uint i = 0; i < m_Header.m_NumFiles; ++i )
	{
		SPackageFileEntry FileEntry;

		FileEntry.m_Filename = Stream.ReadString();
		FileEntry.m_OffsetToFile = Stream.ReadUInt32();
		FileEntry.m_CompressedSize = Stream.ReadUInt32();
		FileEntry.m_DecompressedSize = Stream.ReadUInt32();
		FileEntry.m_Compressed = Stream.ReadUInt32();

		m_FileEntries.PushBack( FileEntry );
	}

	m_ExistingPackFileSize = m_Header.m_FilesSize;
	m_ExistingPackFileBuffer = new byte[ m_ExistingPackFileSize ];
	Stream.Read( m_ExistingPackFileSize, m_ExistingPackFileBuffer );
}
开发者ID:Johnicholas,项目名称:EldritchCopy,代码行数:22,代码来源:filepacker.cpp

示例4: 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();
			}
		}
	}
}
开发者ID:MinorKeyGames,项目名称:Eldritch,代码行数:36,代码来源:eldritchroom.cpp


注:本文中的IDataStream::ReadString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。