-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up profiler #37966
Clean up profiler #37966
Conversation
pkowal1982
commented
Apr 17, 2020
- Fix issue where you can't select by mouse all frames (for example frame 0 can be selected only by edit field)
- Disable frame edit field when no data available
- Disable clear button when nothing to clean
- Align cursor to the middle of selected frame (it was misplaced)
- Remove some dead code
@pkowal1982 Could you look into rebasing this pull request on the latest |
@Calinou yeah, I'll try to look into it before this weekend. |
109bbb2
to
37af6a5
Compare
8f521b3
to
d1cd56f
Compare
@Calinou Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tried the changes yet, but see comments on style (we always require braces in control flows)
void EditorProfiler::add_frame_metric(const Metric &p_metric, bool p_final) { | ||
++last_metric; | ||
if (last_metric >= frame_metrics.size()) { | ||
last_metric = 0; | ||
} | ||
|
||
total_metrics++; | ||
if (total_metrics > frame_metrics.size()) | ||
total_metrics = frame_metrics.size(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (total_metrics > frame_metrics.size()) {
total_metrics = frame_metrics.size();
}
cursor_metric_edit->set_min(_get_frame_metric(0).frame_number); | ||
|
||
if (!seeking) | ||
cursor_metric_edit->set_value(p_metric.frame_number); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!seeking) {
cursor_metric_edit->set_value(p_metric.frame_number);
}
d1cd56f
to
cd39067
Compare
cd39067
to
f93de6f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested it a bit, it's a great improvement.
There are still issues when you select a frame and then close the game without resuming it (the play/stop button stays disabled), but that's already happening in master so we can address that in a separate PR.
Great job 🏆 !