From 25603464d1ea8f2286d2874d9b85e96cda276d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20=E2=80=98Touky=E2=80=99=20Huet?= Date: Tue, 21 Apr 2015 02:54:26 +0000 Subject: [PATCH] Added DRAWGROUP_NONE for entities that don't want to be DrawTicked (for Batcher entities or SpatialPartitioning) --- src/entity.h | 3 ++- src/ticker.cpp | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/entity.h b/src/entity.h index 8c985ac3..212e222d 100644 --- a/src/entity.h +++ b/src/entity.h @@ -107,7 +107,8 @@ protected: DRAWGROUP_IMGUI, DRAWGROUP_CAPTURE, - DRAWGROUP_END //Must be the last element + DRAWGROUP_END, //Must be the next-to-last element + DRAWGROUP_NONE //This group is for non draw-ticked } m_drawgroup; diff --git a/src/ticker.cpp b/src/ticker.cpp index 8e27f7eb..b155d635 100644 --- a/src/ticker.cpp +++ b/src/ticker.cpp @@ -203,6 +203,7 @@ void TickerData::DiskThreadMain() } #endif /* LOL_FEATURE_THREADS */ +//----------------------------------------------------------------------------- void TickerData::GameThreadTick() { Profiler::Stop(Profiler::STAT_TICK_FRAME); @@ -329,7 +330,8 @@ void TickerData::GameThreadTick() data->m_todolist.Remove(-1); data->m_list[e->m_gamegroup].Push(e); - data->m_list[e->m_drawgroup].Push(e); + if (e->m_drawgroup != Entity::DRAWGROUP_NONE) + data->m_list[e->m_drawgroup].Push(e); // Initialize the entity e->InitGame(); @@ -364,6 +366,7 @@ void TickerData::GameThreadTick() Profiler::Stop(Profiler::STAT_TICK_GAME); } +//----------------------------------------------------------------------------- void TickerData::DrawThreadTick() { Profiler::Start(Profiler::STAT_TICK_DRAW); @@ -429,6 +432,7 @@ void Ticker::SetStateWhenMatch(Entity * /* entity */, uint32_t /* state */, } +//----------------------------------------------------------------------------- void Ticker::Setup(float fps) { data->fps = fps;