当前位置: 首页>>代码示例>>C++>>正文


C++ BinaryFile::read_string_long方法代码示例

本文整理汇总了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]);
        }
    }
}
开发者ID:HerbFargus,项目名称:supermariowar,代码行数:19,代码来源:MapReader17xx.cpp

示例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;
}
开发者ID:HerbFargus,项目名称:supermariowar,代码行数:38,代码来源:MapReader18xx.cpp

示例3:

void MapReader1702::read_background(CMap& map, BinaryFile& mapfile)
{
    //Read in background to use
    mapfile.read_string_long(map.szBackgroundFile, 128);
}
开发者ID:HerbFargus,项目名称:supermariowar,代码行数:5,代码来源:MapReader17xx.cpp


注:本文中的BinaryFile::read_string_long方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。