本文整理汇总了C++中Tiles::size方法的典型用法代码示例。如果您正苦于以下问题:C++ Tiles::size方法的具体用法?C++ Tiles::size怎么用?C++ Tiles::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tiles
的用法示例。
在下文中一共展示了Tiles::size方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: task_dispatcher
Image
ParallelRenderer::render (World& _world, Settings& _settings, Engine&
_engine, SuperSampling& _super_sampling)
{
TaskDispatcher task_dispatcher(_settings);
std::vector<std::future<Tiles>> futures(0);
for (unsigned i = 0; i < _settings.max_thread_count; i++)
{
// TODO can this be done better? it must be possible
futures.push_back(std::async(std::launch::async, [this, &task_dispatcher,
&_world, &_settings, &_engine, &_super_sampling] () {
return worker(task_dispatcher, _world, _settings, _engine,
_super_sampling); }));
}
for (unsigned i = 0; i < futures.size(); i++)
{
futures[i].wait();
}
Image final_image(_settings.area.size);
for (unsigned i = 0; i < futures.size(); i++)
{
Tiles tiles = futures[i].get();
for (unsigned j = 0; j < tiles.size(); j++)
{
final_image.paste(tiles[j].task.start, tiles[j].image);
}
}
return final_image;
}
示例2: get
const Tile* get(uint32_t id) const
{
//FIXME: Commenting out tiles in sprites.strf makes tiles.size() fail - it's being set to the first tile commented out.
assert(id < tiles.size());
Tile* tile = tiles[id];
if(!tile) {
log_warning << "Invalid tile: " << id << std::endl;
return tiles[0];
}
if(tile->images.size() == 0 && tile->imagespecs.size() != 0)
tile->load_images(tiles_path);
return tile;
}
示例3: GetRandomTile
inline Tile* Map::GetRandomTile(){
int randomTileIndex = GetRandomIntInRange(1, m_tiles.size()-1);
return &(m_tiles[randomTileIndex]);
}
示例4: get_max_tileid
uint32_t get_max_tileid() const
{
return tiles.size();
}