mirror of
https://github.com/TomHarte/CLK.git
synced 2026-04-21 02:17:08 +00:00
Improve const arguments.
This commit is contained in:
@@ -14,7 +14,7 @@ using namespace Outputs::Display;
|
||||
|
||||
// MARK: Frame size estimation.
|
||||
|
||||
void Metrics::announce_event(ScanTarget::Event event) {
|
||||
void Metrics::announce_event(const ScanTarget::Event event) {
|
||||
switch(event) {
|
||||
case ScanTarget::Event::EndHorizontalRetrace:
|
||||
++lines_this_frame_;
|
||||
@@ -29,7 +29,7 @@ void Metrics::announce_event(ScanTarget::Event event) {
|
||||
}
|
||||
}
|
||||
|
||||
void Metrics::add_line_total(int total) {
|
||||
void Metrics::add_line_total(const int total) {
|
||||
line_total_history_[line_total_history_pointer_] = total;
|
||||
line_total_history_pointer_ = (line_total_history_pointer_ + 1) % line_total_history_.size();
|
||||
}
|
||||
@@ -37,7 +37,9 @@ void Metrics::add_line_total(int total) {
|
||||
float Metrics::visible_lines_per_frame_estimate() const {
|
||||
// Just average the number of records contained in line_total_history_ to provide this estimate;
|
||||
// that array should be an even number, to allow for potential interlaced sources.
|
||||
return float(std::accumulate(line_total_history_.begin(), line_total_history_.end(), 0)) / float(line_total_history_.size());
|
||||
return float(
|
||||
std::accumulate(line_total_history_.begin(), line_total_history_.end(), 0)) / float(line_total_history_.size()
|
||||
);
|
||||
}
|
||||
|
||||
int Metrics::current_line() const {
|
||||
@@ -50,7 +52,7 @@ void Metrics::announce_did_resize() {
|
||||
frames_missed_ = frames_hit_ = 0;
|
||||
}
|
||||
|
||||
void Metrics::announce_draw_status(bool complete) {
|
||||
void Metrics::announce_draw_status(const bool complete) {
|
||||
if(!complete) {
|
||||
++frames_missed_;
|
||||
} else {
|
||||
@@ -79,7 +81,7 @@ void Metrics::announce_draw_status(bool complete) {
|
||||
}
|
||||
}
|
||||
|
||||
void Metrics::announce_draw_status(size_t, std::chrono::high_resolution_clock::duration, bool complete) {
|
||||
void Metrics::announce_draw_status(size_t, std::chrono::high_resolution_clock::duration, const bool complete) {
|
||||
announce_draw_status(complete);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user