本文整理汇总了C++中blargg_vector类的典型用法代码示例。如果您正苦于以下问题:C++ blargg_vector类的具体用法?C++ blargg_vector怎么用?C++ blargg_vector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了blargg_vector类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: read_strs
// Read multiple strings and separate into individual strings
static blargg_err_t read_strs( Data_Reader& in, int size, blargg_vector<char>& chars,
blargg_vector<const char*>& strs )
{
RETURN_ERR( chars.resize( size + 1 ) );
chars [size] = 0; // in case last string doesn't have terminator
RETURN_ERR( in.read( &chars [0], size ) );
RETURN_ERR( strs.resize( 128 ) );
int count = 0;
for ( int i = 0; i < size; i++ )
{
if ( (int) strs.size() <= count )
RETURN_ERR( strs.resize( count * 2 ) );
strs [count++] = &chars [i];
while ( i < size && chars [i] )
i++;
}
return strs.resize( count );
}
开发者ID:9a3eedi,项目名称:Droidsound,代码行数:21,代码来源:Nsfe_Emu.cpp
示例2: track_info_
blargg_err_t track_info_( track_info_t* out, int ) const
{
get_vgm_length( h, out );
if ( gd3.size() )
parse_gd3( gd3.begin(), gd3.end(), out );
return 0;
}
开发者ID:HipsterLion,项目名称:SRB2,代码行数:7,代码来源:Vgm_Emu.cpp
示例3: load_
blargg_err_t load_( Data_Reader& in )
{
int file_size = in.remain();
if ( file_size <= h.size )
return blargg_err_file_type;
RETURN_ERR( in.read( &h, h.size ) );
if ( !h.valid_tag() )
return blargg_err_file_type;
int gd3_offset = get_le32( h.gd3_offset ) - 0x2C;
int remain = file_size - h.size - gd3_offset;
byte gd3_h [gd3_header_size];
if ( gd3_offset > 0 && remain >= gd3_header_size )
{
RETURN_ERR( in.skip( gd3_offset ) );
RETURN_ERR( in.read( gd3_h, sizeof gd3_h ) );
int gd3_size = check_gd3_header( gd3_h, remain );
if ( gd3_size )
{
RETURN_ERR( gd3.resize( gd3_size ) );
RETURN_ERR( in.read( gd3.begin(), gd3.size() ) );
}
}
return blargg_ok;
}
开发者ID:Gardenya,项目名称:deadbeef,代码行数:26,代码来源:Vgm_Emu.cpp
示例4: load_
blargg_err_t load_( Data_Reader& in )
{
long file_size = in.remain();
if ( file_size <= Vgm_Emu::header_size )
return gme_wrong_file_type;
RETURN_ERR( in.read( &h, Vgm_Emu::header_size ) );
RETURN_ERR( check_vgm_header( h ) );
long gd3_offset = get_le32( h.gd3_offset ) - 0x2C;
long remain = file_size - Vgm_Emu::header_size - gd3_offset;
byte gd3_h [gd3_header_size];
if ( gd3_offset > 0 && remain >= gd3_header_size )
{
RETURN_ERR( in.skip( gd3_offset ) );
RETURN_ERR( in.read( gd3_h, sizeof gd3_h ) );
long gd3_size = check_gd3_header( gd3_h, remain );
if ( gd3_size )
{
RETURN_ERR( gd3.resize( gd3_size ) );
RETURN_ERR( in.read( gd3.begin(), gd3.size() ) );
}
}
return 0;
}
开发者ID:HipsterLion,项目名称:SRB2,代码行数:25,代码来源:Vgm_Emu.cpp
示例5: load_
blargg_err_t load_( Data_Reader& in )
{
int file_size = in.remain();
if ( file_size <= h.size_min )
return blargg_err_file_type;
RETURN_ERR( in.read( &h, h.size_min ) );
if ( !h.valid_tag() )
return blargg_err_file_type;
if ( h.size() > h.size_min )
RETURN_ERR( in.read( &h.rf5c68_rate, h.size() - h.size_min ) );
h.cleanup();
int data_offset = get_le32( h.data_offset ) + offsetof( Vgm_Core::header_t, data_offset );
int data_size = file_size - offsetof( Vgm_Core::header_t, data_offset ) - data_offset;
int gd3_offset = get_le32( h.gd3_offset );
if ( gd3_offset > 0 )
gd3_offset += offsetof( Vgm_Core::header_t, gd3_offset );
int amount_to_skip = gd3_offset - h.size();
if ( gd3_offset > 0 && gd3_offset > data_offset )
{
data_size = gd3_offset - data_offset;
amount_to_skip = 0;
RETURN_ERR( data.resize( data_size ) );
RETURN_ERR( in.skip( data_offset - h.size() ) );
RETURN_ERR( in.read( data.begin(), data_size ) );
}
int remain = file_size - gd3_offset;
byte gd3_h [gd3_header_size];
if ( gd3_offset > 0 && remain >= gd3_header_size )
{
RETURN_ERR( in.skip( amount_to_skip ) );
RETURN_ERR( in.read( gd3_h, sizeof gd3_h ) );
int gd3_size = check_gd3_header( gd3_h, remain );
if ( gd3_size )
{
RETURN_ERR( gd3.resize( gd3_size ) );
RETURN_ERR( in.read( gd3.begin(), gd3.size() ) );
}
if ( data_offset > gd3_offset )
{
RETURN_ERR( data.resize( data_size ) );
RETURN_ERR( in.skip( data_offset - gd3_offset - sizeof gd3_h - gd3.size() ) );
RETURN_ERR( in.read( data.begin(), data.end() - data.begin() ) );
}
}
return (blargg_err_t)blargg_ok;
}
开发者ID:Kinglions,项目名称:modizer,代码行数:56,代码来源:Vgm_Emu.cpp
示例6: load_
blargg_err_t load_( Data_Reader& in )
{
long file_size = in.remain();
if ( file_size < Snes_Spc::spc_min_file_size )
return gme_wrong_file_type;
RETURN_ERR( in.read( &header, Spc_Emu::header_size ) );
RETURN_ERR( check_spc_header( header.tag ) );
long const xid6_offset = 0x10200;
long xid6_size = file_size - xid6_offset;
if ( xid6_size > 0 )
{
RETURN_ERR( xid6.resize( xid6_size ) );
RETURN_ERR( in.skip( xid6_offset - Spc_Emu::header_size ) );
RETURN_ERR( in.read( xid6.begin(), xid6.size() ) );
}
return 0;
}
开发者ID:bazzinotti,项目名称:libGME_M,代码行数:17,代码来源:Spc_Emu.cpp
示例7: load_
blargg_err_t load_( Data_Reader& in )
{
int file_size = in.remain();
if ( file_size < Sfm_Emu::sfm_min_file_size )
return blargg_err_file_type;
RETURN_ERR( data.resize( file_size ) );
RETURN_ERR( in.read( data.begin(), data.end() - data.begin() ) );
RETURN_ERR( check_sfm_header( data.begin() ) );
int metadata_size = get_le32( data.begin() + 4 );
byte temp = data[ 8 + metadata_size ];
data[ 8 + metadata_size ] = '\0';
metadata.parseDocument( (const char *)data.begin() + 8 );
data[ 8 + metadata_size ] = temp;
return blargg_ok;
}
开发者ID:iOSAppList,项目名称:modizer,代码行数:15,代码来源:Spc_Sfm.cpp
示例8: hash_
blargg_err_t hash_( Hash_Function& out ) const
{
hash_vgm_file( h, data.begin(), data.end() - data.begin(), out );
return (blargg_err_t)blargg_ok;
}
开发者ID:Kinglions,项目名称:modizer,代码行数:5,代码来源:Vgm_Emu.cpp
示例9: track_info_
blargg_err_t track_info_( track_info_t* out, int ) const
{
get_spc_info( header, xid6.begin(), xid6.size(), out );
return 0;
}
开发者ID:bazzinotti,项目名称:libGME_M,代码行数:5,代码来源:Spc_Emu.cpp
示例10: hash_
blargg_err_t hash_( Hash_Function& out ) const
{
hash_sfm_file( data.begin(), data.end() - data.begin(), out );
return blargg_ok;
}
开发者ID:iOSAppList,项目名称:modizer,代码行数:5,代码来源:Spc_Sfm.cpp
注:本文中的blargg_vector类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论