From 556ff7f83daa993a890509a9705e81a0fb410564 Mon Sep 17 00:00:00 2001 From: Bob Date: Sat, 20 Feb 2010 21:26:41 +1300 Subject: [PATCH] use SDL for timer. --- OpenRa.FileFormats/OpenRa.FileFormats.csproj | 3 ++- OpenRa.FileFormats/Support/Stopwatch.cs | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/OpenRa.FileFormats/OpenRa.FileFormats.csproj b/OpenRa.FileFormats/OpenRa.FileFormats.csproj index 4df27feeff..7449e44fa4 100644 --- a/OpenRa.FileFormats/OpenRa.FileFormats.csproj +++ b/OpenRa.FileFormats/OpenRa.FileFormats.csproj @@ -1,4 +1,4 @@ - + Debug @@ -50,6 +50,7 @@ False ..\thirdparty\Tao\Tao.Glfw.dll + diff --git a/OpenRa.FileFormats/Support/Stopwatch.cs b/OpenRa.FileFormats/Support/Stopwatch.cs index 1b23824b88..a8a3463164 100755 --- a/OpenRa.FileFormats/Support/Stopwatch.cs +++ b/OpenRa.FileFormats/Support/Stopwatch.cs @@ -20,12 +20,13 @@ using System.Runtime.InteropServices; using Tao.Glfw; +using Tao.Sdl; namespace OpenRa.Support { public class Stopwatch { - double start; + int start; public Stopwatch() { Reset(); @@ -33,12 +34,12 @@ namespace OpenRa.Support public double ElapsedTime() { - return (Glfw.glfwGetTime() - start); + return (1.0/1000.0) * (double)(Sdl.SDL_GetTicks() - start); } public void Reset() { - start = Glfw.glfwGetTime(); + start = Sdl.SDL_GetTicks(); } } }