use .net's Stopwatch instead of sdl's broken timer
This commit is contained in:
@@ -18,12 +18,11 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using Tao.Sdl;
|
||||
namespace OpenRA.Support
|
||||
{
|
||||
public class Stopwatch
|
||||
{
|
||||
int start;
|
||||
System.Diagnostics.Stopwatch sw;
|
||||
public Stopwatch ()
|
||||
{
|
||||
Reset();
|
||||
@@ -31,12 +30,12 @@ namespace OpenRA.Support
|
||||
|
||||
public double ElapsedTime()
|
||||
{
|
||||
return (1.0/1000.0) * (double)(Sdl.SDL_GetTicks() - start);
|
||||
return sw.Elapsed.TotalMilliseconds / 1000.0;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
start = Sdl.SDL_GetTicks();
|
||||
sw = System.Diagnostics.Stopwatch.StartNew();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user