本文整理汇总了C++中FileList::getString方法的典型用法代码示例。如果您正苦于以下问题:C++ FileList::getString方法的具体用法?C++ FileList::getString怎么用?C++ FileList::getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileList
的用法示例。
在下文中一共展示了FileList::getString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PakFiles
int PakFiles( FileList &source_list, const char *output_path )
{
//char buffer[1024];
//char output_file[256];
//char output_path[1024];
//char *token;
//char fname[_MAX_FNAME];
//char ext[_MAX_EXT];
if ( source_list.containsItems() == 0 )
return( _pak_files_ok );
/*
_splitpath( source_list.getString( 0 ), 0, 0, fname, ext );
token = strtok( fname, "0123456789" );
strcpy( output_file, token );
strcpy( pak_file_name, output_file );
strcat( pak_file_name, ".pak" );
strcpy( output_path, output_dir );
strcat( output_path, output_file );
strcat( output_path, ".pak" );
*/
Surface surface;
int frame_count;
Palette pal;
pal.initNoColorTables("netp.act");
frame_count = source_list.containsItems();
if ( LoadSurface( source_list.getString( 0 ), surface ) == _load_surface_invalid_type )
return( _pak_files_invalid_source );
Surface work_surface( surface.getPixX(), surface.getPixY(), surface.getPixX(), frame_count );
for( int i = 0; i < frame_count; i++ )
{
work_surface.setFrame(i);
if ( LoadSurface( source_list.getString( i ), surface ) == _load_surface_invalid_type )
return( _pak_files_invalid_source );
work_surface.fill(Color::orange);
surface.blt(work_surface);
}
PackedSurface packedSurface;
packedSurface.pack(work_surface);
packedSurface.save(output_path);
surface.free();
packedSurface.free();
work_surface.free();
return( _pak_files_ok );
}
示例2: UnitPakFiles
//--------------------------------------------------------------------------
int UnitPakFiles(FileList &source_list, const char *output_path)
{
if (source_list.containsItems() == 0)
{
return(_pak_files_ok);
}
Surface surface;
int frameCount;
frameCount = source_list.containsItems();
if (LoadSurface(source_list.getString(0), surface) == _load_surface_invalid_type)
{
return _pak_files_invalid_source;
}
Surface workSurface(surface.getPixX(), surface.getPixY(), surface.getPixX(), frameCount);
workSurface.fillAll(0);
for (int i = 0; i < frameCount; i++)
{
workSurface.setFrame(i);
if (LoadSurface(source_list.getString(i), surface) == _load_surface_invalid_type)
{
return _pak_files_invalid_source;
}
PIX background = surface.getPixel(0, 0);
// Walk through the surface image and suck out the shadow.
for (int x = 0; x < surface.getPixX(); x++)
{
for (int y = 0; y < surface.getPixY(); y++)
{
PIX color = surface.getPixel(x, y);
if (color != background)
{
workSurface.putPixel(x, y, color);
}
}
}
}
PackedSurface packedSurface;
packedSurface.pack(workSurface);
packedSurface.save(output_path);
return _pak_files_ok;
}