本文整理汇总了C++中BinaryFile::read_string_long方法的典型用法代码示例。如果您正苦于以下问题:C++ BinaryFile::read_string_long方法的具体用法?C++ BinaryFile::read_string_long怎么用?C++ BinaryFile::read_string_long使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BinaryFile
的用法示例。
在下文中一共展示了BinaryFile::read_string_long方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: strstr
void MapReader1701::read_background(CMap& map, BinaryFile& mapfile)
{
//Read in background to use
mapfile.read_string_long(map.szBackgroundFile, 128);
for (short iBackground = 0; iBackground < 26; iBackground++) {
const char * szFindUnderscore = strstr(g_szBackgroundConversion[iBackground], "_");
// All items must have an underscore in g_szBackgroundConversion
assert(szFindUnderscore);
szFindUnderscore++;
if (!strcmp(szFindUnderscore, map.szBackgroundFile)) {
assert(strlen(g_szBackgroundConversion[iBackground]) <= 128);
strcpy(map.szBackgroundFile, g_szBackgroundConversion[iBackground]);
}
}
}
示例2:
void MapReader1800::read_tileset(BinaryFile& mapfile)
{
//Load tileset information
short iNumTilesets = (short)mapfile.read_i32();
TilesetTranslation * translation = new TilesetTranslation[iNumTilesets];
iMaxTilesetID = 0; //Figure out how big the translation array needs to be
for (short iTileset = 0; iTileset < iNumTilesets; iTileset++) {
short iTilesetID = mapfile.read_i32();
translation[iTileset].iID = iTilesetID;
if (iTilesetID > iMaxTilesetID)
iMaxTilesetID = iTilesetID;
mapfile.read_string_long(translation[iTileset].szName, 128);
}
translationid = new short[iMaxTilesetID + 1];
tilesetwidths = new short[iMaxTilesetID + 1];
tilesetheights = new short[iMaxTilesetID + 1];
for (short iTileset = 0; iTileset < iNumTilesets; iTileset++) {
short iID = translation[iTileset].iID;
translationid[iID] = g_tilesetmanager->GetIndexFromName(translation[iTileset].szName);
if (translationid[iID] == TILESETUNKNOWN) {
tilesetwidths[iID] = 1;
tilesetheights[iID] = 1;
} else {
tilesetwidths[iID] = g_tilesetmanager->GetTileset(translationid[iID])->GetWidth();
tilesetheights[iID] = g_tilesetmanager->GetTileset(translationid[iID])->GetHeight();
}
}
delete [] translation;
}
示例3:
void MapReader1702::read_background(CMap& map, BinaryFile& mapfile)
{
//Read in background to use
mapfile.read_string_long(map.szBackgroundFile, 128);
}