[aseprite] 151/250: Complete clock_value() impl for Skia/OSX port w/msecs precision

Tobias Hansen thansen at moszumanska.debian.org
Sun Dec 20 15:27:23 UTC 2015


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit 250de2257c96f0b36a56268632283f4fb50a4b21
Author: David Capello <davidcapello at gmail.com>
Date:   Sat Oct 10 13:02:32 2015 -0300

    Complete clock_value() impl for Skia/OSX port w/msecs precision
---
 src/she/skia/she.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/she/skia/she.cpp b/src/she/skia/she.cpp
index b786800..c292fa6 100644
--- a/src/she/skia/she.cpp
+++ b/src/she/skia/she.cpp
@@ -19,6 +19,7 @@
 #if __APPLE__
   #include "she/osx/app.h"
   #include <CoreServices/CoreServices.h>
+  #include <mach/mach_time.h>
 #endif
 
 namespace she {
@@ -53,13 +54,15 @@ void clear_keyboard_buffer()
 
 int clock_value()
 {
-  // TODO
 #if _WIN32
   return (int)GetTickCount();
 #elif defined(__APPLE__)
-  return TickCount();
+  static mach_timebase_info_data_t timebase = { 0, 0 };
+  if (timebase.denom == 0)
+    (void)mach_timebase_info(&timebase);
+  return int(float(mach_absolute_time()) * float(timebase.numer) / float(timebase.denom) / 1.0e6f);
 #else
-  return 0;
+  return 0; // TODO
 #endif
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list