Пример #1
0
void SalorCookieJar::setup() {
    loadFromDisk();

    m_readonlyMode = customerScreenId != "";
    if (m_readonlyMode) {
        qDebug() << "SalorCookieJar::setup(): readonly mode: never writing any cookies, but loading them regularly from the cookiejar file";
        connect(&m_timer, SIGNAL(timeout()), this, SLOT(loadFromDisk()));
        m_timer.start();
    } else {
        qDebug() << "SalorCookieJar::setup(): normal mode";
    }
}
Пример #2
0
void ImageScanner::newFile(int albumId)
{
    loadFromDisk();
    addImage(albumId);

    if (!scanFromIdenticalFile())
    {
        scanFile(NewScan);
    }
}
Пример #3
0
void TestBrowserCookieJar::setDiskStorageEnabled(bool enabled)
{
    m_storageEnabled = enabled;

    if (enabled && allCookies().isEmpty())
        loadFromDisk();

    // When disabling, save current cookies.
    if (!enabled && !allCookies().isEmpty())
        scheduleSaveToDisk();
}
Пример #4
0
 void FeatureIndexer :: loadOrBuild()
 {
   if (!loadFromDisk())
   {
     ntk_dbg(1) << "Could not load simple sift database indexed, rebuilding.";
     rebuild();
     saveToDisk();
   }
   else
   {
     ntk_dbg(1) << "FeatureIndexer reloaded from: "
         << m_db.directory() + "/" + getIndexerFilename();
   }
 }
Пример #5
0
Chunk::Chunk(Vec2i chunkCoords, Chunk* northChunk,Chunk* southChunk,Chunk* eastChunk,Chunk* westChunk) 
	:	m_chunkCoords(chunkCoords),
		m_northChunk(northChunk),
		m_southChunk(southChunk),
		m_eastChunk(eastChunk),
		m_westChunk(westChunk)
{
	m_enableCulling = true;
	m_vertexes.reserve(20000);
	m_lightDirtyIndex.reserve(5000);
	m_vboID = 0;
	m_block = new Block[BLOCKS_IN_A_CHUNK];
	m_pumpkinCount = 0;

	if(m_northChunk != nullptr)
	{
		m_northChunk->m_southChunk = this;
		m_northChunk->m_isDirty = true;
		m_northChunk->checkBoundary();
	}

	if(m_southChunk != nullptr)
	{
		m_southChunk->m_northChunk = this;
		m_southChunk->m_isDirty = true;
		m_southChunk->checkBoundary();
	}

	if(m_westChunk != nullptr)
	{
		m_westChunk->m_eastChunk = this;
		m_westChunk->m_isDirty = true;
		m_westChunk->checkBoundary();
	}

	if(m_eastChunk != nullptr)
	{
		m_eastChunk->m_westChunk = this;
		m_eastChunk->m_isDirty = true;
		m_eastChunk->checkBoundary();
	}

	if(!loadFromDisk())
		generateBlocks();
	
	initialLightLevel();
	sendList(BLOCKS_IN_A_CHUNK);

	m_timeSinceLastUpdate = 0.1f;
}
Пример #6
0
void ImageScanner::copiedFrom(int albumId, qlonglong srcId)
{
    loadFromDisk();
    addImage(albumId);

    // first use source, if it exists
    if (!copyFromSource(srcId))

        // check if we can establish identity
        if (!scanFromIdenticalFile())
            // scan newly
        {
            scanFile(NewScan);
        }
}
Пример #7
0
void ScreenSpaceImage::loadTexture() {
    std::unique_ptr<ghoul::opengl::Texture> texture = nullptr;
    if (!_downloadImage)
        texture = std::move(loadFromDisk());
    else
        texture = std::move(loadFromMemory());

    if (texture) {
        // LDEBUG("Loaded texture from '" << absPath(_texturePath) << "'");
        texture->uploadTexture();

        // Textures of planets looks much smoother with AnisotropicMipMap rather than linear
        texture->setFilter(ghoul::opengl::Texture::FilterMode::Linear);

        _texture = std::move(texture);
    }
}
Пример #8
0
PotreeWriterNode *PotreeWriterNode::add(Point &point){
	addCalledSinceLastFlush = true;

	// load grid from disk to memory, if necessary
	if(grid->numAccepted != numAccepted){
		loadFromDisk();
	}

	Vector3<double> position(point.x, point.y, point.z);
	bool accepted = grid->add(position);
	//float minGap = grid->add(Vector3<double>(point.x, point.y, point.z));
	//bool accepted = minGap > spacing;
	//int targetLevel = ceil(log((1/minGap) * spacing) / log(2));
	//
	//if(targetLevel > maxLevel){
	//	return NULL;
	//}

	if(accepted){
		cache.push_back(point);
		Vector3<double> position(point.x, point.y, point.z);
		acceptedAABB.update(position);
		potreeWriter->numAccepted++;
		numAccepted++;

		return this;
	}else if(level < maxLevel){
		// try adding point to higher level

		int childIndex = nodeIndex(aabb, point);
		if(childIndex >= 0){
			PotreeWriterNode *child = children[childIndex];

			// create child node if not existent
			if(child == NULL){
				child = createChild(childIndex);
			}

			return child->add(point);
			//child->add(point, targetLevel);
		} else {
			return NULL;
		}
	}
	return NULL;
}
Пример #9
0
void assets::Texture::reload()
{
    SDL_LogDebug(client::PORTAL_LOG_CATEGORY_ASSETS, "Reloading texture: \"%s\"", name.c_str());

    loadFromDisk(path);
}
Пример #10
0
void ImageScanner::rescan()
{
    loadFromDisk();
    updateImage();
    scanFile(Rescan);
}
Пример #11
0
void ImageScanner::newFileFullScan(int albumId)
{
    loadFromDisk();
    addImage(albumId);
    scanFile(NewScan);
}
Пример #12
0
void ItemScanner::fileModified()
{
    loadFromDisk();
    prepareUpdateImage();
    scanFile(ModifiedScan);
}