本文整理汇总了C++中CBlockMember::GetSize方法的典型用法代码示例。如果您正苦于以下问题:C++ CBlockMember::GetSize方法的具体用法?C++ CBlockMember::GetSize怎么用?C++ CBlockMember::GetSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBlockMember
的用法示例。
在下文中一共展示了CBlockMember::GetSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveCommand
int CSequence::SaveCommand( CBlock *block )
{
unsigned char flags;
int numMembers, bID, size;
CBlockMember *bm;
ojk::SavedGameHelper saved_game(
m_owner->GetInterface()->saved_game);
//Save out the block ID
bID = block->GetBlockID();
saved_game.write_chunk<int32_t>(
INT_ID('B', 'L', 'I', 'D'),
bID);
//Save out the block's flags
flags = block->GetFlags();
saved_game.write_chunk<uint8_t>(
INT_ID('B', 'F', 'L', 'G'),
flags);
//Save out the number of members to read
numMembers = block->GetNumMembers();
saved_game.write_chunk<int32_t>(
INT_ID('B', 'N', 'U', 'M'),
numMembers);
for ( int i = 0; i < numMembers; i++ )
{
bm = block->GetMember( i );
//Save the block id
bID = bm->GetID();
saved_game.write_chunk<int32_t>(
INT_ID('B', 'M', 'I', 'D'),
bID);
//Save out the data size
size = bm->GetSize();
saved_game.write_chunk<int32_t>(
INT_ID('B', 'S', 'I', 'Z'),
size);
//Save out the raw data
const uint8_t* raw_data = static_cast<const uint8_t*>(bm->GetData());
saved_game.write_chunk(
INT_ID('B', 'M', 'E', 'M'),
raw_data,
size);
}
return true;
}
示例2: SaveCommand
int CSequence::SaveCommand( CBlock *block )
{
CIcarus *pIcarus = (CIcarus *)IIcarusInterface::GetIcarus();
unsigned char flags;
int numMembers, bID, size;
CBlockMember *bm;
// Data saved here (IBLK):
// Block ID.
// Block Flags.
// Number of Block Members.
// Block Members:
// - Block Member ID.
// - Block Data Size.
// - Block (Raw) Data.
//Save out the block ID
bID = block->GetBlockID();
pIcarus->BufferWrite( &bID, sizeof ( bID ) );
//Save out the block's flags
flags = block->GetFlags();
pIcarus->BufferWrite( &flags, sizeof ( flags ) );
//Save out the number of members to read
numMembers = block->GetNumMembers();
pIcarus->BufferWrite( &numMembers, sizeof ( numMembers ) );
for ( int i = 0; i < numMembers; i++ )
{
bm = block->GetMember( i );
//Save the block id
bID = bm->GetID();
pIcarus->BufferWrite( &bID, sizeof ( bID ) );
//Save out the data size
size = bm->GetSize();
pIcarus->BufferWrite( &size, sizeof ( size ) );
//Save out the raw data
pIcarus->BufferWrite( bm->GetData(), size );
}
return true;
}
示例3: SaveCommand
int CSequence::SaveCommand( CBlock *block )
{
unsigned char flags;
int numMembers, bID, size;
CBlockMember *bm;
//Save out the block ID
bID = block->GetBlockID();
(m_owner->GetInterface())->I_WriteSaveData( INT_ID('B','L','I','D'), &bID, sizeof ( bID ) );
//Save out the block's flags
flags = block->GetFlags();
(m_owner->GetInterface())->I_WriteSaveData( INT_ID('B','F','L','G'), &flags, sizeof ( flags ) );
//Save out the number of members to read
numMembers = block->GetNumMembers();
(m_owner->GetInterface())->I_WriteSaveData( INT_ID('B','N','U','M'), &numMembers, sizeof ( numMembers ) );
for ( int i = 0; i < numMembers; i++ )
{
bm = block->GetMember( i );
//Save the block id
bID = bm->GetID();
(m_owner->GetInterface())->I_WriteSaveData( INT_ID('B','M','I','D'), &bID, sizeof ( bID ) );
//Save out the data size
size = bm->GetSize();
(m_owner->GetInterface())->I_WriteSaveData( INT_ID('B','S','I','Z'), &size, sizeof( size ) );
//Save out the raw data
(m_owner->GetInterface())->I_WriteSaveData( INT_ID('B','M','E','M'), bm->GetData(), size );
}
return true;
}