synced up VS project files again; reinstated callback refs in a way that gmcs won't bitch about

This commit is contained in:
Chris Forbes
2010-02-18 20:46:32 +13:00
parent 3237485055
commit c38a78f77f
3 changed files with 16 additions and 21 deletions

View File

@@ -60,6 +60,7 @@
<Compile Include="Format40.cs" />
<Compile Include="Format80.cs" />
<Compile Include="Graphics\IGraphicsDevice.cs" />
<Compile Include="Graphics\Vertex.cs" />
<Compile Include="IniFile.cs" />
<Compile Include="int2.cs" />
<Compile Include="IPaletteRemap.cs" />

View File

@@ -89,11 +89,6 @@
<Compile Include="Graphics\Minimap.cs" />
<Compile Include="Network\Connection.cs" />
<Compile Include="Orders\PowerDownOrderGenerator.cs" />
<Compile Include="Resources1.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Effects\Missile.cs" />
<Compile Include="Network\OrderIO.cs" />
<Compile Include="Network\OrderManager.cs" />
@@ -260,7 +255,6 @@
<Compile Include="Traits\Util.cs" />
<Compile Include="UiOverlay.cs" />
<Compile Include="Graphics\Util.cs" />
<Compile Include="Graphics\Vertex.cs" />
<Compile Include="Graphics\Viewport.cs" />
<Compile Include="Orders\UnitOrderGenerator.cs" />
<Compile Include="World.cs" />
@@ -292,12 +286,6 @@
<ItemGroup>
<Content Include="OpenRA.ico" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources1.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -40,9 +40,9 @@ namespace OpenRa.GlRenderer
internal IntPtr cgContext;
internal int vertexProfile, fragmentProfile;
// readonly Glfw.GLFWmousebuttonfun mouseButtonCallback;
// readonly Glfw.GLFWmouseposfun mousePositionCallback;
// readonly Glfw.GLFWwindowclosefun windowCloseCallback;
readonly Glfw.GLFWmousebuttonfun mouseButtonCallback;
readonly Glfw.GLFWmouseposfun mousePositionCallback;
readonly Glfw.GLFWwindowclosefun windowCloseCallback;
int mouseX, mouseY;
public Size WindowSize { get { return windowSize; } }
@@ -64,7 +64,7 @@ namespace OpenRa.GlRenderer
var lastButtonBits = (MouseButtons)0;
Glfw.glfwSetMouseButtonCallback( /*mouseButtonCallback =*/ ( button, action ) =>
mouseButtonCallback = ( button, action ) =>
{
var b = button == Glfw.GLFW_MOUSE_BUTTON_1 ? MouseButtons.Left
: button == Glfw.GLFW_MOUSE_BUTTON_2 ? MouseButtons.Right
@@ -78,20 +78,26 @@ namespace OpenRa.GlRenderer
if (action != Glfw.GLFW_PRESS && action != Glfw.GLFW_RELEASE)
throw new InvalidOperationException();
} );
Glfw.glfwSetMousePosCallback(/*mousePositionCallback = */(x, y) =>
};
mousePositionCallback = (x, y) =>
{
mouseX = x;
mouseY = y;
if (initDone)
OpenRa.Game.DispatchMouseInput(MouseInputEvent.Move, new MouseEventArgs(lastButtonBits, 0, x, y, 0), 0);
});
Glfw.glfwSetWindowCloseCallback(/* windowCloseCallback = */() =>
};
windowCloseCallback = () =>
{
OpenRa.Game.Exit();
Glfw.glfwIconifyWindow();
return Gl.GL_TRUE;
} );
};
Glfw.glfwSetMouseButtonCallback( mouseButtonCallback );
Glfw.glfwSetMousePosCallback( mousePositionCallback );
Glfw.glfwSetWindowCloseCallback( windowCloseCallback );
CheckGlError();
Glfw.glfwGetWindowSize(out width, out height);