diff options
author | Aaron Franke <arnfranke@yahoo.com> | 2021-02-01 21:16:37 -0500 |
---|---|---|
committer | Aaron Franke <arnfranke@yahoo.com> | 2021-08-09 14:05:42 -0500 |
commit | 84f720966c74d5b37f70e21867e9e3e6a1e44c36 (patch) | |
tree | 770bb6c7c266c5266f4de3ceab52e756b55bf440 /editor/plugins/node_3d_editor_plugin.cpp | |
parent | 78d33a6e24a3977fc3a2c66808d7cbdddd3add11 (diff) |
Use doubles for time in many other places
Diffstat (limited to 'editor/plugins/node_3d_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 931c50fc44..4cb11cc5f1 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -2735,7 +2735,7 @@ void Node3DEditorViewport::_notification(int p_what) { if (show_fps) { cpu_time_history[cpu_time_history_index] = RS::get_singleton()->viewport_get_measured_render_time_cpu(viewport->get_viewport_rid()); cpu_time_history_index = (cpu_time_history_index + 1) % FRAME_TIME_HISTORY; - float cpu_time = 0.0; + double cpu_time = 0.0; for (int i = 0; i < FRAME_TIME_HISTORY; i++) { cpu_time += cpu_time_history[i]; } @@ -2745,7 +2745,7 @@ void Node3DEditorViewport::_notification(int p_what) { gpu_time_history[gpu_time_history_index] = RS::get_singleton()->viewport_get_measured_render_time_gpu(viewport->get_viewport_rid()); gpu_time_history_index = (gpu_time_history_index + 1) % FRAME_TIME_HISTORY; - float gpu_time = 0.0; + double gpu_time = 0.0; for (int i = 0; i < FRAME_TIME_HISTORY; i++) { gpu_time += gpu_time_history[i]; } @@ -2769,7 +2769,7 @@ void Node3DEditorViewport::_notification(int p_what) { frame_time_gradient->get_color_at_offset( Math::range_lerp(gpu_time, 0, 30, 0, 1))); - const float fps = 1000.0 / gpu_time; + const double fps = 1000.0 / gpu_time; fps_label->set_text(vformat(TTR("FPS: %d"), fps)); // Middle point is at 60 FPS. fps_label->add_theme_color_override( |