MCPcopy Create free account
hub / github.com/defold/defold / Step

Function Step

engine/engine/src/engine.cpp:2247–2269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2245 }
2246
2247 void Step(HEngine engine)
2248 {
2249 engine->m_Alive = true;
2250 engine->m_RunResult.m_ExitCode = 0;
2251 engine->m_RunResult.m_Action = dmEngine::RunResult::NONE;
2252
2253 float step_dt; // The dt for each step (the game frame)
2254 uint32_t num_steps; // Number of times to loop over the StepFrame function
2255
2256 CalcTimeStep(engine, step_dt, num_steps);
2257
2258 for (uint32_t i = 0; i < num_steps; ++i)
2259 {
2260 DM_PROFILE("Step");
2261 // We currently cannot separate the update from the render,
2262 // since some of the update is done in the render updates (e.g. sprite transforms)
2263 StepFrame(engine, step_dt);
2264
2265 if (!engine->m_Alive)
2266 break;
2267 }
2268
2269 }
2270
2271 static int IsRunning(void* context)
2272 {

Callers 3

dmEngineUpdateFunction · 0.70
TEST_FFunction · 0.50
TEST_PFunction · 0.50

Calls 2

CalcTimeStepFunction · 0.85
StepFrameFunction · 0.85

Tested by 2

TEST_FFunction · 0.40
TEST_PFunction · 0.40