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


C++ PlayerCityPtr::setCameraPos方法代码示例

本文整理汇总了C++中PlayerCityPtr::setCameraPos方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerCityPtr::setCameraPos方法的具体用法?C++ PlayerCityPtr::setCameraPos怎么用?C++ PlayerCityPtr::setCameraPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PlayerCityPtr的用法示例。


在下文中一共展示了PlayerCityPtr::setCameraPos方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TilePos

void C3Map::Impl::initCameraStartPos(std::fstream &f, PlayerCityPtr ioCity)
{
  /*unsigned short int i = 0;
  unsigned short int j = 0;
  f.seekg(kCamera, std::ios::beg);
  f.read((char*)&i, 2);
  f.read((char*)&j, 2);*/
  int mapSize = ioCity->tilemap().size();

  ioCity->setCameraPos( TilePos( mapSize / 2, mapSize / 2 ) );
}
开发者ID:Ecordonnier,项目名称:caesaria-game,代码行数:11,代码来源:loader_map.cpp

示例2: TilePos

void OMap::Impl::initCameraStartPos(const VariantMap& vm, PlayerCityPtr ioCity)
{
  int mapSize = ioCity->tilemap().size();
  ioCity->setCameraPos( TilePos( mapSize / 2, mapSize / 2 ) );
}
开发者ID:dalerank,项目名称:caesaria-game,代码行数:5,代码来源:loader_omap.cpp

示例3: PKWareInputStream


//.........这里部分代码省略.........
            pk->readByte();
            pk->skip(106);
        }
        pk->empty();
        delete pk;
        int length;
        f.read((char*)&length, 4); // read next length :-)

        if (length <= 0)
            f.seekg(1200, std::ios::cur);
        else
            f.seekg(length, std::ios::cur);

        SkipCompressed(f);
        SkipCompressed(f);

        // 3x int
        f.read((char*)&tmp, 4);
        f.read((char*)&tmp, 4);
        f.read((char*)&tmp, 4);
        SkipCompressed(f);
        f.seekg(70, std::ios::cur);
        SkipCompressed(f); // skip building list
        f.seekg(208, std::ios::cur);
        SkipCompressed(f); // skip unknown
        f.seekg(788, std::ios::cur); // skip unused data
        f.read((char*)&tmp, 4); //mapsize

        int size = tmp;
        PlayerCityPtr oCity = game.city();
        Tilemap& oTilemap = oCity->tilemap();

        oCity->resize(size);
        oCity->setCameraPos( TilePos( 0, 0 ) );

        initEntryExit( f, game.city() );

        f.seekg(1312, std::ios::cur);
        char climate;
        f.read(&climate, 1);
        oCity->setClimate((ClimateType)climate);

        // here goes the WORK!


        // loads the graphics map
        int border_size = (162 - size) / 2;

        std::map< int, std::map< int, unsigned char > > edgeData;

        game.city()->setCameraPos( TilePos( size/2, size/2 ) );

        for (int itA = 0; itA < size; ++itA)
        {
            for (int itB = 0; itB < size; ++itB)
            {
                int i = itB;
                int j = size - itA - 1;

                int index = 162 * (border_size + itA) + border_size + itB;

                Tile& tile = oTilemap.at(i, j);

                unsigned int imgId = graphicGrid[index];
                Picture pic = imgid::toPicture( imgId );
开发者ID:KSLcom,项目名称:caesaria-game,代码行数:66,代码来源:loader_sav.cpp


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