本文整理汇总了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 );
}
示例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;
}
示例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();
}
}
示例4: Save
void WBCompEldWatson::Save( const IDataStream& Stream )
{
Stream.WriteUInt32( VERSION_CURRENT );
Stream.WriteBool( m_Activated );
Stream.WriteBool( m_Primed );
}
示例5: Save
void WBEvent::Save( const IDataStream& Stream ) const
{
WBPackedEvent PackedEvent;
Pack( PackedEvent );
Stream.WriteUInt32( PackedEvent.GetSize() );
Stream.Write( PackedEvent.GetSize(), PackedEvent.GetData() );
}
示例6: Load
void WBCompEldVisible::Load(const IDataStream& Stream) {
XTRACE_FUNCTION;
const uint Version = Stream.ReadUInt32();
if (Version >= VERSION_VISIBLE) {
m_Visible = Stream.ReadBool();
}
}
示例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);
}
}
示例8: Load
void WBCompState::Load(const IDataStream& Stream) {
XTRACE_FUNCTION;
const uint Version = Stream.ReadUInt32();
if (Version >= VERSION_STATE) {
m_State = Stream.ReadHashedString();
}
}
示例9: Load
void WBCompEldWallet::Load(const IDataStream& Stream) {
XTRACE_FUNCTION;
const uint Version = Stream.ReadUInt32();
if (Version >= VERSION_MONEY) {
m_Money = Stream.ReadUInt32();
}
}
示例10: Load
void WBCompEldPickup::Load(const IDataStream& Stream) {
XTRACE_FUNCTION;
const uint Version = Stream.ReadUInt32();
if (Version >= VERSION_PRICE) {
m_Price = Stream.ReadUInt32();
}
}
示例11: Load
void WBCompEldFrobber::Load(const IDataStream& Stream) {
XTRACE_FUNCTION;
const uint Version = Stream.ReadUInt32();
if (Version >= VERSION_FROBDISABLED) {
m_FrobDisabled = Stream.ReadBool();
}
}
示例12: Load
void WBCompEldEndgameCounter::Load(const IDataStream& Stream) {
XTRACE_FUNCTION;
const uint Version = Stream.ReadUInt32();
if (Version >= VERSION_COUNT) {
m_Count = Stream.ReadUInt32();
}
}
示例13: Load
void WBCompEldFaction::Load(const IDataStream& Stream) {
XTRACE_FUNCTION;
const uint Version = Stream.ReadUInt32();
if (Version >= VERSION_FACTION) {
m_Faction = Stream.ReadHashedString();
}
}
示例14: GetParent
IDataStream * IDataStream::GetRootParent(void)
{
IDataStream * parent = GetParent();
if(parent)
return parent->GetRootParent();
else
return this;
}
示例15: Load
void WBCompEldSleeper::Load(const IDataStream& Stream) {
XTRACE_FUNCTION;
const uint Version = Stream.ReadUInt32();
if (Version >= VERSION_AWAKE) {
m_IsAwake = Stream.ReadBool();
}
}