summaryrefslogtreecommitdiff
path: root/main/performance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main/performance.cpp')
-rw-r--r--main/performance.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/main/performance.cpp b/main/performance.cpp
index 3de2cba125..7e6b9fca64 100644
--- a/main/performance.cpp
+++ b/main/performance.cpp
@@ -42,7 +42,6 @@
Performance *Performance::singleton = nullptr;
void Performance::_bind_methods() {
-
ClassDB::bind_method(D_METHOD("get_monitor", "monitor"), &Performance::get_monitor);
BIND_ENUM_CONSTANT(TIME_FPS);
@@ -79,13 +78,13 @@ void Performance::_bind_methods() {
float Performance::_get_node_count() const {
MainLoop *ml = OS::get_singleton()->get_main_loop();
SceneTree *sml = Object::cast_to<SceneTree>(ml);
- if (!sml)
+ if (!sml) {
return 0;
+ }
return sml->get_node_count();
}
String Performance::get_monitor_name(Monitor p_monitor) const {
-
ERR_FAIL_INDEX_V(p_monitor, MONITOR_MAX, String());
static const char *names[MONITOR_MAX] = {
@@ -123,7 +122,6 @@ String Performance::get_monitor_name(Monitor p_monitor) const {
}
float Performance::get_monitor(Monitor p_monitor) const {
-
switch (p_monitor) {
case TIME_FPS:
return Engine::get_singleton()->get_frames_per_second();
@@ -226,17 +224,14 @@ Performance::MonitorType Performance::get_monitor_type(Monitor p_monitor) const
}
void Performance::set_process_time(float p_pt) {
-
_process_time = p_pt;
}
void Performance::set_physics_process_time(float p_pt) {
-
_physics_process_time = p_pt;
}
Performance::Performance() {
-
_process_time = 0;
_physics_process_time = 0;
singleton = this;