From 2394584d9e2916d8a5bdd95ff9f01eccfde1da44 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 26 Jul 2021 17:45:10 +0200 Subject: Limit matrix tasks to 10 per frame to limit lag --- src/plugins/Matrix.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/plugins/Matrix.cpp') diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index b0ff9b8..2689d14 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -4412,9 +4412,12 @@ namespace QuickMedia { } void Matrix::update() { + sf::Clock timer; std::optional> task; - while((task = ui_thread_tasks.pop_if_available()) != std::nullopt) { + int i = 0; + while((task = ui_thread_tasks.pop_if_available()) != std::nullopt && i < 10) { task.value()(); + ++i; } } -- cgit v1.2.3