From 553b2ef3c5b9ac49df77f1087f65aabff0de9821 Mon Sep 17 00:00:00 2001 From: Atsushi Nakagawa Date: Thu, 30 Mar 2017 13:10:42 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=BBDraw=E5=87=A6=E7=90=86=E3=81=AE?= =?UTF-8?q?=E5=B8=B8=E9=A7=90=E3=82=BF=E3=82=B9=E3=82=AF=E9=96=A2=E9=80=A3?= =?UTF-8?q?=E3=81=AE=E3=83=90=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3=20?= =?UTF-8?q?=E3=83=BB=E3=83=AD=E3=83=BC=E3=82=AB=E3=83=AB=E5=A4=89=E6=95=B0?= =?UTF-8?q?=E6=89=B1=E3=81=84=E3=81=AE=E5=8F=82=E7=85=A7=E3=82=92=E9=99=A4?= =?UTF-8?q?=E5=8E=BB=20=E3=83=BB=E5=BE=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- src/system/task.cpp | 21 +++++++-------------- src/system/task.h | 15 +++++++++------ 3 files changed, 17 insertions(+), 21 deletions(-) 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); }