Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/TextureConverter.h
Show All 13 Lines | |||||
* You should have received a copy of the GNU General Public License | * You should have received a copy of the GNU General Public License | ||||
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | ||||
*/ | */ | ||||
#ifndef INCLUDED_TEXTURECONVERTER | #ifndef INCLUDED_TEXTURECONVERTER | ||||
#define INCLUDED_TEXTURECONVERTER | #define INCLUDED_TEXTURECONVERTER | ||||
#include "lib/file/vfs/vfs.h" | #include "lib/file/vfs/vfs.h" | ||||
#include "lib/external_libraries/libsdl.h" | |||||
#include "TextureManager.h" | #include "TextureManager.h" | ||||
#include <thread> | #include <thread> | ||||
class MD5; | class MD5; | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 171 Lines • ▼ Show 20 Lines | |||||
private: | private: | ||||
static void RunThread(CTextureConverter* data); | static void RunThread(CTextureConverter* data); | ||||
PIVFS m_VFS; | PIVFS m_VFS; | ||||
bool m_HighQuality; | bool m_HighQuality; | ||||
std::thread m_WorkerThread; | std::thread m_WorkerThread; | ||||
std::mutex m_WorkerMutex; | std::mutex m_WorkerMutex; | ||||
SDL_sem* m_WorkerSem; | std::condition_variable m_WorkerCV; | ||||
struct ConversionRequest; | struct ConversionRequest; | ||||
struct ConversionResult; | struct ConversionResult; | ||||
std::deque<shared_ptr<ConversionRequest> > m_RequestQueue; // protected by m_WorkerMutex | std::deque<shared_ptr<ConversionRequest> > m_RequestQueue; // protected by m_WorkerMutex | ||||
std::deque<shared_ptr<ConversionResult> > m_ResultQueue; // protected by m_WorkerMutex | std::deque<shared_ptr<ConversionResult> > m_ResultQueue; // protected by m_WorkerMutex | ||||
bool m_Shutdown; // protected by m_WorkerMutex | bool m_Shutdown; // protected by m_WorkerMutex | ||||
}; | }; | ||||
#endif // INCLUDED_TEXTURECONVERTER | #endif // INCLUDED_TEXTURECONVERTER |
Wildfire Games · Phabricator