Changeset - r24814:845c59d9d0ac
[Not reviewed]
master
0 1 0
Patric Stout - 4 years ago 2021-02-16 19:37:58
truebrain@openttd.org
Fix: framerate window showed a slightly higher rate than actually measured (#8682)

The first point was counted, but also initialized as "last". As
such, it didn't add to "total", but did add to "count", which made
the "count" 1 more than the total actually represents.
1 file changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/framerate_gui.cpp
Show inline comments
 
@@ -151,6 +151,10 @@ namespace {
 
			/* Total duration covered by collected points */
 
			TimingMeasurement total = 0;
 

	
 
			/* We have nothing to compare the first point against */
 
			point--;
 
			if (point < 0) point = NUM_FRAMERATE_POINTS - 1;
 

	
 
			while (point != last_point) {
 
				/* Only record valid data points, but pretend the gaps in measurements aren't there */
 
				if (this->durations[point] != INVALID_DURATION) {
0 comments (0 inline, 0 general)