|
OpenTTD Source 20260711-master-g3fb3006dff
|
Types for recording game performance data. More...
#include "core/enum_type.hpp"Go to the source code of this file.
Data Structures | |
| class | PerformanceMeasurer |
| RAII class for measuring simple elements of performance. More... | |
| class | PerformanceAccumulator |
| RAII class for measuring multi-step elements of performance. More... | |
Typedefs | |
| typedef uint64_t | TimingMeasurement |
| Type used to hold a performance timing measurement. | |
Enumerations | |
| enum class | PerformanceElement : uint8_t { GameLoop , GameLoopEconomy , GameLoopTrains , GameLoopRoadVehicles , GameLoopShips , GameLoopAircraft , GameLoopLandscape , GameLoopLinkGraph , Drawing , ViewportDrawing , Video , Sound , AllScripts , GameScript , AI0 , AI1 , AI2 , AI3 , AI4 , AI5 , AI6 , AI7 , AI8 , AI9 , AI10 , AI11 , AI12 , AI13 , AI14 , End } |
| Elements of game performance that can be measured. More... | |
Functions | |
| void | ShowFramerateWindow () |
| Open the general framerate window. | |
| void | ProcessPendingPerformanceMeasurements () |
| This drains the PerformanceElement::Sound measurement data queue into _pf_data. | |
Types for recording game performance data.
PerformanceElement::End and should be added in a logical place. For example, an element of the game loop would be added next to the other game loop elements, and a rendering element next to the other rendering elements.english.txt for two GUI uses, also in the PerformanceElement order. Search for STR_FRAMERATE_GAMELOOP and STR_FRAMETIME_CAPTION_GAMELOOP in english.txt to find those.Definition in file framerate_type.h.
| typedef uint64_t TimingMeasurement |
Type used to hold a performance timing measurement.
Definition at line 81 of file framerate_type.h.
|
strong |
Elements of game performance that can be measured.
| Enumerator | |
|---|---|
| GameLoop | Speed of gameloop processing. |
| GameLoopEconomy | Time spent processing cargo movement. |
| GameLoopTrains | Time spent processing trains. |
| GameLoopRoadVehicles | Time spend processing road vehicles. |
| GameLoopShips | Time spent processing ships. |
| GameLoopAircraft | Time spent processing aircraft. |
| GameLoopLandscape | Time spent processing other world features. |
| GameLoopLinkGraph | Time spent waiting for link graph background jobs. |
| Drawing | Speed of drawing world and GUI. |
| ViewportDrawing | Time spent drawing world viewports in GUI. |
| Video | Speed of painting drawn video buffer. |
| Sound | Speed of mixing audio samples. |
| AllScripts | Sum of all GS/AI scripts. |
| GameScript | Game script execution. |
| AI0 | AI execution for player slot 1. |
| AI1 | AI execution for player slot 2. |
| AI2 | AI execution for player slot 3. |
| AI3 | AI execution for player slot 4. |
| AI4 | AI execution for player slot 5. |
| AI5 | AI execution for player slot 6. |
| AI6 | AI execution for player slot 7. |
| AI7 | AI execution for player slot 8. |
| AI8 | AI execution for player slot 9. |
| AI9 | AI execution for player slot 10. |
| AI10 | AI execution for player slot 11. |
| AI11 | AI execution for player slot 12. |
| AI12 | AI execution for player slot 13. |
| AI13 | AI execution for player slot 14. |
| AI14 | AI execution for player slot 15. |
| End | End of enum, must be last. |
Definition at line 46 of file framerate_type.h.
| void ProcessPendingPerformanceMeasurements | ( | ) |
This drains the PerformanceElement::Sound measurement data queue into _pf_data.
PerformanceElement::Sound measurements are made by the mixer thread and so cannot be stored into _pf_data directly, because this would not be thread safe and would violate the invariants of the FPS and frame graph windows.
Definition at line 1131 of file framerate_gui.cpp.
References anonymous_namespace{framerate_gui.cpp}::_pf_data, and Sound.
Referenced by UpdateWindows().
| void ShowFramerateWindow | ( | ) |
Open the general framerate window.
Definition at line 1047 of file framerate_gui.cpp.