diff options
| author | Daniel J. Ramirez <djrmuv@gmail.com> | 2017-10-23 01:59:04 -0500 |
|---|---|---|
| committer | Daniel J. Ramirez <djrmuv@gmail.com> | 2017-10-23 02:11:02 -0500 |
| commit | a97c8504fb3895be3327fa161da68b248172abce (patch) | |
| tree | 1a2024ad099475796850fdca5dca2e2727e27d27 /main | |
| parent | 07ab60a8d7aeae1f2d70ed47feb637d8bac4dea3 (diff) | |
| download | redot-engine-a97c8504fb3895be3327fa161da68b248172abce.tar.gz | |
Improved monitors units and colors.
Diffstat (limited to 'main')
| -rw-r--r-- | main/performance.cpp | 38 | ||||
| -rw-r--r-- | main/performance.h | 8 |
2 files changed, 46 insertions, 0 deletions
diff --git a/main/performance.cpp b/main/performance.cpp index c4b62559c7..39b42e803c 100644 --- a/main/performance.cpp +++ b/main/performance.cpp @@ -153,6 +153,44 @@ float Performance::get_monitor(Monitor p_monitor) const { return 0; } +Performance::MonitorType Performance::get_monitor_type(Monitor p_monitor) const { + ERR_FAIL_INDEX_V(p_monitor, MONITOR_MAX, MONITOR_TYPE_QUANTITY); + // ugly + static const MonitorType types[MONITOR_MAX] = { + + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_TIME, + MONITOR_TYPE_TIME, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_QUANTITY, + + }; + + return types[p_monitor]; +} + void Performance::set_process_time(float p_pt) { _process_time = p_pt; diff --git a/main/performance.h b/main/performance.h index 900e6434b7..21fbd7a1d2 100644 --- a/main/performance.h +++ b/main/performance.h @@ -79,9 +79,17 @@ public: MONITOR_MAX }; + enum MonitorType { + MONITOR_TYPE_QUANTITY, + MONITOR_TYPE_MEMORY, + MONITOR_TYPE_TIME + }; + float get_monitor(Monitor p_monitor) const; String get_monitor_name(Monitor p_monitor) const; + MonitorType get_monitor_type(Monitor p_monitor) const; + void set_process_time(float p_pt); void set_physics_process_time(float p_pt); |
