summaryrefslogtreecommitdiff
path: root/src/video/cocoa
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2018-07-19 21:17:07 +0200
committerPatric Stout <truebrain@openttd.org>2018-07-19 21:17:07 +0200
commit2a868b9f3b8e3b5f8b9e5f728f628ec88fd5e3ad (patch)
tree36da708e128fc68d9ceac32362503df43af2fc22 /src/video/cocoa
parenta3d1950b656787b76fbccec1aedd63407c34c2f1 (diff)
downloadopenttd-2a868b9f3b8e3b5f8b9e5f728f628ec88fd5e3ad.tar.xz
Feature: Framerate display window (#6822)
Frame rate and various game loop/graphics timing measurements and graphs. Accessible via the Help menu, and can print some stats in the console via the fps command.
Diffstat (limited to 'src/video/cocoa')
-rw-r--r--src/video/cocoa/wnd_quartz.mm3
-rw-r--r--src/video/cocoa/wnd_quickdraw.mm3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/video/cocoa/wnd_quartz.mm b/src/video/cocoa/wnd_quartz.mm
index 7bec27824..4245a3c18 100644
--- a/src/video/cocoa/wnd_quartz.mm
+++ b/src/video/cocoa/wnd_quartz.mm
@@ -33,6 +33,7 @@
#include "cocoa_v.h"
#include "../../core/math_func.hpp"
#include "../../gfx_func.h"
+#include "../../framerate_type.h"
/* On some old versions of MAC OS this may not be defined.
* Those versions generally only produce code for PPC. So it should be safe to
@@ -431,6 +432,8 @@ WindowQuartzSubdriver::~WindowQuartzSubdriver()
void WindowQuartzSubdriver::Draw(bool force_update)
{
+ PerformanceMeasurer framerate(PFE_VIDEO);
+
/* Check if we need to do anything */
if (this->num_dirty_rects == 0 || [ this->window isMiniaturized ]) return;
diff --git a/src/video/cocoa/wnd_quickdraw.mm b/src/video/cocoa/wnd_quickdraw.mm
index df10d8773..8475efb0f 100644
--- a/src/video/cocoa/wnd_quickdraw.mm
+++ b/src/video/cocoa/wnd_quickdraw.mm
@@ -32,6 +32,7 @@
#include "cocoa_v.h"
#include "../../core/math_func.hpp"
#include "../../gfx_func.h"
+#include "../../framerate_type.h"
/**
* Important notice regarding all modifications!!!!!!!
@@ -361,6 +362,8 @@ WindowQuickdrawSubdriver::~WindowQuickdrawSubdriver()
void WindowQuickdrawSubdriver::Draw(bool force_update)
{
+ PerformanceMeasurer framerate(PFE_VIDEO);
+
/* Check if we need to do anything */
if (this->num_dirty_rects == 0 || [ this->window isMiniaturized ]) return;