You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Merge pull request #53463 from lawnjelly/vital_redraws
Add editor vital redraws only option
This commit is contained in:
@@ -2277,7 +2277,16 @@ bool Main::iteration() {
|
||||
|
||||
if (OS::get_singleton()->can_draw() && VisualServer::get_singleton()->is_render_loop_enabled()) {
|
||||
if ((!force_redraw_requested) && OS::get_singleton()->is_in_low_processor_usage_mode()) {
|
||||
if (VisualServer::get_singleton()->has_changed()) {
|
||||
// We can choose whether to redraw as a result of any redraw request, or redraw only for vital requests.
|
||||
VisualServer::ChangedPriority priority = (OS::get_singleton()->is_update_pending() ? VisualServer::CHANGED_PRIORITY_ANY : VisualServer::CHANGED_PRIORITY_HIGH);
|
||||
|
||||
// Determine whether the scene has changed, to know whether to draw.
|
||||
// If it has changed, inform the update pending system so it can keep
|
||||
// particle systems etc updating when running in vital updates only mode.
|
||||
bool has_changed = VisualServer::get_singleton()->has_changed(priority);
|
||||
OS::get_singleton()->set_update_pending(has_changed);
|
||||
|
||||
if (has_changed) {
|
||||
VisualServer::get_singleton()->draw(true, scaled_step); // flush visual commands
|
||||
Engine::get_singleton()->frames_drawn++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user