Index: source/graphics/TextureConverter.h =================================================================== --- source/graphics/TextureConverter.h +++ source/graphics/TextureConverter.h @@ -207,9 +207,11 @@ PIVFS m_VFS; bool m_HighQuality; +#if CONFIG2_NVTT std::thread m_WorkerThread; std::mutex m_WorkerMutex; std::condition_variable m_WorkerCV; +#endif struct ConversionRequest; struct ConversionResult; Index: source/graphics/TextureConverter.cpp =================================================================== --- source/graphics/TextureConverter.cpp +++ source/graphics/TextureConverter.cpp @@ -297,16 +297,18 @@ // to avoid bugs caused by ABI changes #if CONFIG2_NVTT ENSURE(nvtt::version() >= NVTT_VERSION); -#endif m_WorkerThread = std::thread(Threading::HandleExceptions::Wrapper, this); // Maybe we should share some centralised pool of worker threads? // For now we'll just stick with a single thread for this specific use. +#endif + } CTextureConverter::~CTextureConverter() { +#if CONFIG2_NVTT // Tell the thread to shut down { std::lock_guard lock(m_WorkerMutex); @@ -326,6 +328,7 @@ // Wait for it to shut down cleanly m_WorkerThread.join(); +#endif } bool CTextureConverter::ConvertTexture(const CTexturePtr& texture, const VfsPath& src, const VfsPath& dest, const Settings& settings) @@ -535,17 +538,19 @@ bool CTextureConverter::IsBusy() { +#if CONFIG2_NVTT std::lock_guard lock(m_WorkerMutex); return !m_RequestQueue.empty(); +#else + return false; +#endif } void CTextureConverter::RunThread(CTextureConverter* textureConverter) { +#if CONFIG2_NVTT debug_SetThreadName("TextureConverter"); g_Profiler2.RegisterCurrentThread("texconv"); - -#if CONFIG2_NVTT - // Wait until the main thread wakes us up while (true) {