Browse Source

Added DRAWGROUP_NONE for entities that don't want to be DrawTicked (for Batcher entities or SpatialPartitioning)

undefined
Benjamin ‘Touky’ Huet Sam Hocevar <sam@hocevar.net> 9 years ago
parent
commit
25603464d1
2 changed files with 7 additions and 2 deletions
  1. +2
    -1
      src/entity.h
  2. +5
    -1
      src/ticker.cpp

+ 2
- 1
src/entity.h View File

@@ -107,7 +107,8 @@ protected:
DRAWGROUP_IMGUI, DRAWGROUP_IMGUI,
DRAWGROUP_CAPTURE, 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; m_drawgroup;




+ 5
- 1
src/ticker.cpp View File

@@ -203,6 +203,7 @@ void TickerData::DiskThreadMain()
} }
#endif /* LOL_FEATURE_THREADS */ #endif /* LOL_FEATURE_THREADS */


//-----------------------------------------------------------------------------
void TickerData::GameThreadTick() void TickerData::GameThreadTick()
{ {
Profiler::Stop(Profiler::STAT_TICK_FRAME); Profiler::Stop(Profiler::STAT_TICK_FRAME);
@@ -329,7 +330,8 @@ void TickerData::GameThreadTick()


data->m_todolist.Remove(-1); data->m_todolist.Remove(-1);
data->m_list[e->m_gamegroup].Push(e); 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 // Initialize the entity
e->InitGame(); e->InitGame();
@@ -364,6 +366,7 @@ void TickerData::GameThreadTick()
Profiler::Stop(Profiler::STAT_TICK_GAME); Profiler::Stop(Profiler::STAT_TICK_GAME);
} }


//-----------------------------------------------------------------------------
void TickerData::DrawThreadTick() void TickerData::DrawThreadTick()
{ {
Profiler::Start(Profiler::STAT_TICK_DRAW); Profiler::Start(Profiler::STAT_TICK_DRAW);
@@ -429,6 +432,7 @@ void Ticker::SetStateWhenMatch(Entity * /* entity */, uint32_t /* state */,


} }


//-----------------------------------------------------------------------------
void Ticker::Setup(float fps) void Ticker::Setup(float fps)
{ {
data->fps = fps; data->fps = fps;


Loading…
Cancel
Save