OpenTTD
framerate_type.h
Go to the documentation of this file.
1 /* $Id$ */
2 
3 /*
4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 */
9 
37 #ifndef FRAMERATE_TYPE_H
38 #define FRAMERATE_TYPE_H
39 
40 #include "stdafx.h"
41 #include "core/enum_type.hpp"
42 
50  PFE_FIRST = 0,
81 };
83 
84 
85 typedef uint64 TimingMeasurement;
86 
95  PerformanceElement elem;
96  TimingMeasurement start_time;
97 public:
98  PerformanceMeasurer(PerformanceElement elem);
99  ~PerformanceMeasurer();
100  void SetExpectedRate(double rate);
101  static void SetInactive(PerformanceElement elem);
102  static void Paused(PerformanceElement elem);
103 };
104 
117  PerformanceElement elem;
118  TimingMeasurement start_time;
119 public:
122  static void Reset(PerformanceElement elem);
123 };
124 
125 void ShowFramerateWindow();
126 
127 #endif /* FRAMERATE_TYPE_H */
Time spent processing cargo movement.
AI execution for player slot 5.
PerformanceElement
Elements of game performance that can be measured.
End of enum, must be last.
Game script execution.
RAII class for measuring simple elements of performance.
PerformanceAccumulator(PerformanceElement elem)
Begin measuring one block of the accumulating value.
Speed of drawing world and GUI.
Time spent processing aircraft.
static void Reset(PerformanceElement elem)
Store the previous accumulator value and reset for a new cycle of accumulating measurements.
AI execution for player slot 12.
Type (helpers) for enums.
Speed of gameloop processing.
AI execution for player slot 2.
AI execution for player slot 9.
Time spend processing road vehicles.
AI execution for player slot 15.
Definition of base types and functions in a cross-platform compatible way.
AI execution for player slot 7.
AI execution for player slot 6.
AI execution for player slot 14.
Time spent processing other world features.
AI execution for player slot 1.
uint64 TimingMeasurement
Type used to hold a performance timing measurement.
AI execution for player slot 10.
Time spent processing ships.
Time spent drawing world viewports in GUI.
Speed of painting drawn video buffer.
AI execution for player slot 8.
RAII class for measuring multi-step elements of performance.
~PerformanceAccumulator()
Finish and add one block of the accumulating value.
AI execution for player slot 3.
AI execution for player slot 11.
void ShowFramerateWindow()
Open the general framerate window.
#define DECLARE_POSTFIX_INCREMENT(enum_type)
Some enums need to have allowed incrementing (i.e.
Definition: enum_type.hpp:18
AI execution for player slot 13.
Time spent processing trains.
Time spent waiting for link graph background jobs.
AI execution for player slot 4.
Sum of all GS/AI scripts.
Speed of mixing audio samples.