本文整理汇总了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 ) );
}
示例2: TilePos
void OMap::Impl::initCameraStartPos(const VariantMap& vm, PlayerCityPtr ioCity)
{
int mapSize = ioCity->tilemap().size();
ioCity->setCameraPos( TilePos( mapSize / 2, mapSize / 2 ) );
}
示例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 );