Fix perf counter
This commit is contained in:
2
Makefile
2
Makefile
@@ -8,7 +8,7 @@ COMMON_LIBS = System.dll System.Core.dll System.Drawing.dll System.Xml.dll
|
||||
fileformats_SRCS = $(shell find OpenRa.FileFormats/ -iname '*.cs')
|
||||
fileformats_TARGET = OpenRa.FileFormats.dll
|
||||
fileformats_KIND = library
|
||||
fileformats_LIBS = $(COMMON_LIBS)
|
||||
fileformats_LIBS = $(COMMON_LIBS) thirdparty/Tao/Tao.Glfw.dll
|
||||
|
||||
gl_SRCS = $(shell find OpenRa.Gl/ -iname '*.cs')
|
||||
gl_TARGET = OpenRa.Gl.dll
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
@@ -24,6 +25,8 @@
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Optimize>false</Optimize>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
@@ -33,6 +36,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
@@ -42,6 +46,10 @@
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Tao.Glfw, Version=2.6.0.0, Culture=neutral, PublicKeyToken=2bb092b6587e4402">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\thirdparty\Tao\Tao.Glfw.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AudLoader.cs" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#region Copyright & License Information
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
|
||||
* This file is part of OpenRA.
|
||||
@@ -19,35 +19,26 @@
|
||||
#endregion
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using Tao.Glfw;
|
||||
|
||||
namespace OpenRa.Support
|
||||
{
|
||||
public class Stopwatch
|
||||
{
|
||||
//[DllImport("kernel32.dll")]
|
||||
static bool QueryPerformanceCounter(out long value) { value = 1; return true; }
|
||||
//[DllImport("kernel32.dll")]
|
||||
static bool QueryPerformanceFrequency(out long frequency) { frequency = 1; return true; }
|
||||
|
||||
long freq, start;
|
||||
|
||||
double start;
|
||||
public Stopwatch()
|
||||
{
|
||||
QueryPerformanceFrequency(out freq);
|
||||
QueryPerformanceCounter(out start);
|
||||
Reset();
|
||||
}
|
||||
|
||||
public double ElapsedTime()
|
||||
{
|
||||
long current;
|
||||
QueryPerformanceCounter(out current);
|
||||
|
||||
return (current - start) / (double)freq;
|
||||
return (Glfw.glfwGetTime() - start);
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
QueryPerformanceCounter(out start);
|
||||
start = Glfw.glfwGetTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,14 +66,14 @@
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Tao.OpenAl, Version=1.1.0.1, Culture=neutral, PublicKeyToken=a7579dda88828311, processorArchitecture=MSIL" />
|
||||
<Reference Include="ISE.FreeType, Version=1.0.2885.37773, Culture=neutral, PublicKeyToken=null">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\thirdparty\ISE.FreeType.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Tao.OpenGl, Version=2.1.0.12, Culture=neutral, PublicKeyToken=1ca010269a4501ef">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\thirdparty\Tao\Tao.OpenGl.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ISE.FreeType, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1b34ab585684d5ea">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\thirdparty\ISE.FreeType.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Chat.cs" />
|
||||
|
||||
Reference in New Issue
Block a user