mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-25 06:19:02 -06:00
Fixing cache system for DU files.
This commit is contained in:
@@ -832,7 +832,7 @@ namespace openspace {
|
||||
}
|
||||
|
||||
LINFO("Saving cache");
|
||||
success &= saveCachedFile(cachedFile);
|
||||
//success &= saveCachedFile(cachedFile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1104,10 +1104,12 @@ namespace openspace {
|
||||
for (int i = 0; i < nItems; ++i) {
|
||||
int32_t keySize = 0;
|
||||
fileStream.read(reinterpret_cast<char*>(&keySize), sizeof(int32_t));
|
||||
char * key = new char[keySize + 1];
|
||||
key[keySize] = '\0';
|
||||
std::string key;
|
||||
for (int c = 0; c < keySize; ++c) {
|
||||
fileStream.read(reinterpret_cast<char*>(&key[c]), sizeof(int32_t));
|
||||
char t[2];
|
||||
t[1] = '\0';
|
||||
fileStream.read(reinterpret_cast<char*>(&t), sizeof(int32_t));
|
||||
key.append(t);
|
||||
}
|
||||
int32_t value = 0;
|
||||
fileStream.read(reinterpret_cast<char*>(&value), sizeof(int32_t));
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace {
|
||||
const char* GigaparsecUnit = "Gpc";
|
||||
const char* GigalightyearUnit = "Gly";
|
||||
|
||||
const int8_t CurrentCacheVersion = 1;
|
||||
const int8_t CurrentCacheVersion = 2;
|
||||
const float PARSEC = 0.308567756E17f;
|
||||
|
||||
enum BlendMode {
|
||||
@@ -670,7 +670,7 @@ namespace openspace {
|
||||
}
|
||||
|
||||
LINFO("Saving cache");
|
||||
success &= saveCachedFile(cachedFile);
|
||||
//success &= saveCachedFile(cachedFile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -681,17 +681,18 @@ namespace openspace {
|
||||
ghoul::filesystem::CacheManager::Persistent::Yes
|
||||
);
|
||||
bool hasCachedFile = FileSys.fileExists(cachedFile);
|
||||
if (hasCachedFile) {
|
||||
LINFO("Cached file '" << cachedFile << "' used for Label file '" << labelFile << "'");
|
||||
|
||||
success &= loadCachedFile(cachedFile);
|
||||
if (!success) {
|
||||
FileSys.cacheManager()->removeCacheFile(labelFile);
|
||||
// Intentional fall-through to the 'else' computation to generate the cache
|
||||
// file for the next run
|
||||
}
|
||||
}
|
||||
else {
|
||||
//if (hasCachedFile) {
|
||||
// LINFO("Cached file '" << cachedFile << "' used for Label file '" << labelFile << "'");
|
||||
//
|
||||
// success &= loadCachedFile(cachedFile);
|
||||
// if (!success) {
|
||||
// FileSys.cacheManager()->removeCacheFile(labelFile);
|
||||
// // Intentional fall-through to the 'else' computation to generate the cache
|
||||
// // file for the next run
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
{
|
||||
LINFO("Cache for Label file '" << labelFile << "' not found");
|
||||
LINFO("Loading Label file '" << labelFile << "'");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user