From 5adefb8fee0f475eccd844f24423abe0c40c3bf8 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Thu, 18 Feb 2010 23:46:00 +1300 Subject: [PATCH] fixes for running on linux --- .gitignore | 3 ++- OpenRa.Game/Game.cs | 6 +++--- OpenRa.Game/Graphics/Renderer.cs | 6 ++++-- OpenRa.Gl/GraphicsDevice.cs | 8 ++++++-- bogus.sno => bogus.SNO | Bin bogus.tem => bogus.TEM | Bin maps/{CAFFEIN0.MPR => caffein0.mpr} | 0 thirdparty/Tao/Tao.OpenAl.dll.config | 4 ++-- 8 files changed, 17 insertions(+), 10 deletions(-) rename bogus.sno => bogus.SNO (100%) rename bogus.tem => bogus.TEM (100%) rename maps/{CAFFEIN0.MPR => caffein0.mpr} (100%) diff --git a/.gitignore b/.gitignore index d1868d3005..9c529438e1 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,5 @@ cg.dll cgGL.dll glfw.dll -/OpenRa.Gl.dll +/OpenRa.Gl.dll +settings.ini diff --git a/OpenRa.Game/Game.cs b/OpenRa.Game/Game.cs index 6fbff46f52..b78e503c30 100644 --- a/OpenRa.Game/Game.cs +++ b/OpenRa.Game/Game.cs @@ -343,8 +343,8 @@ namespace OpenRa desktopResolution.Height); } - [DllImport("user32")] - static extern int ShowCursor([MarshalAs(UnmanagedType.Bool)] bool visible); + // [DllImport("user32")] + // static extern int ShowCursor([MarshalAs(UnmanagedType.Bool)] bool visible); public static void PreInit(Settings settings) { @@ -376,7 +376,7 @@ namespace OpenRa Game.Initialize(Game.Settings.Map, renderer, new int2(resolution), Game.Settings.Player, controller); - ShowCursor(false); + // ShowCursor(false); Game.ResetTimer(); } diff --git a/OpenRa.Game/Graphics/Renderer.cs b/OpenRa.Game/Graphics/Renderer.cs index c4f0884eaa..0bc044760f 100644 --- a/OpenRa.Game/Graphics/Renderer.cs +++ b/OpenRa.Game/Graphics/Renderer.cs @@ -155,7 +155,8 @@ namespace OpenRa.Graphics } public void DrawText(string text, int2 pos, Color c) - { + { + return; using (new PerfSample("text")) { Bitmap b = RenderTextToBitmap(text, fDebug, c); @@ -166,7 +167,8 @@ namespace OpenRa.Graphics } public void DrawText2(string text, int2 pos, Color c) - { + { + return; using (new PerfSample("text")) { Bitmap b = RenderTextToBitmap(text, fTitle, c); diff --git a/OpenRa.Gl/GraphicsDevice.cs b/OpenRa.Gl/GraphicsDevice.cs index bf1709e503..689eebf5a9 100644 --- a/OpenRa.Gl/GraphicsDevice.cs +++ b/OpenRa.Gl/GraphicsDevice.cs @@ -103,13 +103,17 @@ namespace OpenRa.GlRenderer Glfw.glfwGetWindowSize(out width, out height); windowSize = new Size( width, height ); - cgContext = Cg.cgCreateContext(); + cgContext = Cg.cgCreateContext(); + Cg.cgSetErrorCallback( CgErrorCallback ); CgGl.cgGLRegisterStates( cgContext ); CgGl.cgGLSetManageTextureParameters( cgContext, true ); vertexProfile = CgGl.cgGLGetLatestProfile( CgGl.CG_GL_VERTEX ); - fragmentProfile = CgGl.cgGLGetLatestProfile( CgGl.CG_GL_FRAGMENT ); + fragmentProfile = CgGl.cgGLGetLatestProfile( CgGl.CG_GL_FRAGMENT ); + + Console.WriteLine("VP Profile: " + vertexProfile); + Console.WriteLine("FP Profile: " + fragmentProfile); Gl.glEnableClientState( Gl.GL_VERTEX_ARRAY ); CheckGlError(); diff --git a/bogus.sno b/bogus.SNO similarity index 100% rename from bogus.sno rename to bogus.SNO diff --git a/bogus.tem b/bogus.TEM similarity index 100% rename from bogus.tem rename to bogus.TEM diff --git a/maps/CAFFEIN0.MPR b/maps/caffein0.mpr similarity index 100% rename from maps/CAFFEIN0.MPR rename to maps/caffein0.mpr diff --git a/thirdparty/Tao/Tao.OpenAl.dll.config b/thirdparty/Tao/Tao.OpenAl.dll.config index 353ce17e6b..cafbeba30e 100644 --- a/thirdparty/Tao/Tao.OpenAl.dll.config +++ b/thirdparty/Tao/Tao.OpenAl.dll.config @@ -1,11 +1,11 @@ - + - +