diff --git a/README.md b/README.md index 4c96792..c284e00 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # GTFramework -Goluah Task Framework ver0.99c +Goluah Task Framework ver0.99d 「Goluah!」から流用したゲーム開発向け汎用タスクシステム diff --git a/src/system/task.cpp b/src/system/task.cpp index 543dbaf..4fabe3f 100644 --- a/src/system/task.cpp +++ b/src/system/task.cpp @@ -273,7 +273,6 @@ namespace GTF { TaskList::iterator i, ied; shared_ptr pex; - auto& drawList = ex_stack.top().drawList; //r^XN擾 assert(ex_stack.size() != 0); @@ -281,11 +280,11 @@ namespace GTF pex = ex_stack.top().value; } - auto iv = drawList.begin(); - auto iedv = pex ? drawList.upper_bound(pex->GetDrawPriority()) : drawList.end(); + auto iv = ex_stack.top().drawList.begin(); + auto iedv = pex ? ex_stack.top().drawList.upper_bound(pex->GetDrawPriority()) : ex_stack.top().drawList.end(); auto ivBG = drawListBG.begin(); const auto iedvBG = drawListBG.end(); - auto DrawAndProceed = [&](DrawPriorityMap::iterator& iv) + auto DrawAndProceed = [](DrawPriorityMap::iterator& iv, DrawPriorityMap& drawList) { auto is = iv->second.lock(); @@ -305,8 +304,8 @@ namespace GTF try{ #endif while (ivBG != iedvBG && ivBG->first <= iv->first) - DrawAndProceed(ivBG); - DrawAndProceed(iv); + DrawAndProceed(ivBG, drawListBG); + DrawAndProceed(iv, ex_stack.top().drawList); #ifdef _CATCH_WHILE_RENDER }catch(...){ OutputLog("catch while draw : %X %s", *iv, typeid(*(*iv).lock()).name()); @@ -323,12 +322,12 @@ namespace GTF //` assert(iv == iedv); - iedv = drawList.end(); + iedv = ex_stack.top().drawList.end(); DrawAll(); // c풓^XN while (ivBG != iedvBG) - DrawAndProceed(ivBG); + DrawAndProceed(ivBG, drawListBG); } void CTaskManager::RemoveTaskByID(unsigned int id) @@ -365,12 +364,6 @@ namespace GTF } - //ŏʂɂGNXN[Vu^XNQg - CTaskManager::ExTaskPtr CTaskManager::GetTopExclusiveTask() - { - return ex_stack.top().value; - } - //wID̔r^XN܂Terminate/pop void CTaskManager::RevertExclusiveTaskByID(unsigned int id) { diff --git a/src/system/task.h b/src/system/task.h index 9e55b39..159a7a0 100644 --- a/src/system/task.h +++ b/src/system/task.h @@ -126,7 +126,10 @@ namespace GTF BgTaskPtr AddTask(CBackgroundTaskBase *newTask); //!< 풓^XNlj void RemoveTaskByID(unsigned int id); //!< wIDƒ^XN̏@FExclusive^XN̓`FbNȂ void RevertExclusiveTaskByID(unsigned int id); //!< wID̔r^XN܂Terminate/pop - ExTaskPtr GetTopExclusiveTask(); //!< ŏʂɂGNXN[Vu^XNQg + ExTaskPtr GetTopExclusiveTask() //!< ŏʂɂGNXN[Vu^XNQg + { + return ex_stack.top().value; + } //!wID̒ʏ^XN擾 TaskPtr FindTask(unsigned int id) @@ -143,7 +146,7 @@ namespace GTF //! Cӂ̃NX^̃^XN擾iʏE풓pj template shared_ptr FindTask(unsigned int id) { - return dynamic_pointer_cast(FindTask_intl(id).lock()); + return dynamic_pointer_cast(FindTask_impl(id).lock()); } void Execute(double elapsedTime); //!< e^XNExecute֐R[ @@ -187,13 +190,13 @@ namespace GTF } private: - template::value>::type> - TaskPtr FindTask_intl(unsigned int id) + template::value>> + TaskPtr FindTask_impl(unsigned int id) { return FindTask(id); } - template::value>::type> - BgTaskPtr FindTask_intl(unsigned int id) + template::value>> + BgTaskPtr FindTask_impl(unsigned int id) { return FindBGTask(id); }