1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-08 08:41:32 +00:00

fixed include, cleaned comments and indentation

This commit is contained in:
florent.teppe 2022-08-03 20:50:39 +02:00
parent 31d412527d
commit f78fa989ee

View file

@ -5,7 +5,8 @@
#include <sstream> #include <sstream>
#include <regex> #include <regex>
#include <filesystem> #include <filesystem>
#include <unordered_set> #include <set>
#include <unordered_map>
#include <osg/Program> #include <osg/Program>
#include <components/debug/debuglog.hpp> #include <components/debug/debuglog.hpp>
@ -406,7 +407,6 @@ namespace Shader
std::filesystem::path pathShaderToTest = (shader.first); std::filesystem::path pathShaderToTest = (shader.first);
std::filesystem::file_time_type write_time = std::filesystem::last_write_time(pathShaderToTest); std::filesystem::file_time_type write_time = std::filesystem::last_write_time(pathShaderToTest);
//Log(Debug::Info) << std::format("{} write time is {} compared to {} ", shader.first, write_time, mLastAutoRecompileTime);
if (write_time.time_since_epoch() > mLastAutoRecompileTime.time_since_epoch()) if (write_time.time_since_epoch() > mLastAutoRecompileTime.time_since_epoch())
{ {
for (const ShaderManager:: MapKey& descriptor : shader.second) for (const ShaderManager:: MapKey& descriptor : shader.second)
@ -416,7 +416,6 @@ namespace Shader
ShaderManager::TemplateMap::iterator templateIt = Manager.mShaderTemplates.find(templateName); //Can't be Null, if we're here it means the template was added ShaderManager::TemplateMap::iterator templateIt = Manager.mShaderTemplates.find(templateName); //Can't be Null, if we're here it means the template was added
std::set<std::filesystem::path> insertedPaths; std::set<std::filesystem::path> insertedPaths;
{
std::filesystem::path path = (std::filesystem::path(Manager.mPath) / templateName); std::filesystem::path path = (std::filesystem::path(Manager.mPath) / templateName);
std::ifstream stream; std::ifstream stream;
stream.open(path); stream.open(path);
@ -437,8 +436,7 @@ namespace Shader
} }
templateIt->second = source; templateIt->second = source;
//if (shaderIt == Manager.mShaders.end())
{
std::string shaderSource = templateIt->second; std::string shaderSource = templateIt->second;
std::vector<std::string> linkedShaderNames; std::vector<std::string> linkedShaderNames;
if (!Manager.createSourceFromTemplate(shaderSource, linkedShaderNames, templateName, descriptor.second)) if (!Manager.createSourceFromTemplate(shaderSource, linkedShaderNames, templateName, descriptor.second))
@ -446,8 +444,7 @@ namespace Shader
break; break;
} }
shaderIt->second->setShaderSource(shaderSource); shaderIt->second->setShaderSource(shaderSource);
}
}
} }
} }
} }