本文整理汇总了C++中MapBlock::getDayNightDiff方法的典型用法代码示例。如果您正苦于以下问题:C++ MapBlock::getDayNightDiff方法的具体用法?C++ MapBlock::getDayNightDiff怎么用?C++ MapBlock::getDayNightDiff使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapBlock
的用法示例。
在下文中一共展示了MapBlock::getDayNightDiff方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetNextBlocks
//.........这里部分代码省略.........
{
continue;
}
}
/*
Check if map has this block
*/
MapBlock *block = env->getMap().getBlockNoCreateNoEx(p);
bool surely_not_found_on_disk = false;
bool block_is_invalid = false;
if (block) {
// Reset usage timer, this block will be of use in the future.
block->resetUsageTimer();
// Block is dummy if data doesn't exist.
// It means it has been not found from disk and not generated
if (block->isDummy()) {
surely_not_found_on_disk = true;
}
if (!block->isGenerated())
block_is_invalid = true;
/*
If block is not close, don't send it unless it is near
ground level.
Block is near ground level if night-time mesh
differs from day-time mesh.
*/
if (d >= d_opt) {
if (!block->getDayNightDiff())
continue;
}
if (occ_cull && !block_is_invalid &&
env->getMap().isBlockOccluded(block, cam_pos_nodes)) {
continue;
}
}
/*
If block has been marked to not exist on disk (dummy)
and generating new ones is not wanted, skip block.
*/
if (!generate && surely_not_found_on_disk) {
// get next one.
continue;
}
/*
Add inexistent block to emerge queue.
*/
if(block == NULL || surely_not_found_on_disk || block_is_invalid)
{
if (emerge->enqueueBlockEmerge(peer_id, p, generate)) {
if (nearest_emerged_d == -1)
nearest_emerged_d = d;
} else {
if (nearest_emergefull_d == -1)
nearest_emergefull_d = d;
goto queue_full_break;
}