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


C++ IDataStream类代码示例

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


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

示例1:

/*virtual*/ void MIDINoteOnEvent::Save( const IDataStream& Stream ) const
{
	MIDIMIDIEvent::Save( Stream );

	Stream.WriteUInt8( m_Note );
	Stream.WriteUInt8( m_Velocity );
}
开发者ID:Johnicholas,项目名称:EldritchCopy,代码行数:7,代码来源:midinoteonevent.cpp

示例2: LoadBMP

// TODO: Add meaningful return values
int Surface::LoadBMP( const IDataStream& Stream )
{
    SBitmapFileHeader	BMPFileHeader;
    SBitmapInfoHeader	BMPInfoHeader;

    Stream.Read( sizeof( SBitmapFileHeader ), &BMPFileHeader );
    Stream.Read( sizeof( SBitmapInfoHeader ), &BMPInfoHeader );

    int Width	= BMPInfoHeader.m_Width;
    int Height	= BMPInfoHeader.m_Height;
    int Stride	= ComputeStride( BMPInfoHeader.m_Width, BMPInfoHeader.m_BitCount );

    Reset( Width, Height, BMPInfoHeader.m_BitCount );

#if BUILD_WINDOWS_NO_SDL
    Stream.Read( Stride * Height, m_pPixels );
#endif
#if BUILD_SDL
    // SDL stores surfaces from top to bottom, so flip the rows
    byte* pPixels = m_pPixels + ( ( Height - 1 ) * Stride );
    for( int Row = 0; Row < Height; ++Row, pPixels	-= Stride )
    {
        Stream.Read( Stride, pPixels );
    }
#endif

    return 0;
}
开发者ID:Johnicholas,项目名称:EldritchCopy,代码行数:29,代码来源:surface.cpp

示例3: Load

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

	const uint Version = Stream.ReadUInt32();

	if( Version >= VERSION_UID )
	{
		m_UID = Stream.ReadUInt32();
	}

	if( Version >= VERSION_LASTENTITYSCENEHANDLE )
	{
		m_LastEntitySceneHandle = Stream.ReadUInt32();
	}

	uint NumEntities = Stream.ReadUInt32();
	for( uint EntityIndex = 0; EntityIndex < NumEntities; ++EntityIndex )
	{
		WBEntity* pNewEntity = new WBEntity;
		pNewEntity->Load( Stream );

		AddEntity( pNewEntity, pNewEntity->GetSceneHandle() );
		WBWorld::GetInstance()->AddEntity( pNewEntity, pNewEntity->GetUID() );

		pNewEntity->SendOnInitializedEvent();
	}
}
开发者ID:MinorKeyGames,项目名称:Eldritch,代码行数:28,代码来源:wbscene.cpp

示例4: Save

void WBCompEldWatson::Save( const IDataStream& Stream )
{
	Stream.WriteUInt32( VERSION_CURRENT );

	Stream.WriteBool( m_Activated );

	Stream.WriteBool( m_Primed );
}
开发者ID:MinorKeyGames,项目名称:Eldritch,代码行数:8,代码来源:wbcompeldwatson.cpp

示例5: Save

void WBEvent::Save( const IDataStream& Stream ) const
{
	WBPackedEvent PackedEvent;
	Pack( PackedEvent );

	Stream.WriteUInt32( PackedEvent.GetSize() );
	Stream.Write( PackedEvent.GetSize(), PackedEvent.GetData() );
}
开发者ID:MinorKeyGames,项目名称:Eldritch,代码行数:8,代码来源:wbevent.cpp

示例6: Load

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

  const uint Version = Stream.ReadUInt32();

  if (Version >= VERSION_VISIBLE) {
    m_Visible = Stream.ReadBool();
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:9,代码来源:wbcompeldvisible.cpp

示例7: Load

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

  const uint Version = Stream.ReadUInt32();

  if (Version >= VERSION_OWNER) {
    Stream.Read(sizeof(WBEntityRef), &m_Owner);
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:9,代码来源:wbcompowner.cpp

示例8: Load

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

  const uint Version = Stream.ReadUInt32();

  if (Version >= VERSION_STATE) {
    m_State = Stream.ReadHashedString();
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:9,代码来源:wbcompstate.cpp

示例9: Load

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

  const uint Version = Stream.ReadUInt32();

  if (Version >= VERSION_MONEY) {
    m_Money = Stream.ReadUInt32();
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:9,代码来源:wbcompeldwallet.cpp

示例10: Load

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

  const uint Version = Stream.ReadUInt32();

  if (Version >= VERSION_PRICE) {
    m_Price = Stream.ReadUInt32();
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:9,代码来源:wbcompeldpickup.cpp

示例11: Load

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

  const uint Version = Stream.ReadUInt32();

  if (Version >= VERSION_FROBDISABLED) {
    m_FrobDisabled = Stream.ReadBool();
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:9,代码来源:wbcompeldfrobber.cpp

示例12: Load

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

  const uint Version = Stream.ReadUInt32();

  if (Version >= VERSION_COUNT) {
    m_Count = Stream.ReadUInt32();
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:9,代码来源:wbcompeldendgamecounter.cpp

示例13: Load

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

  const uint Version = Stream.ReadUInt32();

  if (Version >= VERSION_FACTION) {
    m_Faction = Stream.ReadHashedString();
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:9,代码来源:wbcompeldfaction.cpp

示例14: GetParent

IDataStream * IDataStream::GetRootParent(void)
{
	IDataStream	* parent = GetParent();

	if(parent)
		return parent->GetRootParent();
	else
		return this;
}
开发者ID:Silentfood,项目名称:oonline,代码行数:9,代码来源:IDataStream.cpp

示例15: Load

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

  const uint Version = Stream.ReadUInt32();

  if (Version >= VERSION_AWAKE) {
    m_IsAwake = Stream.ReadBool();
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:9,代码来源:wbcompeldsleeper.cpp


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