From a3119b8b092736af066413e473682ac47ace6519 Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 10 Feb 2022 17:01:57 +0100 Subject: [PATCH] Added helper to get delta time to the node tree. --- core/nodes/node_tree.cpp | 4 ++++ core/nodes/node_tree.h | 2 ++ web/http/web_server.cpp | 3 +++ web/http/web_server.h | 2 ++ 4 files changed, 11 insertions(+) diff --git a/core/nodes/node_tree.cpp b/core/nodes/node_tree.cpp index ceb2ecb..0bf808e 100644 --- a/core/nodes/node_tree.cpp +++ b/core/nodes/node_tree.cpp @@ -39,6 +39,10 @@ void NodeTree::_send_update() { } } +float NodeTree::get_update_delta_time() { + return 0; +} + NodeTree::NodeTree() : Object() { diff --git a/core/nodes/node_tree.h b/core/nodes/node_tree.h index 7b46a1c..0833671 100644 --- a/core/nodes/node_tree.h +++ b/core/nodes/node_tree.h @@ -17,6 +17,8 @@ public: void request_write_lock(); + virtual float get_update_delta_time(); + NodeTree(); ~NodeTree(); diff --git a/web/http/web_server.cpp b/web/http/web_server.cpp index 378a892..3a90830 100644 --- a/web/http/web_server.cpp +++ b/web/http/web_server.cpp @@ -25,6 +25,9 @@ void WebServer::handle_request(Request *request) { _rw_lock.read_unlock(); } +float WebServer::get_update_delta_time() { + return _update_interval; +} WebServer::WebServer() : NodeTree() { _web_root = nullptr; diff --git a/web/http/web_server.h b/web/http/web_server.h index 63200fd..a06c8e9 100644 --- a/web/http/web_server.h +++ b/web/http/web_server.h @@ -16,6 +16,8 @@ public: void handle_request(Request *request); + float get_update_delta_time(); + WebServer(); virtual ~WebServer();