Example #1
0
void World::fillArea(Int x, Int y, ViewCallback& callback) {
    // TODO: Do this as a background task.
    for(Int column = x - drawDistance; column < x + drawDistance; column++) {
        for(Int row = y - drawDistance; row < y + drawDistance; row++) {
            callback.addChunk(fetchChunk(column, row));
        }
    }
}
bool RemoteMergedArray::nextChunkPos(size_t stream, AttributeID attId, Coordinates& pos)
{
    if (!_hasPositions[attId][stream]) {
        // Requesting position data first time
        if (!fetchChunk(stream, attId, NULL)) {
            return false;
        }
    }
    if (_nextPositions[attId][stream].size() > 0) {
        pos = _nextPositions[attId][stream];
        return true;
    }
    return false;
}
ConstChunk const* RemoteMergedArray::nextChunkBody(size_t stream, AttributeID attId, MemChunk& chunk, Coordinates const& pos)
{
    return fetchChunk(stream, attId, &chunk) ? &chunk : NULL;
}