mirror of
https://github.com/godotengine/godot.git
synced 2024-11-25 05:33:11 +00:00
Display 2 decimals instead of 1 in editor frametime labels
When comparing different graphics settings or optimizations, this makes precise measurements and frametime comparisons easier.
This commit is contained in:
parent
eb98fd9442
commit
f61ee47a2e
@ -2887,13 +2887,13 @@ void Node3DEditorViewport::_notification(int p_what) {
|
|||||||
|
|
||||||
// Color labels depending on performance level ("good" = green, "OK" = yellow, "bad" = red).
|
// Color labels depending on performance level ("good" = green, "OK" = yellow, "bad" = red).
|
||||||
// Middle point is at 15 ms.
|
// Middle point is at 15 ms.
|
||||||
cpu_time_label->set_text(vformat(TTR("CPU Time: %s ms"), rtos(cpu_time).pad_decimals(1)));
|
cpu_time_label->set_text(vformat(TTR("CPU Time: %s ms"), rtos(cpu_time).pad_decimals(2)));
|
||||||
cpu_time_label->add_theme_color_override(
|
cpu_time_label->add_theme_color_override(
|
||||||
"font_color",
|
"font_color",
|
||||||
frame_time_gradient->get_color_at_offset(
|
frame_time_gradient->get_color_at_offset(
|
||||||
Math::range_lerp(cpu_time, 0, 30, 0, 1)));
|
Math::range_lerp(cpu_time, 0, 30, 0, 1)));
|
||||||
|
|
||||||
gpu_time_label->set_text(vformat(TTR("GPU Time: %s ms"), rtos(gpu_time).pad_decimals(1)));
|
gpu_time_label->set_text(vformat(TTR("GPU Time: %s ms"), rtos(gpu_time).pad_decimals(2)));
|
||||||
// Middle point is at 15 ms.
|
// Middle point is at 15 ms.
|
||||||
gpu_time_label->add_theme_color_override(
|
gpu_time_label->add_theme_color_override(
|
||||||
"font_color",
|
"font_color",
|
||||||
|
@ -2687,10 +2687,10 @@ bool Main::iteration() {
|
|||||||
if (frame > 1000000) {
|
if (frame > 1000000) {
|
||||||
if (editor || project_manager) {
|
if (editor || project_manager) {
|
||||||
if (print_fps) {
|
if (print_fps) {
|
||||||
print_line(vformat("Editor FPS: %d (%s mspf)", frames, rtos(1000.0 / frames).pad_decimals(1)));
|
print_line(vformat("Editor FPS: %d (%s mspf)", frames, rtos(1000.0 / frames).pad_decimals(2)));
|
||||||
}
|
}
|
||||||
} else if (GLOBAL_GET("debug/settings/stdout/print_fps") || print_fps) {
|
} else if (GLOBAL_GET("debug/settings/stdout/print_fps") || print_fps) {
|
||||||
print_line(vformat("Project FPS: %d (%s mspf)", frames, rtos(1000.0 / frames).pad_decimals(1)));
|
print_line(vformat("Project FPS: %d (%s mspf)", frames, rtos(1000.0 / frames).pad_decimals(2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Engine::get_singleton()->_fps = frames;
|
Engine::get_singleton()->_fps = frames;
|
||||||
|
Loading…
Reference in New Issue
Block a user