OpenTTD Source 20241224-master-gf74b0cf984
|
Types for recording game performance data. More...
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 | PerformanceElement { PFE_FIRST = 0 , PFE_GAMELOOP = 0 , PFE_GL_ECONOMY , PFE_GL_TRAINS , PFE_GL_ROADVEHS , PFE_GL_SHIPS , PFE_GL_AIRCRAFT , PFE_GL_LANDSCAPE , PFE_GL_LINKGRAPH , PFE_DRAWING , PFE_DRAWWORLD , PFE_VIDEO , PFE_SOUND , PFE_ALLSCRIPTS , PFE_GAMESCRIPT , PFE_AI0 , PFE_AI1 , PFE_AI2 , PFE_AI3 , PFE_AI4 , PFE_AI5 , PFE_AI6 , PFE_AI7 , PFE_AI8 , PFE_AI9 , PFE_AI10 , PFE_AI11 , PFE_AI12 , PFE_AI13 , PFE_AI14 , PFE_MAX } |
Elements of game performance that can be measured. More... | |
Functions | |
void | ShowFramerateWindow () |
Open the general framerate window. | |
void | ProcessPendingPerformanceMeasurements () |
This drains the PFE_SOUND measurement data queue into _pf_data. | |
Types for recording game performance data.
PFE_MAX
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 83 of file framerate_type.h.
enum PerformanceElement |
Elements of game performance that can be measured.
Enumerator | |
---|---|
PFE_GAMELOOP | Speed of gameloop processing. |
PFE_GL_ECONOMY | Time spent processing cargo movement. |
PFE_GL_TRAINS | Time spent processing trains. |
PFE_GL_ROADVEHS | Time spend processing road vehicles. |
PFE_GL_SHIPS | Time spent processing ships. |
PFE_GL_AIRCRAFT | Time spent processing aircraft. |
PFE_GL_LANDSCAPE | Time spent processing other world features. |
PFE_GL_LINKGRAPH | Time spent waiting for link graph background jobs. |
PFE_DRAWING | Speed of drawing world and GUI. |
PFE_DRAWWORLD | Time spent drawing world viewports in GUI. |
PFE_VIDEO | Speed of painting drawn video buffer. |
PFE_SOUND | Speed of mixing audio samples. |
PFE_ALLSCRIPTS | Sum of all GS/AI scripts. |
PFE_GAMESCRIPT | Game script execution. |
PFE_AI0 | AI execution for player slot 1. |
PFE_AI1 | AI execution for player slot 2. |
PFE_AI2 | AI execution for player slot 3. |
PFE_AI3 | AI execution for player slot 4. |
PFE_AI4 | AI execution for player slot 5. |
PFE_AI5 | AI execution for player slot 6. |
PFE_AI6 | AI execution for player slot 7. |
PFE_AI7 | AI execution for player slot 8. |
PFE_AI8 | AI execution for player slot 9. |
PFE_AI9 | AI execution for player slot 10. |
PFE_AI10 | AI execution for player slot 11. |
PFE_AI11 | AI execution for player slot 12. |
PFE_AI12 | AI execution for player slot 13. |
PFE_AI13 | AI execution for player slot 14. |
PFE_AI14 | AI execution for player slot 15. |
PFE_MAX | End of enum, must be last. |
Definition at line 47 of file framerate_type.h.
void ProcessPendingPerformanceMeasurements | ( | ) |
This drains the PFE_SOUND measurement data queue into _pf_data.
PFE_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 1105 of file framerate_gui.cpp.
References anonymous_namespace{framerate_gui.cpp}::_pf_data, anonymous_namespace{framerate_gui.cpp}::PerformanceData::Add(), and PFE_SOUND.
Referenced by UpdateWindows().
void ShowFramerateWindow | ( | ) |
Open the general framerate window.
Definition at line 1024 of file framerate_gui.cpp.