mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2025-08-24 08:26:40 +02:00
add time delta context to scene
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#include "./simple_scene.hpp"
|
||||
#include "spdlog/fmt/bundled/core.h"
|
||||
|
||||
//#include "../systems_container.hpp"
|
||||
#include <mm/components/time_delta.hpp>
|
||||
|
||||
#include <entt/entity/registry.hpp>
|
||||
|
||||
@@ -61,6 +60,10 @@ void SimpleSceneService::sceneFixedUpdate(Engine&) {
|
||||
|
||||
size_t continuous_counter = 0;
|
||||
|
||||
auto& time_ctx = _scene->ctx_or_set<MM::Components::TimeDelta>(f_delta, delta_factor);
|
||||
time_ctx.tickDelta = f_delta * delta_factor;
|
||||
time_ctx.deltaFactor = delta_factor;
|
||||
|
||||
// TODO: this is just cancer
|
||||
while (_accumulator >= static_cast<decltype(_accumulator)>(dt)){
|
||||
_accumulator -= static_cast<decltype(_accumulator)>(dt);
|
||||
|
Reference in New Issue
Block a user