forked from mirror/openmw-tes3mp
Merge branch 'master' into next
This commit is contained in:
commit
1a079ec8d3
4 changed files with 22 additions and 8 deletions
|
@ -125,6 +125,12 @@ if(APPLE)
|
|||
find_library(COCOA_FRAMEWORK Cocoa)
|
||||
find_library(IOKIT_FRAMEWORK IOKit)
|
||||
target_link_libraries(openmw ${CARBON_FRAMEWORK} ${COCOA_FRAMEWORK} ${IOKIT_FRAMEWORK})
|
||||
|
||||
if (FFMPEG_FOUND)
|
||||
find_library(COREVIDEO_FRAMEWORK CoreVideo)
|
||||
find_library(VDA_FRAMEWORK VideoDecodeAcceleration)
|
||||
target_link_libraries(openmw ${COREVIDEO_FRAMEWORK} ${VDA_FRAMEWORK})
|
||||
endif()
|
||||
endif(APPLE)
|
||||
|
||||
if(DPKG_PROGRAM)
|
||||
|
|
|
@ -160,6 +160,7 @@ void FFmpeg_Decoder::open(const std::string &fname)
|
|||
{
|
||||
if(mFormatCtx->streams[j]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
|
||||
{
|
||||
mFormatCtx->streams[j]->codec->request_sample_fmt = AV_SAMPLE_FMT_S16;
|
||||
mStream = &mFormatCtx->streams[j];
|
||||
break;
|
||||
}
|
||||
|
|
16
extern/shiny/Main/Factory.cpp
vendored
16
extern/shiny/Main/Factory.cpp
vendored
|
@ -15,6 +15,7 @@
|
|||
namespace sh
|
||||
{
|
||||
Factory* Factory::sThis = 0;
|
||||
const std::string Factory::mBinaryCacheName = "binaryCache";
|
||||
|
||||
Factory& Factory::getInstance()
|
||||
{
|
||||
|
@ -198,8 +199,7 @@ namespace sh
|
|||
if (mShadersLastModified[sourceRelative] != lastModified)
|
||||
{
|
||||
// delete any outdated shaders based on this shader set
|
||||
removeCache (it->first);
|
||||
// remove the whole binary cache (removing only the individual shaders does not seem to be possible at this point with OGRE)
|
||||
if (removeCache (it->first))
|
||||
removeBinaryCache = true;
|
||||
}
|
||||
}
|
||||
|
@ -207,7 +207,8 @@ namespace sh
|
|||
{
|
||||
// if we get here, this is either the first run or a new shader file was added
|
||||
// in both cases we can safely delete
|
||||
removeCache (it->first);
|
||||
if (removeCache (it->first))
|
||||
removeBinaryCache = true;
|
||||
}
|
||||
mShaderSets.insert(std::make_pair(it->first, newSet));
|
||||
}
|
||||
|
@ -304,7 +305,7 @@ namespace sh
|
|||
|
||||
if (mPlatform->supportsShaderSerialization () && mReadMicrocodeCache && !removeBinaryCache)
|
||||
{
|
||||
std::string file = mPlatform->getCacheFolder () + "/shShaderCache.txt";
|
||||
std::string file = mPlatform->getCacheFolder () + "/" + mBinaryCacheName;
|
||||
if (boost::filesystem::exists(file))
|
||||
{
|
||||
mPlatform->deserializeShaders (file);
|
||||
|
@ -316,7 +317,7 @@ namespace sh
|
|||
{
|
||||
if (mPlatform->supportsShaderSerialization () && mWriteMicrocodeCache)
|
||||
{
|
||||
std::string file = mPlatform->getCacheFolder () + "/shShaderCache.txt";
|
||||
std::string file = mPlatform->getCacheFolder () + "/" + mBinaryCacheName;
|
||||
mPlatform->serializeShaders (file);
|
||||
}
|
||||
|
||||
|
@ -590,8 +591,9 @@ namespace sh
|
|||
m->createForConfiguration (configuration, 0);
|
||||
}
|
||||
|
||||
void Factory::removeCache(const std::string& pattern)
|
||||
bool Factory::removeCache(const std::string& pattern)
|
||||
{
|
||||
bool ret = false;
|
||||
if ( boost::filesystem::exists(mPlatform->getCacheFolder())
|
||||
&& boost::filesystem::is_directory(mPlatform->getCacheFolder()))
|
||||
{
|
||||
|
@ -620,10 +622,12 @@ namespace sh
|
|||
if (shaderName == pattern)
|
||||
{
|
||||
boost::filesystem::remove(file);
|
||||
ret = true;
|
||||
std::cout << "Removing outdated shader: " << file << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
5
extern/shiny/Main/Factory.hpp
vendored
5
extern/shiny/Main/Factory.hpp
vendored
|
@ -203,7 +203,10 @@ namespace sh
|
|||
MaterialInstance* findInstance (const std::string& name);
|
||||
MaterialInstance* searchInstance (const std::string& name);
|
||||
|
||||
void removeCache (const std::string& pattern);
|
||||
/// @return was anything removed?
|
||||
bool removeCache (const std::string& pattern);
|
||||
|
||||
static const std::string mBinaryCacheName;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue