mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
Ignore invalid shader cache index (Bug #1664)
This commit is contained in:
parent
8c81e22f3e
commit
d7acb7fc7d
30
extern/shiny/Main/Factory.cpp
vendored
30
extern/shiny/Main/Factory.cpp
vendored
@ -51,24 +51,32 @@ namespace sh
|
||||
{
|
||||
assert(mCurrentLanguage != Language_None);
|
||||
|
||||
if (boost::filesystem::exists (mPlatform->getCacheFolder () + "/lastModified.txt"))
|
||||
try
|
||||
{
|
||||
std::ifstream file;
|
||||
file.open(std::string(mPlatform->getCacheFolder () + "/lastModified.txt").c_str());
|
||||
|
||||
std::string line;
|
||||
while (getline(file, line))
|
||||
if (boost::filesystem::exists (mPlatform->getCacheFolder () + "/lastModified.txt"))
|
||||
{
|
||||
std::string sourceFile = line;
|
||||
std::ifstream file;
|
||||
file.open(std::string(mPlatform->getCacheFolder () + "/lastModified.txt").c_str());
|
||||
|
||||
if (!getline(file, line))
|
||||
assert(0);
|
||||
std::string line;
|
||||
while (getline(file, line))
|
||||
{
|
||||
std::string sourceFile = line;
|
||||
|
||||
int modified = boost::lexical_cast<int>(line);
|
||||
if (!getline(file, line))
|
||||
assert(0);
|
||||
|
||||
mShadersLastModified[sourceFile] = modified;
|
||||
int modified = boost::lexical_cast<int>(line);
|
||||
|
||||
mShadersLastModified[sourceFile] = modified;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
std::cerr << "Failed to load shader modification index: " << e.what() << std::endl;
|
||||
mShadersLastModified.clear();
|
||||
}
|
||||
|
||||
// load configurations
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user