ThreadBase rewritten (wip)

This commit is contained in:
Nekotekina 2015-07-01 01:25:52 +03:00
parent b7a320fbbd
commit 3aefa2b4e1
85 changed files with 1960 additions and 2183 deletions

View file

@ -131,35 +131,33 @@ void GLVertexDecompilerThread::Task()
}
GLVertexProgram::GLVertexProgram()
: m_decompiler_thread(nullptr)
, id(0)
{
}
GLVertexProgram::~GLVertexProgram()
{
if (m_decompiler_thread)
{
Wait();
if (m_decompiler_thread->IsAlive())
{
m_decompiler_thread->Stop();
}
//if (m_decompiler_thread)
//{
// Wait();
// if (m_decompiler_thread->IsAlive())
// {
// m_decompiler_thread->Stop();
// }
delete m_decompiler_thread;
m_decompiler_thread = nullptr;
}
// delete m_decompiler_thread;
// m_decompiler_thread = nullptr;
//}
Delete();
}
void GLVertexProgram::Wait()
{
if (m_decompiler_thread && m_decompiler_thread->IsAlive())
{
m_decompiler_thread->Join();
}
}
//void GLVertexProgram::Wait()
//{
// if (m_decompiler_thread && m_decompiler_thread->IsAlive())
// {
// m_decompiler_thread->Join();
// }
//}
void GLVertexProgram::Decompile(RSXVertexProgram& prog)
{
@ -167,23 +165,23 @@ void GLVertexProgram::Decompile(RSXVertexProgram& prog)
decompiler.Task();
}
void GLVertexProgram::DecompileAsync(RSXVertexProgram& prog)
{
if (m_decompiler_thread)
{
Wait();
if (m_decompiler_thread->IsAlive())
{
m_decompiler_thread->Stop();
}
delete m_decompiler_thread;
m_decompiler_thread = nullptr;
}
m_decompiler_thread = new GLVertexDecompilerThread(prog.data, shader, parr);
m_decompiler_thread->Start();
}
//void GLVertexProgram::DecompileAsync(RSXVertexProgram& prog)
//{
// if (m_decompiler_thread)
// {
// Wait();
// if (m_decompiler_thread->IsAlive())
// {
// m_decompiler_thread->Stop();
// }
//
// delete m_decompiler_thread;
// m_decompiler_thread = nullptr;
// }
//
// m_decompiler_thread = new GLVertexDecompilerThread(prog.data, shader, parr);
// m_decompiler_thread->Start();
//}
void GLVertexProgram::Compile()
{