Browse Source

Added thread sort && info build for SpriteSorter

undefined
Benjamin ‘Touky’ Huet Sam Hocevar <sam@hocevar.net> 10 years ago
parent
commit
670a8914ad
3 changed files with 21 additions and 1 deletions
  1. +17
    -1
      src/lol/algorithm/aabb_tree.h
  2. +1
    -0
      src/lol/sys/thread.h
  3. +3
    -0
      src/sys/thread.cpp

+ 17
- 1
src/lol/algorithm/aabb_tree.h View File

@@ -168,7 +168,20 @@ public:
m_max_element = 1; m_max_element = 1;
AddLeaf(0); AddLeaf(0);
} }
~AABBTree() { }
~AABBTree()
{
Clear();
}
void CopySetup(const AABBTree<TE, TV, TB, child_nb>* src)
{
CopySetup(*src);
}
void CopySetup(const AABBTree<TE, TV, TB, child_nb>& src)
{
m_size = src.m_size;
m_max_depth = src.m_max_depth;
m_max_element = src.m_max_element;
}


private: private:
//-- //--
@@ -333,6 +346,9 @@ public:
} }


//-- //--
TV GetSize() { return m_size; }
int GetMaxDepth() { return m_max_depth; }
int GetMaxElement() { return m_max_element; }
void SetSize(TV size) { m_size = size; } void SetSize(TV size) { m_size = size; }
void SetMaxDepth(int max_depth) { m_max_depth = max_depth; } void SetMaxDepth(int max_depth) { m_max_depth = max_depth; }
void SetMaxElement(int max_element) { m_max_element = max_element; } void SetMaxElement(int max_element) { m_max_element = max_element; }


+ 1
- 0
src/lol/sys/thread.h View File

@@ -72,6 +72,7 @@ struct ThreadJobType
WORK_TODO, WORK_TODO,
WORK_DONE, WORK_DONE,
WORK_FAILED, WORK_FAILED,
WORK_FETCHED,
THREAD_STOP, THREAD_STOP,


MAX MAX


+ 3
- 0
src/sys/thread.cpp View File

@@ -116,7 +116,10 @@ void BaseThreadManager::TickGame(float seconds)
{ {
ThreadJob* job = result[i]; ThreadJob* job = result[i];
if (job->GetJobType() == ThreadJobType::WORK_DONE) if (job->GetJobType() == ThreadJobType::WORK_DONE)
{
job->SetJobType(ThreadJobType::WORK_FETCHED);
TreatResult(job); TreatResult(job);
}
} }
} }
} }


Loading…
Cancel
Save