Overlay the user Shaders/ over the shared one to avoid copying files

This commit is contained in:
Pierre Bourdon 2013-09-12 02:40:17 +02:00
commit e7213ca4b1
46 changed files with 41 additions and 23 deletions

View file

@ -2,6 +2,7 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
#include "CommonPaths.h"
#include "FileUtil.h"
#include "VideoCommon.h"
#include "VideoConfig.h"
@ -150,7 +151,12 @@ void ApplyShader()
// loading shader code
std::string code;
std::string path = File::GetUserPath(D_SHADERS_IDX) + g_ActiveConfig.sPostProcessingShader + ".txt";
std::string path = File::GetUserPath(D_SHADERS_IDX) + g_ActiveConfig.sPostProcessingShader + ".glsl";
if (!File::Exists(path))
{
// Fallback to shared user dir
path = File::GetSysDirectory() + SHADERS_DIR DIR_SEP + g_ActiveConfig.sPostProcessingShader + ".glsl";
}
if(!File::ReadFileToString(true, path.c_str(), code)) {
ERROR_LOG(VIDEO, "Post-processing shader not found: %s", path.c_str());
return;