diff --git a/INSTALL.md b/INSTALL.md index 41fab1119c..e32f2633d5 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -7,9 +7,7 @@ Windows ======= * [.NET Framework >= 4.0 (Client Profile)](http://www.microsoft.com/en-us/download/details.aspx?id=17113) -* [Cg Toolkit >= 2.2 (optional, for Cg renderer)](https://developer.nvidia.com/cg-toolkit-download) -* [SDL 1.2 (included)](http://libsdl.org/download-1.2.php) -* [SDL 2 (optional)](http://www.libsdl.org/download-2.0.php) +* [SDL 2 (included)](http://www.libsdl.org/download-2.0.php) * [FreeType (included)](http://gnuwin32.sourceforge.net/packages/freetype.htm) * [zlib (included)](http://gnuwin32.sourceforge.net/packages/zlib.htm) * [OpenAL (included)](http://kcat.strangesoft.net/openal.html) @@ -37,12 +35,10 @@ Debian/Ubuntu ------------- * mono-dmcs -* libmono-winforms2.0-cil +* libmono-winforms4.0-cil * cli-common-dev (>= 2.10) * freetype * openal -* sdl -* nvidia-cg-toolkit (optional, for Cg renderer) Slackware --------- @@ -51,7 +47,6 @@ The following packages from slackbuilds.org are required, on 13.37 32-bit: * libgdiplus * mono * openAL -* nvidia-cg-toolkit (optional, for Cg renderer) openSUSE -------- @@ -59,8 +54,7 @@ openSUSE * mono-devel * openal * freetype2 -* SDL -* cg (optional, for Cg renderer) +* SDL2 Gentoo ------ @@ -68,4 +62,3 @@ Gentoo * dev-lang/mono * dev-dotnet/libgdiplus * media-libs/openal -* media-gfx/nvidia-cg-toolkit (optional, for Cg renderer) diff --git a/Makefile b/Makefile index aedc5113d1..555bda430a 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ INSTALL_PROGRAM = $(INSTALL) -m755 INSTALL_DATA = $(INSTALL) -m644 # program targets -CORE = rcg rgl rsdl rsdl2 rnull game utility irc +CORE = rsdl2 rnull game utility irc TOOLS = editor tsbuild ralint VERSION = $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || echo git-`git rev-parse --short HEAD`) @@ -94,28 +94,10 @@ PROGRAMS += irc irc: $(irc_TARGET) # Renderer dlls -rsdl_SRCS := $(shell find OpenRA.Renderer.SdlCommon/ -iname '*.cs') -rsdl_TARGET = OpenRA.Renderer.SdlCommon.dll -rsdl_KIND = library -rsdl_DEPS = $(game_TARGET) -rsdl_LIBS = $(COMMON_LIBS) thirdparty/Tao/Tao.OpenGl.dll thirdparty/Tao/Tao.Sdl.dll $(rsdl_DEPS) - -rcg_SRCS := $(shell find OpenRA.Renderer.Cg/ -iname '*.cs') -rcg_TARGET = OpenRA.Renderer.Cg.dll -rcg_KIND = library -rcg_DEPS = $(game_TARGET) $(rsdl_TARGET) -rcg_LIBS = $(COMMON_LIBS) thirdparty/Tao/Tao.Cg.dll thirdparty/Tao/Tao.OpenGl.dll $(rcg_DEPS) - -rgl_SRCS := $(shell find OpenRA.Renderer.Gl/ -iname '*.cs') -rgl_TARGET = OpenRA.Renderer.Gl.dll -rgl_KIND = library -rgl_DEPS = $(game_TARGET) $(rsdl_TARGET) -rgl_LIBS = $(COMMON_LIBS) thirdparty/Tao/Tao.OpenGl.dll $(rgl_DEPS) - rsdl2_SRCS := $(shell find OpenRA.Renderer.Sdl2/ -iname '*.cs') rsdl2_TARGET = OpenRA.Renderer.Sdl2.dll rsdl2_KIND = library -rsdl2_DEPS = $(game_TARGET) $(rsdl_TARGET) $(rgl_TARGET) +rsdl2_DEPS = $(game_TARGET) rsdl2_LIBS = $(COMMON_LIBS) thirdparty/Tao/Tao.OpenGl.dll thirdparty/SDL2-CS.dll $(rsdl2_DEPS) rnull_SRCS := $(shell find OpenRA.Renderer.Null/ -iname '*.cs') @@ -123,8 +105,8 @@ rnull_TARGET = OpenRA.Renderer.Null.dll rnull_KIND = library rnull_DEPS = $(game_TARGET) rnull_LIBS = $(COMMON_LIBS) $(rnull_DEPS) -PROGRAMS += rcg rgl rsdl2 rnull rsdl -renderers: $(rcg_TARGET) $(rgl_TARGET) $(rsdl2_TARGET) $(rnull_TARGET) $(rsdl_TARGET) +PROGRAMS += rsdl2 rnull +renderers: $(rsdl2_TARGET) $(rnull_TARGET) ##### Official Mods ##### @@ -323,7 +305,6 @@ install-core: default @$(INSTALL_DATA) COPYING "$(DATA_INSTALL_DIR)/COPYING" @$(CP_R) glsl "$(DATA_INSTALL_DIR)" - @$(CP_R) cg "$(DATA_INSTALL_DIR)" @$(CP_R) lua "$(DATA_INSTALL_DIR)" @$(CP) *.ttf "$(DATA_INSTALL_DIR)" @$(CP) thirdparty/Tao/* "$(DATA_INSTALL_DIR)" diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index a218d42a71..b7e928a336 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -320,7 +320,7 @@ namespace OpenRA } GlobalFileSystem.Mount("."); // Needed to access shaders - var renderers = new[] { Settings.Graphics.Renderer, "Sdl2", "Gl", "Cg", null }; + var renderers = new[] { Settings.Graphics.Renderer, "Sdl2", null }; foreach (var r in renderers) { if (r == null) diff --git a/OpenRA.Game/Settings.cs b/OpenRA.Game/Settings.cs index 813325a9bb..0b6f047a6d 100644 --- a/OpenRA.Game/Settings.cs +++ b/OpenRA.Game/Settings.cs @@ -82,7 +82,7 @@ namespace OpenRA public class GraphicSettings { - public string Renderer = "Gl"; + public string Renderer = "Sdl2"; public WindowMode Mode = WindowMode.PseudoFullscreen; public int2 FullscreenSize = new int2(0, 0); public int2 WindowedSize = new int2(1024, 768); diff --git a/OpenRA.Renderer.Cg/GraphicsDevice.cs b/OpenRA.Renderer.Cg/GraphicsDevice.cs deleted file mode 100755 index 070c05647b..0000000000 --- a/OpenRA.Renderer.Cg/GraphicsDevice.cs +++ /dev/null @@ -1,73 +0,0 @@ -#region Copyright & License Information -/* -* Copyright 2007-2011 The OpenRA Developers (see AUTHORS) -* This file is part of OpenRA, which is free software. It is made -* available to you under the terms of the GNU General Public License -* as published by the Free Software Foundation. For more information, -* see COPYING. -*/ -#endregion - -using System; -using System.Drawing; -using OpenRA; -using OpenRA.Graphics; -using OpenRA.Renderer.SdlCommon; -using Tao.Cg; - -[assembly: Renderer(typeof(OpenRA.Renderer.Cg.DeviceFactory))] - -namespace OpenRA.Renderer.Cg -{ - public class DeviceFactory : IDeviceFactory - { - public IGraphicsDevice Create(Size size, WindowMode windowMode) - { - Console.WriteLine("Using SDL 1.2 with Cg renderer"); - return new GraphicsDevice(size, windowMode); - } - } - - public class GraphicsDevice : SdlGraphics - { - static string[] requiredExtensions = - { - "GL_ARB_vertex_program", - "GL_ARB_fragment_program", - "GL_ARB_vertex_buffer_object", - "GL_EXT_framebuffer_object" - }; - - internal IntPtr Context; - internal int VertexProfile, FragmentProfile; - - static Tao.Cg.Cg.CGerrorCallbackFuncDelegate errorCallback = () => - { - var err = Tao.Cg.Cg.cgGetError(); - var msg = "Cg Error: {0}: {1}".F(err, Tao.Cg.Cg.cgGetErrorString(err)); - ErrorHandler.WriteGraphicsLog(msg); - throw new InvalidOperationException("Cg Error. See graphics.log for details"); - }; - - public GraphicsDevice(Size size, WindowMode window) - : base(size, window, requiredExtensions) - { - Context = Tao.Cg.Cg.cgCreateContext(); - - Tao.Cg.Cg.cgSetErrorCallback(errorCallback); - - CgGl.cgGLRegisterStates(Context); - CgGl.cgGLSetManageTextureParameters(Context, true); - VertexProfile = CgGl.cgGLGetLatestProfile(CgGl.CG_GL_VERTEX); - FragmentProfile = CgGl.cgGLGetLatestProfile(CgGl.CG_GL_FRAGMENT); - } - - public override void Quit() - { - Tao.Cg.Cg.cgDestroyContext(Context); - base.Quit(); - } - - public override IShader CreateShader(string name) { return new Shader(this, name); } - } -} diff --git a/OpenRA.Renderer.Cg/OpenRA.Renderer.Cg.csproj b/OpenRA.Renderer.Cg/OpenRA.Renderer.Cg.csproj deleted file mode 100644 index ad414a2617..0000000000 --- a/OpenRA.Renderer.Cg/OpenRA.Renderer.Cg.csproj +++ /dev/null @@ -1,114 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {67CF1A10-C5F6-48FA-B1A7-FE83BE4CE2CC} - Library - Properties - OpenRA.Renderer.Cg - OpenRA.Renderer.Cg - 512 - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - ..\ - DEBUG;TRACE - prompt - 4 - true - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - AllRules.ruleset - - - - - - False - ..\thirdparty\Tao\Tao.Cg.dll - - - False - ..\thirdparty\Tao\Tao.OpenGl.dll - - - False - ..\thirdparty\Tao\Tao.Sdl.dll - - - - - - - - - {0DFB103F-2962-400F-8C6D-E2C28CCBA633} - OpenRA.Game - - - {52FD9F0B-B209-4ED7-8A32-AC8033363263} - OpenRA.Renderer.SdlCommon - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - \ No newline at end of file diff --git a/OpenRA.Renderer.Cg/Settings.StyleCop b/OpenRA.Renderer.Cg/Settings.StyleCop deleted file mode 100644 index 1590d17baa..0000000000 --- a/OpenRA.Renderer.Cg/Settings.StyleCop +++ /dev/null @@ -1,344 +0,0 @@ - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - - - - False - - - - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - - - - False - - - - - False - - - - - False - - - - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - \ No newline at end of file diff --git a/OpenRA.Renderer.Cg/Shader.cs b/OpenRA.Renderer.Cg/Shader.cs deleted file mode 100644 index 16ef162d33..0000000000 --- a/OpenRA.Renderer.Cg/Shader.cs +++ /dev/null @@ -1,118 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation. For more information, - * see COPYING. - */ -#endregion - -using System; -using System.IO; -using OpenRA.FileSystem; -using OpenRA.Graphics; -using OpenRA.Renderer.SdlCommon; - -namespace OpenRA.Renderer.Cg -{ - public class Shader : IShader - { - IntPtr effect; - IntPtr technique; - GraphicsDevice dev; - - public Shader(GraphicsDevice dev, string name) - { - this.dev = dev; - string code; - using (var file = new StreamReader(GlobalFileSystem.Open("cg{0}{1}.fx".F(Path.DirectorySeparatorChar, name)))) - code = file.ReadToEnd(); - effect = Tao.Cg.Cg.cgCreateEffect(dev.Context, code, null); - - if (effect == IntPtr.Zero) - { - var err = Tao.Cg.Cg.cgGetErrorString(Tao.Cg.Cg.cgGetError()); - var results = Tao.Cg.Cg.cgGetLastListing(dev.Context); - throw new InvalidOperationException( - "Cg compile failed ({0}):\n{1}".F(err, results)); - } - - technique = Tao.Cg.Cg.cgGetFirstTechnique(effect); - if (technique == IntPtr.Zero) - throw new InvalidOperationException("No techniques"); - while (Tao.Cg.Cg.cgValidateTechnique(technique) == 0) - { - technique = Tao.Cg.Cg.cgGetNextTechnique(technique); - if (technique == IntPtr.Zero) - throw new InvalidOperationException("No valid techniques"); - } - } - - public void Render(Action a) - { - Tao.Cg.CgGl.cgGLEnableProfile(dev.VertexProfile); - Tao.Cg.CgGl.cgGLEnableProfile(dev.FragmentProfile); - - var pass = Tao.Cg.Cg.cgGetFirstPass(technique); - while (pass != IntPtr.Zero) - { - Tao.Cg.Cg.cgSetPassState(pass); - a(); - Tao.Cg.Cg.cgResetPassState(pass); - pass = Tao.Cg.Cg.cgGetNextPass(pass); - } - - Tao.Cg.CgGl.cgGLDisableProfile(dev.FragmentProfile); - Tao.Cg.CgGl.cgGLDisableProfile(dev.VertexProfile); - } - - public void SetTexture(string name, ITexture t) - { - var texture = (Texture)t; - var param = Tao.Cg.Cg.cgGetNamedEffectParameter(effect, name); - if (param != IntPtr.Zero && texture != null) - Tao.Cg.CgGl.cgGLSetupSampler(param, texture.ID); - } - - public void SetVec(string name, float x) - { - var param = Tao.Cg.Cg.cgGetNamedEffectParameter(effect, name); - if (param != IntPtr.Zero) - Tao.Cg.CgGl.cgGLSetParameter1f(param, x); - } - - public void SetVec(string name, float x, float y) - { - var param = Tao.Cg.Cg.cgGetNamedEffectParameter(effect, name); - if (param != IntPtr.Zero) - Tao.Cg.CgGl.cgGLSetParameter2f(param, x, y); - } - - public void SetVec(string name, float[] vec, int length) - { - var param = Tao.Cg.Cg.cgGetNamedEffectParameter(effect, name); - if (param == IntPtr.Zero) - return; - - switch (length) - { - case 1: Tao.Cg.CgGl.cgGLSetParameter1fv(param, vec); break; - case 2: Tao.Cg.CgGl.cgGLSetParameter2fv(param, vec); break; - case 3: Tao.Cg.CgGl.cgGLSetParameter3fv(param, vec); break; - case 4: Tao.Cg.CgGl.cgGLSetParameter4fv(param, vec); break; - default: throw new InvalidDataException("Invalid vector length"); - } - } - - public void SetMatrix(string name, float[] mtx) - { - if (mtx.Length != 16) - throw new InvalidDataException("Invalid 4x4 matrix"); - - var param = Tao.Cg.Cg.cgGetNamedEffectParameter(effect, name); - if (param != IntPtr.Zero) - Tao.Cg.CgGl.cgGLSetMatrixParameterfr(param, mtx); - } - } -} diff --git a/OpenRA.Renderer.Gl/GraphicsDevice.cs b/OpenRA.Renderer.Gl/GraphicsDevice.cs deleted file mode 100755 index 5a961c83bb..0000000000 --- a/OpenRA.Renderer.Gl/GraphicsDevice.cs +++ /dev/null @@ -1,45 +0,0 @@ -#region Copyright & License Information -/* -* Copyright 2007-2011 The OpenRA Developers (see AUTHORS) -* This file is part of OpenRA, which is free software. It is made -* available to you under the terms of the GNU General Public License -* as published by the Free Software Foundation. For more information, -* see COPYING. -*/ -#endregion - -using System; -using System.Drawing; -using OpenRA; -using OpenRA.Graphics; -using OpenRA.Renderer.SdlCommon; - -[assembly: Renderer(typeof(OpenRA.Renderer.Glsl.DeviceFactory))] - -namespace OpenRA.Renderer.Glsl -{ - public class DeviceFactory : IDeviceFactory - { - public IGraphicsDevice Create(Size size, WindowMode windowMode) - { - Console.WriteLine("Using SDL 1.2 with OpenGL renderer"); - return new GraphicsDevice(size, windowMode); - } - } - - public class GraphicsDevice : SdlGraphics - { - static string[] requiredExtensions = - { - "GL_ARB_vertex_shader", - "GL_ARB_fragment_shader", - "GL_ARB_vertex_buffer_object", - "GL_EXT_framebuffer_object" - }; - - public GraphicsDevice(Size size, WindowMode window) - : base(size, window, requiredExtensions) { } - - public override IShader CreateShader(string name) { return new Shader(name); } - } -} diff --git a/OpenRA.Renderer.Gl/OpenRA.Renderer.Gl.csproj b/OpenRA.Renderer.Gl/OpenRA.Renderer.Gl.csproj deleted file mode 100644 index bc2d40664d..0000000000 --- a/OpenRA.Renderer.Gl/OpenRA.Renderer.Gl.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E9C01A96-C3E2-4772-825B-A740AC513D31} - Library - OpenRA.Renderer.Glsl - OpenRA.Renderer.Gl - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - ..\ - DEBUG - prompt - 4 - false - true - AllRules.ruleset - - - none - false - bin\Release - prompt - 4 - true - false - AllRules.ruleset - - - - - False - ..\thirdparty\Tao\Tao.OpenGl.dll - - - False - ..\thirdparty\Tao\Tao.Sdl.dll - - - - False - ..\thirdparty\Tao\Tao.Cg.dll - - - - - - - - - - {0DFB103F-2962-400F-8C6D-E2C28CCBA633} - OpenRA.Game - - - {52FD9F0B-B209-4ED7-8A32-AC8033363263} - OpenRA.Renderer.SdlCommon - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - \ No newline at end of file diff --git a/OpenRA.Renderer.Gl/Settings.StyleCop b/OpenRA.Renderer.Gl/Settings.StyleCop deleted file mode 100644 index 1590d17baa..0000000000 --- a/OpenRA.Renderer.Gl/Settings.StyleCop +++ /dev/null @@ -1,344 +0,0 @@ - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - - - - False - - - - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - - - - False - - - - - False - - - - - False - - - - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - \ No newline at end of file diff --git a/OpenRA.Renderer.SdlCommon/ErrorHandler.cs b/OpenRA.Renderer.Sdl2/ErrorHandler.cs similarity index 98% rename from OpenRA.Renderer.SdlCommon/ErrorHandler.cs rename to OpenRA.Renderer.Sdl2/ErrorHandler.cs index 2e140f2f53..5d1ec5f88b 100644 --- a/OpenRA.Renderer.SdlCommon/ErrorHandler.cs +++ b/OpenRA.Renderer.Sdl2/ErrorHandler.cs @@ -12,7 +12,7 @@ using System; using System.Diagnostics; using Tao.OpenGl; -namespace OpenRA.Renderer.SdlCommon +namespace OpenRA.Renderer.Sdl2 { public static class ErrorHandler { diff --git a/OpenRA.Renderer.SdlCommon/FrameBuffer.cs b/OpenRA.Renderer.Sdl2/FrameBuffer.cs similarity index 98% rename from OpenRA.Renderer.SdlCommon/FrameBuffer.cs rename to OpenRA.Renderer.Sdl2/FrameBuffer.cs index 5a8b62bc85..6e4eaace76 100644 --- a/OpenRA.Renderer.SdlCommon/FrameBuffer.cs +++ b/OpenRA.Renderer.Sdl2/FrameBuffer.cs @@ -15,7 +15,7 @@ using System.IO; using OpenRA.Graphics; using Tao.OpenGl; -namespace OpenRA.Renderer.SdlCommon +namespace OpenRA.Renderer.Sdl2 { public class FrameBuffer : IFrameBuffer { diff --git a/OpenRA.Renderer.Sdl2/MultiTapDetection.cs b/OpenRA.Renderer.Sdl2/MultiTapDetection.cs new file mode 100644 index 0000000000..20c072b241 --- /dev/null +++ b/OpenRA.Renderer.Sdl2/MultiTapDetection.cs @@ -0,0 +1,84 @@ +#region Copyright & License Information +/* + * Copyright 2007-2013 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +using System; +using OpenRA; +using OpenRA.Primitives; + +namespace OpenRA.Renderer.Sdl2 +{ + public static class MultiTapDetection + { + static Cache keyHistoryCache = + new Cache(_ => new TapHistory(DateTime.Now - TimeSpan.FromSeconds(1))); + static Cache clickHistoryCache = + new Cache(_ => new TapHistory(DateTime.Now - TimeSpan.FromSeconds(1))); + + public static int DetectFromMouse(byte button, int2 xy) + { + return clickHistoryCache[button].GetTapCount(xy); + } + + public static int InfoFromMouse(byte button) + { + return clickHistoryCache[button].LastTapCount(); + } + + public static int DetectFromKeyboard(Keycode key) + { + return keyHistoryCache[key].GetTapCount(int2.Zero); + } + + public static int InfoFromKeyboard(Keycode key) + { + return keyHistoryCache[key].LastTapCount(); + } + } + + class TapHistory + { + public Pair FirstRelease, SecondRelease, ThirdRelease; + + public TapHistory(DateTime now) + { + FirstRelease = SecondRelease = ThirdRelease = Pair.New(now, int2.Zero); + } + + static bool CloseEnough(Pair a, Pair b) + { + return a.First - b.First < TimeSpan.FromMilliseconds(250) + && (a.Second - b.Second).Length < 4; + } + + public int GetTapCount(int2 xy) + { + FirstRelease = SecondRelease; + SecondRelease = ThirdRelease; + ThirdRelease = Pair.New(DateTime.Now, xy); + + if (!CloseEnough(ThirdRelease, SecondRelease)) + return 1; + if (!CloseEnough(SecondRelease, FirstRelease)) + return 2; + + return 3; + } + + public int LastTapCount() + { + if (!CloseEnough(ThirdRelease, SecondRelease)) + return 1; + if (!CloseEnough(SecondRelease, FirstRelease)) + return 2; + + return 3; + } + } +} \ No newline at end of file diff --git a/OpenRA.Renderer.Sdl2/OpenRA.Renderer.Sdl2.csproj b/OpenRA.Renderer.Sdl2/OpenRA.Renderer.Sdl2.csproj index 4062ed3542..8417c540ef 100644 --- a/OpenRA.Renderer.Sdl2/OpenRA.Renderer.Sdl2.csproj +++ b/OpenRA.Renderer.Sdl2/OpenRA.Renderer.Sdl2.csproj @@ -44,6 +44,12 @@ + + + + + + @@ -51,13 +57,5 @@ {0DFB103F-2962-400F-8C6D-E2C28CCBA633} OpenRA.Game - - {52FD9F0B-B209-4ED7-8A32-AC8033363263} - OpenRA.Renderer.SdlCommon - - - {E9C01A96-C3E2-4772-825B-A740AC513D31} - OpenRA.Renderer.Gl - \ No newline at end of file diff --git a/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs b/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs index 88328ff912..88890814c5 100755 --- a/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs +++ b/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs @@ -13,8 +13,6 @@ using System.Drawing; using System.Linq; using OpenRA; using OpenRA.Graphics; -using OpenRA.Renderer.Glsl; -using OpenRA.Renderer.SdlCommon; using SDL2; using Tao.OpenGl; diff --git a/OpenRA.Renderer.Sdl2/Sdl2Input.cs b/OpenRA.Renderer.Sdl2/Sdl2Input.cs index 37c021a524..7aed1c1747 100644 --- a/OpenRA.Renderer.Sdl2/Sdl2Input.cs +++ b/OpenRA.Renderer.Sdl2/Sdl2Input.cs @@ -9,7 +9,6 @@ #endregion using System.Text; -using OpenRA.Renderer.SdlCommon; using SDL2; namespace OpenRA.Renderer.Sdl2 @@ -117,7 +116,7 @@ namespace OpenRA.Renderer.Sdl2 case SDL.SDL_EventType.SDL_MOUSEWHEEL: { // Retain compatibility with existing bogus behavior - // TODO: Implement real scroll behavior after we drop SDL 1.2 support + // TODO: Implement real scroll behavior. We've dropped SDL 1.2 support! if (e.wheel.y == 0) break; diff --git a/OpenRA.Renderer.Gl/Shader.cs b/OpenRA.Renderer.Sdl2/Shader.cs similarity index 98% rename from OpenRA.Renderer.Gl/Shader.cs rename to OpenRA.Renderer.Sdl2/Shader.cs index c3d4bc8b5b..a237eb4cfa 100644 --- a/OpenRA.Renderer.Gl/Shader.cs +++ b/OpenRA.Renderer.Sdl2/Shader.cs @@ -14,10 +14,9 @@ using System.IO; using System.Text; using OpenRA.FileSystem; using OpenRA.Graphics; -using OpenRA.Renderer.SdlCommon; using Tao.OpenGl; -namespace OpenRA.Renderer.Glsl +namespace OpenRA.Renderer.Sdl2 { public class Shader : IShader { diff --git a/OpenRA.Renderer.SdlCommon/Texture.cs b/OpenRA.Renderer.Sdl2/Texture.cs similarity index 99% rename from OpenRA.Renderer.SdlCommon/Texture.cs rename to OpenRA.Renderer.Sdl2/Texture.cs index 3ba537145f..efd977d3d8 100644 --- a/OpenRA.Renderer.SdlCommon/Texture.cs +++ b/OpenRA.Renderer.Sdl2/Texture.cs @@ -15,7 +15,7 @@ using System.IO; using OpenRA.Graphics; using Tao.OpenGl; -namespace OpenRA.Renderer.SdlCommon +namespace OpenRA.Renderer.Sdl2 { public class Texture : ITexture { diff --git a/OpenRA.Renderer.SdlCommon/VertexBuffer.cs b/OpenRA.Renderer.Sdl2/VertexBuffer.cs similarity index 97% rename from OpenRA.Renderer.SdlCommon/VertexBuffer.cs rename to OpenRA.Renderer.Sdl2/VertexBuffer.cs index 0439acd2f3..af6d4fcbe6 100644 --- a/OpenRA.Renderer.SdlCommon/VertexBuffer.cs +++ b/OpenRA.Renderer.Sdl2/VertexBuffer.cs @@ -13,7 +13,7 @@ using System.Runtime.InteropServices; using OpenRA.Graphics; using Tao.OpenGl; -namespace OpenRA.Renderer.SdlCommon +namespace OpenRA.Renderer.Sdl2 { public class VertexBuffer : IVertexBuffer where T : struct diff --git a/OpenRA.Renderer.SdlCommon/MultiTapDetection.cs b/OpenRA.Renderer.SdlCommon/MultiTapDetection.cs deleted file mode 100644 index ae61568b63..0000000000 --- a/OpenRA.Renderer.SdlCommon/MultiTapDetection.cs +++ /dev/null @@ -1,81 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2013 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation. For more information, - * see COPYING. - */ -#endregion - -using System; -using OpenRA; -using OpenRA.Primitives; - -public static class MultiTapDetection -{ - static Cache keyHistoryCache = - new Cache(_ => new TapHistory(DateTime.Now - TimeSpan.FromSeconds(1))); - static Cache clickHistoryCache = - new Cache(_ => new TapHistory(DateTime.Now - TimeSpan.FromSeconds(1))); - - public static int DetectFromMouse(byte button, int2 xy) - { - return clickHistoryCache[button].GetTapCount(xy); - } - - public static int InfoFromMouse(byte button) - { - return clickHistoryCache[button].LastTapCount(); - } - - public static int DetectFromKeyboard(Keycode key) - { - return keyHistoryCache[key].GetTapCount(int2.Zero); - } - - public static int InfoFromKeyboard(Keycode key) - { - return keyHistoryCache[key].LastTapCount(); - } -} - -class TapHistory -{ - public Pair FirstRelease, SecondRelease, ThirdRelease; - - public TapHistory(DateTime now) - { - FirstRelease = SecondRelease = ThirdRelease = Pair.New(now, int2.Zero); - } - - static bool CloseEnough(Pair a, Pair b) - { - return a.First - b.First < TimeSpan.FromMilliseconds(250) - && (a.Second - b.Second).Length < 4; - } - - public int GetTapCount(int2 xy) - { - FirstRelease = SecondRelease; - SecondRelease = ThirdRelease; - ThirdRelease = Pair.New(DateTime.Now, xy); - - if (!CloseEnough(ThirdRelease, SecondRelease)) - return 1; - if (!CloseEnough(SecondRelease, FirstRelease)) - return 2; - - return 3; - } - - public int LastTapCount() - { - if (!CloseEnough(ThirdRelease, SecondRelease)) - return 1; - if (!CloseEnough(SecondRelease, FirstRelease)) - return 2; - - return 3; - } -} \ No newline at end of file diff --git a/OpenRA.Renderer.SdlCommon/OpenRA.Renderer.SdlCommon.csproj b/OpenRA.Renderer.SdlCommon/OpenRA.Renderer.SdlCommon.csproj deleted file mode 100644 index b7ba9c059e..0000000000 --- a/OpenRA.Renderer.SdlCommon/OpenRA.Renderer.SdlCommon.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {52FD9F0B-B209-4ED7-8A32-AC8033363263} - Library - OpenRA.Renderer.SdlCommon - OpenRA.Renderer.SdlCommon - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - ..\ - DEBUG - prompt - 4 - false - true - AllRules.ruleset - - - none - false - ..\ - prompt - 4 - false - AllRules.ruleset - true - - - - - - False - ..\thirdparty\Tao\Tao.OpenGl.dll - - - False - ..\thirdparty\Tao\Tao.Sdl.dll - - - - - - - - - - - - - - {0DFB103F-2962-400F-8C6D-E2C28CCBA633} - OpenRA.Game - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - \ No newline at end of file diff --git a/OpenRA.Renderer.SdlCommon/SdlGraphics.cs b/OpenRA.Renderer.SdlCommon/SdlGraphics.cs deleted file mode 100644 index 5b6d1657e6..0000000000 --- a/OpenRA.Renderer.SdlCommon/SdlGraphics.cs +++ /dev/null @@ -1,223 +0,0 @@ -#region Copyright & License Information -/* -* Copyright 2007-2011 The OpenRA Developers (see AUTHORS) -* This file is part of OpenRA, which is free software. It is made -* available to you under the terms of the GNU General Public License -* as published by the Free Software Foundation. For more information, -* see COPYING. -*/ -#endregion - -using System; -using System.Drawing; -using System.Linq; -using System.Runtime.InteropServices; -using OpenRA.Graphics; -using Tao.OpenGl; -using Tao.Sdl; - -namespace OpenRA.Renderer.SdlCommon -{ - public abstract class SdlGraphics : IGraphicsDevice - { - Size windowSize; - SdlInput input; - - public Size WindowSize { get { return windowSize; } } - - public SdlGraphics(Size size, WindowMode window, string[] extensions) - { - windowSize = size; - InitializeSdlGl(ref windowSize, window, extensions); - - Gl.glEnableClientState(Gl.GL_VERTEX_ARRAY); - ErrorHandler.CheckGlError(); - Gl.glEnableClientState(Gl.GL_TEXTURE_COORD_ARRAY); - ErrorHandler.CheckGlError(); - - Sdl.SDL_SetModState(0); - - input = new SdlInput(); - } - - IntPtr InitializeSdlGl(ref Size size, WindowMode window, string[] requiredExtensions) - { - Sdl.SDL_Init(Sdl.SDL_INIT_NOPARACHUTE | Sdl.SDL_INIT_VIDEO); - Sdl.SDL_GL_SetAttribute(Sdl.SDL_GL_DOUBLEBUFFER, 1); - Sdl.SDL_GL_SetAttribute(Sdl.SDL_GL_RED_SIZE, 8); - Sdl.SDL_GL_SetAttribute(Sdl.SDL_GL_GREEN_SIZE, 8); - Sdl.SDL_GL_SetAttribute(Sdl.SDL_GL_BLUE_SIZE, 8); - Sdl.SDL_GL_SetAttribute(Sdl.SDL_GL_ALPHA_SIZE, 0); - - int windowFlags = 0; - switch (window) - { - case WindowMode.Fullscreen: - windowFlags |= Sdl.SDL_FULLSCREEN; - break; - case WindowMode.PseudoFullscreen: - windowFlags |= Sdl.SDL_NOFRAME; - Environment.SetEnvironmentVariable("SDL_VIDEO_WINDOW_POS", "0,0"); - break; - case WindowMode.Windowed: - Environment.SetEnvironmentVariable("SDL_VIDEO_CENTERED", "1"); - break; - default: - break; - } - - var info = (Sdl.SDL_VideoInfo)Marshal.PtrToStructure( - Sdl.SDL_GetVideoInfo(), typeof(Sdl.SDL_VideoInfo)); - Console.WriteLine("Desktop resolution: {0}x{1}", - info.current_w, info.current_h); - - if (size.Width == 0 && size.Height == 0) - { - Console.WriteLine("No custom resolution provided, using desktop resolution"); - size = new Size(info.current_w, info.current_h); - } - - Console.WriteLine("Using resolution: {0}x{1}", size.Width, size.Height); - - var surf = Sdl.SDL_SetVideoMode(size.Width, size.Height, 0, Sdl.SDL_OPENGL | windowFlags); - if (surf == IntPtr.Zero) - Console.WriteLine("Failed to set video mode."); - - Sdl.SDL_WM_SetCaption("OpenRA", "OpenRA"); - Sdl.SDL_ShowCursor(0); - Sdl.SDL_EnableUNICODE(1); - Sdl.SDL_EnableKeyRepeat(Sdl.SDL_DEFAULT_REPEAT_DELAY, Sdl.SDL_DEFAULT_REPEAT_INTERVAL); - - ErrorHandler.CheckGlError(); - - var extensions = Gl.glGetString(Gl.GL_EXTENSIONS); - if (extensions == null) - Console.WriteLine("Failed to fetch GL_EXTENSIONS, this is bad."); - - var missingExtensions = requiredExtensions.Where(r => !extensions.Contains(r)).ToArray(); - - if (missingExtensions.Any()) - { - ErrorHandler.WriteGraphicsLog("Unsupported GPU: Missing extensions: {0}" - .F(missingExtensions.JoinWith(","))); - throw new InvalidProgramException("Unsupported GPU. See graphics.log for details."); - } - - return surf; - } - - public virtual void Quit() - { - Sdl.SDL_Quit(); - } - - int ModeFromPrimitiveType(PrimitiveType pt) - { - switch (pt) - { - case PrimitiveType.PointList: return Gl.GL_POINTS; - case PrimitiveType.LineList: return Gl.GL_LINES; - case PrimitiveType.TriangleList: return Gl.GL_TRIANGLES; - case PrimitiveType.QuadList: return Gl.GL_QUADS; - } - - throw new NotImplementedException(); - } - - public void DrawPrimitives(PrimitiveType pt, int firstVertex, int numVertices) - { - Gl.glDrawArrays(ModeFromPrimitiveType(pt), firstVertex, numVertices); - ErrorHandler.CheckGlError(); - } - - public void Clear() - { - Gl.glClearColor(0, 0, 0, 0); - ErrorHandler.CheckGlError(); - Gl.glClear(Gl.GL_COLOR_BUFFER_BIT); - ErrorHandler.CheckGlError(); - } - - public void EnableDepthBuffer() - { - Gl.glClear(Gl.GL_DEPTH_BUFFER_BIT); - ErrorHandler.CheckGlError(); - Gl.glEnable(Gl.GL_DEPTH_TEST); - ErrorHandler.CheckGlError(); - } - - public void DisableDepthBuffer() - { - Gl.glDisable(Gl.GL_DEPTH_TEST); - ErrorHandler.CheckGlError(); - } - - public void SetBlendMode(BlendMode mode) - { - Gl.glBlendEquation(Gl.GL_FUNC_ADD); - ErrorHandler.CheckGlError(); - - switch (mode) - { - case BlendMode.None: - Gl.glDisable(Gl.GL_BLEND); - break; - case BlendMode.Alpha: - Gl.glEnable(Gl.GL_BLEND); - ErrorHandler.CheckGlError(); - Gl.glBlendFunc(Gl.GL_SRC_ALPHA, Gl.GL_ONE_MINUS_SRC_ALPHA); - break; - case BlendMode.Additive: - Gl.glEnable(Gl.GL_BLEND); - ErrorHandler.CheckGlError(); - Gl.glBlendFunc(Gl.GL_ONE, Gl.GL_ONE); - break; - case BlendMode.Subtractive: - Gl.glEnable(Gl.GL_BLEND); - ErrorHandler.CheckGlError(); - Gl.glBlendFunc(Gl.GL_ONE, Gl.GL_ONE); - ErrorHandler.CheckGlError(); - Gl.glBlendEquation(Gl.GL_FUNC_REVERSE_SUBTRACT); - break; - case BlendMode.Multiply: - Gl.glEnable(Gl.GL_BLEND); - ErrorHandler.CheckGlError(); - Gl.glBlendFuncSeparate(Gl.GL_DST_COLOR, Gl.GL_ZERO, Gl.GL_ONE, Gl.GL_ONE_MINUS_SRC_ALPHA); - ErrorHandler.CheckGlError(); - break; - } - ErrorHandler.CheckGlError(); - } - - public void EnableScissor(int left, int top, int width, int height) - { - if (width < 0) width = 0; - if (height < 0) height = 0; - - Gl.glScissor(left, windowSize.Height - (top + height), width, height); - ErrorHandler.CheckGlError(); - Gl.glEnable(Gl.GL_SCISSOR_TEST); - ErrorHandler.CheckGlError(); - } - - public void DisableScissor() - { - Gl.glDisable(Gl.GL_SCISSOR_TEST); - ErrorHandler.CheckGlError(); - } - - public void SetLineWidth(float width) - { - Gl.glLineWidth(width); - ErrorHandler.CheckGlError(); - } - - public void Present() { Sdl.SDL_GL_SwapBuffers(); } - public void PumpInput(IInputHandler inputHandler) { input.PumpInput(inputHandler); } - public IVertexBuffer CreateVertexBuffer(int size) { return new VertexBuffer(size); } - public ITexture CreateTexture() { return new Texture(); } - public ITexture CreateTexture(Bitmap bitmap) { return new Texture(bitmap); } - public IFrameBuffer CreateFrameBuffer(Size s) { return new FrameBuffer(s); } - public abstract IShader CreateShader(string name); - } -} \ No newline at end of file diff --git a/OpenRA.Renderer.SdlCommon/SdlInput.cs b/OpenRA.Renderer.SdlCommon/SdlInput.cs deleted file mode 100644 index 48d0a40312..0000000000 --- a/OpenRA.Renderer.SdlCommon/SdlInput.cs +++ /dev/null @@ -1,304 +0,0 @@ -#region Copyright & License Information -/* -* Copyright 2007-2011 The OpenRA Developers (see AUTHORS) -* This file is part of OpenRA, which is free software. It is made -* available to you under the terms of the GNU General Public License -* as published by the Free Software Foundation. For more information, -* see COPYING. -*/ -#endregion - -using System.Collections.Generic; -using Tao.Sdl; - -namespace OpenRA.Renderer.SdlCommon -{ - public class SdlInput - { - static readonly Dictionary KeyRemap = new Dictionary - { - { Sdl.SDLK_BACKSPACE, Keycode.BACKSPACE }, - { Sdl.SDLK_TAB, Keycode.TAB }, - { Sdl.SDLK_CLEAR, Keycode.CLEAR }, - { Sdl.SDLK_RETURN, Keycode.RETURN }, - { Sdl.SDLK_PAUSE, Keycode.PAUSE }, - { Sdl.SDLK_ESCAPE, Keycode.ESCAPE }, - { Sdl.SDLK_SPACE, Keycode.SPACE }, - { Sdl.SDLK_EXCLAIM, Keycode.EXCLAIM }, - { Sdl.SDLK_QUOTEDBL, Keycode.QUOTEDBL }, - { Sdl.SDLK_HASH, Keycode.HASH }, - { Sdl.SDLK_DOLLAR, Keycode.DOLLAR }, - { Sdl.SDLK_AMPERSAND, Keycode.AMPERSAND }, - { Sdl.SDLK_QUOTE, Keycode.QUOTE }, - { Sdl.SDLK_LEFTPAREN, Keycode.LEFTPAREN }, - { Sdl.SDLK_RIGHTPAREN, Keycode.RIGHTPAREN }, - { Sdl.SDLK_ASTERISK, Keycode.ASTERISK }, - { Sdl.SDLK_PLUS, Keycode.PLUS }, - { Sdl.SDLK_COMMA, Keycode.COMMA }, - { Sdl.SDLK_MINUS, Keycode.MINUS }, - { Sdl.SDLK_PERIOD, Keycode.PERIOD }, - { Sdl.SDLK_SLASH, Keycode.SLASH }, - { Sdl.SDLK_0, Keycode.NUMBER_0 }, - { Sdl.SDLK_1, Keycode.NUMBER_1 }, - { Sdl.SDLK_2, Keycode.NUMBER_2 }, - { Sdl.SDLK_3, Keycode.NUMBER_3 }, - { Sdl.SDLK_4, Keycode.NUMBER_4 }, - { Sdl.SDLK_5, Keycode.NUMBER_5 }, - { Sdl.SDLK_6, Keycode.NUMBER_6 }, - { Sdl.SDLK_7, Keycode.NUMBER_7 }, - { Sdl.SDLK_8, Keycode.NUMBER_8 }, - { Sdl.SDLK_9, Keycode.NUMBER_9 }, - { Sdl.SDLK_COLON, Keycode.COLON }, - { Sdl.SDLK_SEMICOLON, Keycode.SEMICOLON }, - { Sdl.SDLK_LESS, Keycode.LESS }, - { Sdl.SDLK_EQUALS, Keycode.EQUALS }, - { Sdl.SDLK_GREATER, Keycode.GREATER }, - { Sdl.SDLK_QUESTION, Keycode.QUESTION }, - { Sdl.SDLK_AT, Keycode.AT }, - { Sdl.SDLK_LEFTBRACKET, Keycode.LEFTBRACKET }, - { Sdl.SDLK_BACKSLASH, Keycode.BACKSLASH }, - { Sdl.SDLK_RIGHTBRACKET, Keycode.RIGHTBRACKET }, - { Sdl.SDLK_CARET, Keycode.CARET }, - { Sdl.SDLK_UNDERSCORE, Keycode.UNDERSCORE }, - { Sdl.SDLK_BACKQUOTE, Keycode.BACKQUOTE }, - { Sdl.SDLK_a, Keycode.A }, - { Sdl.SDLK_b, Keycode.B }, - { Sdl.SDLK_c, Keycode.C }, - { Sdl.SDLK_d, Keycode.D }, - { Sdl.SDLK_e, Keycode.E }, - { Sdl.SDLK_f, Keycode.F }, - { Sdl.SDLK_g, Keycode.G }, - { Sdl.SDLK_h, Keycode.H }, - { Sdl.SDLK_i, Keycode.I }, - { Sdl.SDLK_j, Keycode.J }, - { Sdl.SDLK_k, Keycode.K }, - { Sdl.SDLK_l, Keycode.L }, - { Sdl.SDLK_m, Keycode.M }, - { Sdl.SDLK_n, Keycode.N }, - { Sdl.SDLK_o, Keycode.O }, - { Sdl.SDLK_p, Keycode.P }, - { Sdl.SDLK_q, Keycode.Q }, - { Sdl.SDLK_r, Keycode.R }, - { Sdl.SDLK_s, Keycode.S }, - { Sdl.SDLK_t, Keycode.T }, - { Sdl.SDLK_u, Keycode.U }, - { Sdl.SDLK_v, Keycode.V }, - { Sdl.SDLK_w, Keycode.W }, - { Sdl.SDLK_x, Keycode.X }, - { Sdl.SDLK_y, Keycode.Y }, - { Sdl.SDLK_z, Keycode.Z }, - { Sdl.SDLK_DELETE, Keycode.DELETE }, - { Sdl.SDLK_KP0, Keycode.KP_0 }, - { Sdl.SDLK_KP1, Keycode.KP_1 }, - { Sdl.SDLK_KP2, Keycode.KP_2 }, - { Sdl.SDLK_KP3, Keycode.KP_3 }, - { Sdl.SDLK_KP4, Keycode.KP_4 }, - { Sdl.SDLK_KP5, Keycode.KP_5 }, - { Sdl.SDLK_KP6, Keycode.KP_6 }, - { Sdl.SDLK_KP7, Keycode.KP_7 }, - { Sdl.SDLK_KP8, Keycode.KP_8 }, - { Sdl.SDLK_KP9, Keycode.KP_9 }, - { Sdl.SDLK_KP_PERIOD, Keycode.KP_PERIOD }, - { Sdl.SDLK_KP_DIVIDE, Keycode.KP_DIVIDE }, - { Sdl.SDLK_KP_MULTIPLY, Keycode.KP_MULTIPLY }, - { Sdl.SDLK_KP_MINUS, Keycode.KP_MINUS }, - { Sdl.SDLK_KP_PLUS, Keycode.KP_PLUS }, - { Sdl.SDLK_KP_ENTER, Keycode.KP_ENTER }, - { Sdl.SDLK_KP_EQUALS, Keycode.KP_EQUALS }, - { Sdl.SDLK_UP, Keycode.UP }, - { Sdl.SDLK_DOWN, Keycode.DOWN }, - { Sdl.SDLK_RIGHT, Keycode.RIGHT }, - { Sdl.SDLK_LEFT, Keycode.LEFT }, - { Sdl.SDLK_INSERT, Keycode.INSERT }, - { Sdl.SDLK_HOME, Keycode.HOME }, - { Sdl.SDLK_END, Keycode.END }, - { Sdl.SDLK_PAGEUP, Keycode.PAGEUP }, - { Sdl.SDLK_PAGEDOWN, Keycode.PAGEDOWN }, - { Sdl.SDLK_F1, Keycode.F1 }, - { Sdl.SDLK_F2, Keycode.F2 }, - { Sdl.SDLK_F3, Keycode.F3 }, - { Sdl.SDLK_F4, Keycode.F4 }, - { Sdl.SDLK_F5, Keycode.F5 }, - { Sdl.SDLK_F6, Keycode.F6 }, - { Sdl.SDLK_F7, Keycode.F7 }, - { Sdl.SDLK_F8, Keycode.F8 }, - { Sdl.SDLK_F9, Keycode.F9 }, - { Sdl.SDLK_F10, Keycode.F10 }, - { Sdl.SDLK_F11, Keycode.F11 }, - { Sdl.SDLK_F12, Keycode.F12 }, - { Sdl.SDLK_F13, Keycode.F13 }, - { Sdl.SDLK_F14, Keycode.F14 }, - { Sdl.SDLK_F15, Keycode.F15 }, - { Sdl.SDLK_NUMLOCK, Keycode.NUMLOCKCLEAR }, - { Sdl.SDLK_CAPSLOCK, Keycode.CAPSLOCK }, - { Sdl.SDLK_SCROLLOCK, Keycode.SCROLLLOCK }, - { Sdl.SDLK_RSHIFT, Keycode.RSHIFT }, - { Sdl.SDLK_LSHIFT, Keycode.LSHIFT }, - { Sdl.SDLK_RCTRL, Keycode.RCTRL }, - { Sdl.SDLK_LCTRL, Keycode.LCTRL }, - { Sdl.SDLK_RALT, Keycode.RALT }, - { Sdl.SDLK_LALT, Keycode.LALT }, - { Sdl.SDLK_RMETA, Keycode.RGUI }, - { Sdl.SDLK_LMETA, Keycode.LGUI }, - { Sdl.SDLK_LSUPER, Keycode.LGUI }, - { Sdl.SDLK_RSUPER, Keycode.RGUI }, - { Sdl.SDLK_MODE, Keycode.MODE }, - { Sdl.SDLK_HELP, Keycode.HELP }, - { Sdl.SDLK_PRINT, Keycode.PRINTSCREEN }, - { Sdl.SDLK_SYSREQ, Keycode.SYSREQ }, - { Sdl.SDLK_MENU, Keycode.MENU }, - { Sdl.SDLK_POWER, Keycode.POWER }, - { Sdl.SDLK_UNDO, Keycode.UNDO }, - }; - - - MouseButton lastButtonBits = (MouseButton)0; - - static bool IsValidInput(char c) - { - return char.IsLetter(c) || char.IsDigit(c) || - char.IsSymbol(c) || char.IsSeparator(c) || - char.IsPunctuation(c); - } - - MouseButton MakeButton(byte b) - { - return b == Sdl.SDL_BUTTON_LEFT ? MouseButton.Left - : b == Sdl.SDL_BUTTON_RIGHT ? MouseButton.Right - : b == Sdl.SDL_BUTTON_MIDDLE ? MouseButton.Middle - : b == Sdl.SDL_BUTTON_WHEELDOWN ? MouseButton.WheelDown - : b == Sdl.SDL_BUTTON_WHEELUP ? MouseButton.WheelUp - : 0; - } - - Modifiers MakeModifiers(int raw) - { - return ((raw & Sdl.KMOD_ALT) != 0 ? Modifiers.Alt : 0) - | ((raw & Sdl.KMOD_CTRL) != 0 ? Modifiers.Ctrl : 0) - | ((raw & Sdl.KMOD_META) != 0 ? Modifiers.Meta : 0) - | ((raw & Sdl.KMOD_SHIFT) != 0 ? Modifiers.Shift : 0); - } - - public void PumpInput(IInputHandler inputHandler) - { - Game.HasInputFocus = 0 != (Sdl.SDL_GetAppState() & Sdl.SDL_APPINPUTFOCUS); - - var mods = MakeModifiers(Sdl.SDL_GetModState()); - inputHandler.ModifierKeys(mods); - MouseInput? pendingMotion = null; - - Sdl.SDL_Event e; - while (Sdl.SDL_PollEvent(out e) != 0) - { - switch (e.type) - { - case Sdl.SDL_QUIT: - Game.Exit(); - break; - - case Sdl.SDL_MOUSEBUTTONDOWN: - { - if (pendingMotion != null) - { - inputHandler.OnMouseInput(pendingMotion.Value); - pendingMotion = null; - } - - var button = MakeButton(e.button.button); - lastButtonBits |= button; - - var pos = new int2(e.button.x, e.button.y); - - inputHandler.OnMouseInput(new MouseInput( - MouseInputEvent.Down, button, pos, mods, - MultiTapDetection.DetectFromMouse(e.button.button, pos))); - - break; - } - - case Sdl.SDL_MOUSEBUTTONUP: - { - if (pendingMotion != null) - { - inputHandler.OnMouseInput(pendingMotion.Value); - pendingMotion = null; - } - - var button = MakeButton(e.button.button); - lastButtonBits &= ~button; - - var pos = new int2(e.button.x, e.button.y); - inputHandler.OnMouseInput(new MouseInput( - MouseInputEvent.Up, button, pos, mods, - MultiTapDetection.InfoFromMouse(e.button.button))); - - break; - } - - case Sdl.SDL_MOUSEMOTION: - { - pendingMotion = new MouseInput( - MouseInputEvent.Move, lastButtonBits, - new int2(e.motion.x, e.motion.y), mods, 0); - - break; - } - - case Sdl.SDL_KEYDOWN: - case Sdl.SDL_KEYUP: - { - // Drop unknown keys - Keycode keyCode; - if (!KeyRemap.TryGetValue(e.key.keysym.sym, out keyCode)) - { - // Try parsing it as text - var c = (char)e.key.keysym.unicode; - if (IsValidInput(c)) - inputHandler.OnTextInput(c.ToString()); - - break; - } - - var type = e.type == Sdl.SDL_KEYDOWN ? - KeyInputEvent.Down : KeyInputEvent.Up; - - var tapCount = e.type == Sdl.SDL_KEYDOWN ? - MultiTapDetection.DetectFromKeyboard(keyCode) : - MultiTapDetection.InfoFromKeyboard(keyCode); - - var keyEvent = new KeyInput - { - Event = type, - Key = keyCode, - Modifiers = mods, - UnicodeChar = (char)e.key.keysym.unicode, - MultiTapCount = tapCount - }; - - // Special case workaround for windows users - if (e.key.keysym.sym == Sdl.SDLK_F4 && mods.HasModifier(Modifiers.Alt) && - Platform.CurrentPlatform == PlatformType.Windows) - { - Game.Exit(); - } - else - inputHandler.OnKeyInput(keyEvent); - - if (IsValidInput(keyEvent.UnicodeChar)) - inputHandler.OnTextInput(keyEvent.UnicodeChar.ToString()); - - break; - } - } - } - - if (pendingMotion != null) - { - inputHandler.OnMouseInput(pendingMotion.Value); - pendingMotion = null; - } - - ErrorHandler.CheckGlError(); - } - } -} \ No newline at end of file diff --git a/OpenRA.Renderer.SdlCommon/Settings.StyleCop b/OpenRA.Renderer.SdlCommon/Settings.StyleCop deleted file mode 100644 index 1590d17baa..0000000000 --- a/OpenRA.Renderer.SdlCommon/Settings.StyleCop +++ /dev/null @@ -1,344 +0,0 @@ - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - - - - False - - - - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - - - - False - - - - - False - - - - - False - - - - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - \ No newline at end of file diff --git a/OpenRA.sln b/OpenRA.sln index 5ca7fa6bae..78426b87a9 100644 --- a/OpenRA.sln +++ b/OpenRA.sln @@ -7,8 +7,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Mods.RA", "OpenRA.Mo EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Mods.Cnc", "OpenRA.Mods.Cnc\OpenRA.Mods.Cnc.csproj", "{2881135D-4D62-493E-8F83-5EEE92CCC6BE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Renderer.Cg", "OpenRA.Renderer.Cg\OpenRA.Renderer.Cg.csproj", "{67CF1A10-C5F6-48FA-B1A7-FE83BE4CE2CC}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Editor", "OpenRA.Editor\OpenRA.Editor.csproj", "{00038B75-405B-44F5-8691-BD2546DBE224}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.TilesetBuilder", "OpenRA.TilesetBuilder\OpenRA.TilesetBuilder.csproj", "{1A8E50CC-EE32-4E57-8842-0C39C8EA7541}" @@ -19,10 +17,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Utility", "OpenRA.Ut EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Renderer.Null", "OpenRA.Renderer.Null\OpenRA.Renderer.Null.csproj", "{0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Renderer.Gl", "OpenRA.Renderer.Gl\OpenRA.Renderer.Gl.csproj", "{E9C01A96-C3E2-4772-825B-A740AC513D31}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Renderer.SdlCommon", "OpenRA.Renderer.SdlCommon\OpenRA.Renderer.SdlCommon.csproj", "{52FD9F0B-B209-4ED7-8A32-AC8033363263}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Mods.D2k", "OpenRA.Mods.D2k\OpenRA.Mods.D2k.csproj", "{C0B0465C-6BE2-409C-8770-3A9BF64C4344}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Mods.TS", "OpenRA.Mods.TS\OpenRA.Mods.TS.csproj", "{5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}" @@ -64,37 +58,6 @@ Global Release|Mixed Platforms = Release|Mixed Platforms EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Debug|Any CPU.ActiveCfg = Debug|x86 - {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Debug|Any CPU.Build.0 = Debug|x86 - {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Release|Any CPU.ActiveCfg = Release|x86 - {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Release|Mixed Platforms.Build.0 = Release|x86 - {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Release|Any CPU.Build.0 = Release|Any CPU - {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Release|Any CPU.Build.0 = Release|Any CPU - {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {67CF1A10-C5F6-48FA-B1A7-FE83BE4CE2CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {67CF1A10-C5F6-48FA-B1A7-FE83BE4CE2CC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {67CF1A10-C5F6-48FA-B1A7-FE83BE4CE2CC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {67CF1A10-C5F6-48FA-B1A7-FE83BE4CE2CC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {67CF1A10-C5F6-48FA-B1A7-FE83BE4CE2CC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {67CF1A10-C5F6-48FA-B1A7-FE83BE4CE2CC}.Release|Any CPU.Build.0 = Release|Any CPU - {67CF1A10-C5F6-48FA-B1A7-FE83BE4CE2CC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {67CF1A10-C5F6-48FA-B1A7-FE83BE4CE2CC}.Release|Mixed Platforms.Build.0 = Release|Any CPU {00038B75-405B-44F5-8691-BD2546DBE224}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {00038B75-405B-44F5-8691-BD2546DBE224}.Debug|Any CPU.Build.0 = Debug|Any CPU {00038B75-405B-44F5-8691-BD2546DBE224}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -103,30 +66,6 @@ Global {00038B75-405B-44F5-8691-BD2546DBE224}.Release|Any CPU.Build.0 = Release|Any CPU {00038B75-405B-44F5-8691-BD2546DBE224}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {00038B75-405B-44F5-8691-BD2546DBE224}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {1A8E50CC-EE32-4E57-8842-0C39C8EA7541}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1A8E50CC-EE32-4E57-8842-0C39C8EA7541}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1A8E50CC-EE32-4E57-8842-0C39C8EA7541}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {1A8E50CC-EE32-4E57-8842-0C39C8EA7541}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {1A8E50CC-EE32-4E57-8842-0C39C8EA7541}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1A8E50CC-EE32-4E57-8842-0C39C8EA7541}.Release|Any CPU.Build.0 = Release|Any CPU - {1A8E50CC-EE32-4E57-8842-0C39C8EA7541}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {1A8E50CC-EE32-4E57-8842-0C39C8EA7541}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F9FA4D9F-2302-470A-8A07-6E37F488C124}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F9FA4D9F-2302-470A-8A07-6E37F488C124}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F9FA4D9F-2302-470A-8A07-6E37F488C124}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F9FA4D9F-2302-470A-8A07-6E37F488C124}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F9FA4D9F-2302-470A-8A07-6E37F488C124}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F9FA4D9F-2302-470A-8A07-6E37F488C124}.Release|Any CPU.Build.0 = Release|Any CPU - {F9FA4D9F-2302-470A-8A07-6E37F488C124}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F9FA4D9F-2302-470A-8A07-6E37F488C124}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F33337BE-CB69-4B24-850F-07D23E408DDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F33337BE-CB69-4B24-850F-07D23E408DDF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F33337BE-CB69-4B24-850F-07D23E408DDF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F33337BE-CB69-4B24-850F-07D23E408DDF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F33337BE-CB69-4B24-850F-07D23E408DDF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F33337BE-CB69-4B24-850F-07D23E408DDF}.Release|Any CPU.Build.0 = Release|Any CPU - {F33337BE-CB69-4B24-850F-07D23E408DDF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F33337BE-CB69-4B24-850F-07D23E408DDF}.Release|Mixed Platforms.Build.0 = Release|Any CPU {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Debug|Any CPU.Build.0 = Debug|Any CPU {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -135,54 +74,29 @@ Global {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Release|Any CPU.Build.0 = Release|Any CPU {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {0C4AEC1A-E7D5-4114-8CCD-3EEC82872981}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {E9C01A96-C3E2-4772-825B-A740AC513D31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E9C01A96-C3E2-4772-825B-A740AC513D31}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E9C01A96-C3E2-4772-825B-A740AC513D31}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {E9C01A96-C3E2-4772-825B-A740AC513D31}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {E9C01A96-C3E2-4772-825B-A740AC513D31}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E9C01A96-C3E2-4772-825B-A740AC513D31}.Release|Any CPU.Build.0 = Release|Any CPU - {E9C01A96-C3E2-4772-825B-A740AC513D31}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {E9C01A96-C3E2-4772-825B-A740AC513D31}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {52FD9F0B-B209-4ED7-8A32-AC8033363263}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {52FD9F0B-B209-4ED7-8A32-AC8033363263}.Debug|Any CPU.Build.0 = Debug|Any CPU - {52FD9F0B-B209-4ED7-8A32-AC8033363263}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {52FD9F0B-B209-4ED7-8A32-AC8033363263}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {52FD9F0B-B209-4ED7-8A32-AC8033363263}.Release|Any CPU.ActiveCfg = Release|Any CPU - {52FD9F0B-B209-4ED7-8A32-AC8033363263}.Release|Any CPU.Build.0 = Release|Any CPU - {52FD9F0B-B209-4ED7-8A32-AC8033363263}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {52FD9F0B-B209-4ED7-8A32-AC8033363263}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Release|Any CPU.Build.0 = Release|Any CPU - {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Release|Any CPU.Build.0 = Release|Any CPU - {5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {021DDD6A-A608-424C-9A9A-252D8A9989E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {021DDD6A-A608-424C-9A9A-252D8A9989E0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {021DDD6A-A608-424C-9A9A-252D8A9989E0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {021DDD6A-A608-424C-9A9A-252D8A9989E0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {021DDD6A-A608-424C-9A9A-252D8A9989E0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {021DDD6A-A608-424C-9A9A-252D8A9989E0}.Release|Any CPU.Build.0 = Release|Any CPU - {021DDD6A-A608-424C-9A9A-252D8A9989E0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {021DDD6A-A608-424C-9A9A-252D8A9989E0}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {85B48234-8B31-4BE6-AF9C-665CC6866841}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {85B48234-8B31-4BE6-AF9C-665CC6866841}.Debug|Any CPU.Build.0 = Debug|Any CPU - {85B48234-8B31-4BE6-AF9C-665CC6866841}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {85B48234-8B31-4BE6-AF9C-665CC6866841}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {85B48234-8B31-4BE6-AF9C-665CC6866841}.Release|Any CPU.ActiveCfg = Release|Any CPU - {85B48234-8B31-4BE6-AF9C-665CC6866841}.Release|Any CPU.Build.0 = Release|Any CPU - {85B48234-8B31-4BE6-AF9C-665CC6866841}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {85B48234-8B31-4BE6-AF9C-665CC6866841}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Debug|Any CPU.ActiveCfg = Debug|x86 + {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Debug|Any CPU.Build.0 = Debug|x86 + {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Release|Any CPU.ActiveCfg = Release|x86 + {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {0DFB103F-2962-400F-8C6D-E2C28CCBA633}.Release|Mixed Platforms.Build.0 = Release|x86 + {1A8E50CC-EE32-4E57-8842-0C39C8EA7541}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1A8E50CC-EE32-4E57-8842-0C39C8EA7541}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1A8E50CC-EE32-4E57-8842-0C39C8EA7541}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {1A8E50CC-EE32-4E57-8842-0C39C8EA7541}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {1A8E50CC-EE32-4E57-8842-0C39C8EA7541}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1A8E50CC-EE32-4E57-8842-0C39C8EA7541}.Release|Any CPU.Build.0 = Release|Any CPU + {1A8E50CC-EE32-4E57-8842-0C39C8EA7541}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {1A8E50CC-EE32-4E57-8842-0C39C8EA7541}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Release|Any CPU.Build.0 = Release|Any CPU + {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {2881135D-4D62-493E-8F83-5EEE92CCC6BE}.Release|Mixed Platforms.Build.0 = Release|Any CPU {33D03738-C154-4028-8EA8-63A3C488A651}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {33D03738-C154-4028-8EA8-63A3C488A651}.Debug|Any CPU.Build.0 = Debug|Any CPU {33D03738-C154-4028-8EA8-63A3C488A651}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -191,6 +105,64 @@ Global {33D03738-C154-4028-8EA8-63A3C488A651}.Release|Any CPU.Build.0 = Release|Any CPU {33D03738-C154-4028-8EA8-63A3C488A651}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {33D03738-C154-4028-8EA8-63A3C488A651}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Release|Any CPU.Build.0 = Release|Any CPU + {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Release|Any CPU.Build.0 = Release|Any CPU + {5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {5457CBF5-4CE4-421E-A8BF-9FD6C9732E1D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {85B48234-8B31-4BE6-AF9C-665CC6866841}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85B48234-8B31-4BE6-AF9C-665CC6866841}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85B48234-8B31-4BE6-AF9C-665CC6866841}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {85B48234-8B31-4BE6-AF9C-665CC6866841}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {85B48234-8B31-4BE6-AF9C-665CC6866841}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85B48234-8B31-4BE6-AF9C-665CC6866841}.Release|Any CPU.Build.0 = Release|Any CPU + {85B48234-8B31-4BE6-AF9C-665CC6866841}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {85B48234-8B31-4BE6-AF9C-665CC6866841}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Release|Any CPU.Build.0 = Release|Any CPU + {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C0B0465C-6BE2-409C-8770-3A9BF64C4344}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F33337BE-CB69-4B24-850F-07D23E408DDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F33337BE-CB69-4B24-850F-07D23E408DDF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F33337BE-CB69-4B24-850F-07D23E408DDF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F33337BE-CB69-4B24-850F-07D23E408DDF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F33337BE-CB69-4B24-850F-07D23E408DDF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F33337BE-CB69-4B24-850F-07D23E408DDF}.Release|Any CPU.Build.0 = Release|Any CPU + {F33337BE-CB69-4B24-850F-07D23E408DDF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F33337BE-CB69-4B24-850F-07D23E408DDF}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F9FA4D9F-2302-470A-8A07-6E37F488C124}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F9FA4D9F-2302-470A-8A07-6E37F488C124}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F9FA4D9F-2302-470A-8A07-6E37F488C124}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F9FA4D9F-2302-470A-8A07-6E37F488C124}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F9FA4D9F-2302-470A-8A07-6E37F488C124}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F9FA4D9F-2302-470A-8A07-6E37F488C124}.Release|Any CPU.Build.0 = Release|Any CPU + {F9FA4D9F-2302-470A-8A07-6E37F488C124}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F9FA4D9F-2302-470A-8A07-6E37F488C124}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {021DDD6A-A608-424C-9A9A-252D8A9989E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {021DDD6A-A608-424C-9A9A-252D8A9989E0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {021DDD6A-A608-424C-9A9A-252D8A9989E0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {021DDD6A-A608-424C-9A9A-252D8A9989E0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {021DDD6A-A608-424C-9A9A-252D8A9989E0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {021DDD6A-A608-424C-9A9A-252D8A9989E0}.Release|Any CPU.Build.0 = Release|Any CPU + {021DDD6A-A608-424C-9A9A-252D8A9989E0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {021DDD6A-A608-424C-9A9A-252D8A9989E0}.Release|Mixed Platforms.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(NestedProjects) = preSolution EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution StartupItem = OpenRA.Game\OpenRA.Game.csproj diff --git a/cg/line.fx b/cg/line.fx deleted file mode 100644 index 1286e90384..0000000000 --- a/cg/line.fx +++ /dev/null @@ -1,50 +0,0 @@ -// OpenRA world lines shader -// Author: C. Forbes -//-------------------------------------------------------- - -float2 Scroll; - -float2 r1, r2; // matrix elements - -struct VertexIn { - float4 Position: POSITION; - float4 Color: TEXCOORD0; -}; - -struct VertexOut { - float4 Position: POSITION; - float4 Color: COLOR0; -}; - -VertexOut Simple_vp(VertexIn v) { - VertexOut o; - float2 p = (v.Position.xy - Scroll.xy) * r1 + r2; - o.Position = float4(p.x,p.y,0,1); - o.Color = v.Color; - return o; -} - -float4 Simple_fp(VertexOut f) : COLOR0 { - return f.Color; -} - -technique high_quality { - pass p0 { - DepthTestEnable = false; - //CullMode = None; - //FillMode = Wireframe; - VertexProgram = compile latest Simple_vp(); - FragmentProgram = compile latest Simple_fp(); - - BlendEquation = FuncAdd; - BlendFunc = int2( SrcAlpha, OneMinusSrcAlpha ); - } -} - -technique high_quality_cg21 { - pass p0 { - DepthTestEnable = false; - VertexProgram = compile arbvp1 Simple_vp(); - FragmentProgram = compile arbfp1 Simple_fp(); - } -} \ No newline at end of file diff --git a/cg/rgba.fx b/cg/rgba.fx deleted file mode 100644 index 2ac03df92a..0000000000 --- a/cg/rgba.fx +++ /dev/null @@ -1,56 +0,0 @@ -// OpenRA ui shader for non-SHP sprites (mostly just chrome) -// Author: C. Forbes -//-------------------------------------------------------- - -float2 Scroll; -float2 r1, r2; // matrix elements - -sampler2D DiffuseTexture = sampler_state { - MinFilter = Nearest; - MagFilter = Nearest; -}; - -struct VertexIn { - float4 Position: POSITION; - float4 Tex0: TEXCOORD0; -}; - -struct VertexOut { - float4 Position: POSITION; - float2 Tex0: TEXCOORD0; -}; - -struct FragmentIn { - float2 Tex0: TEXCOORD0; -}; - -VertexOut Simple_vp(VertexIn v) { - VertexOut o; - float2 p = (v.Position.xy - Scroll.xy) * r1 + r2; - o.Position = float4(p.x,p.y,0,1); - o.Tex0 = v.Tex0.xy; - return o; -} - -float4 Simple_fp(FragmentIn f) : COLOR0 { - float4 r = tex2D(DiffuseTexture, f.Tex0); - return r; -} - -technique high_quality { - pass p0 { - DepthTestEnable = false; - CullFaceEnable = false; - VertexProgram = compile latest Simple_vp(); - FragmentProgram = compile latest Simple_fp(); - } -} - -technique high_quality_cg21 { - pass p0 { - DepthTestEnable = false; - CullFaceEnable = false; - VertexProgram = compile arbvp1 Simple_vp(); - FragmentProgram = compile arbfp1 Simple_fp(); - } -} \ No newline at end of file diff --git a/cg/shp.fx b/cg/shp.fx deleted file mode 100644 index 53cbd27473..0000000000 --- a/cg/shp.fx +++ /dev/null @@ -1,72 +0,0 @@ -// OpenRA test shader -// Author: C. Forbes -//-------------------------------------------------------- - -float2 Scroll; -float2 r1, r2; // matrix elements - -sampler2D DiffuseTexture = sampler_state { - MinFilter = Nearest; - MagFilter = Nearest; - WrapS = Repeat; - WrapT = Repeat; -}; - -sampler2D Palette = sampler_state { - MinFilter = Nearest; - MagFilter = Nearest; - WrapS = Repeat; - WrapT = Repeat; -}; - -struct VertexIn { - float4 Position: POSITION; - float4 Tex0: TEXCOORD0; -}; - -struct VertexOut { - float4 Position: POSITION; - float3 Tex0: TEXCOORD0; - float4 ChannelMask: TEXCOORD1; -}; - -float4 DecodeChannelMask( float x ) -{ - if (x > 0) - return (x > 0.5f) ? float4(1,0,0,0) : float4(0,1,0,0); - else - return (x <-0.5f) ? float4(0,0,0,1) : float4(0,0,1,0); -} - -VertexOut Simple_vp(VertexIn v) { - VertexOut o; - float2 p = (v.Position.xy - Scroll.xy) * r1 + r2; - o.Position = float4(p.x,p.y,0,1); - o.Tex0 = float3(v.Tex0.x, v.Tex0.y, v.Tex0.z); - o.ChannelMask = DecodeChannelMask( v.Tex0.w ); - return o; -} - -float4 Palette_fp(VertexOut f) : COLOR0 { - float4 x = tex2D(DiffuseTexture, f.Tex0.xy); - float2 p = float2( dot(x, f.ChannelMask), f.Tex0.z ); - return tex2D(Palette, p); -} - -technique low_quality { - pass p0 { - DepthTestEnable = false; - CullFaceEnable = false; - VertexProgram = compile latest Simple_vp(); - FragmentProgram = compile latest Palette_fp(); - } -} - -technique low_quality_cg21 { - pass p0 { - DepthTestEnable = false; - CullFaceEnable = false; - VertexProgram = compile arbvp1 Simple_vp(); - FragmentProgram = compile arbfp1 Palette_fp(); - } -} \ No newline at end of file diff --git a/cg/vxl.fx b/cg/vxl.fx deleted file mode 100644 index 6d2423b9e3..0000000000 --- a/cg/vxl.fx +++ /dev/null @@ -1,78 +0,0 @@ -mat4x4 View; -mat4x4 TransformMatrix; -float2 PaletteRows; - -float4 LightDirection; -float3 AmbientLight, DiffuseLight; - -sampler2D DiffuseTexture = sampler_state { - MinFilter = Nearest; - MagFilter = Nearest; - WrapS = Repeat; - WrapT = Repeat; -}; - -sampler2D Palette = sampler_state { - MinFilter = Nearest; - MagFilter = Nearest; - WrapS = Repeat; - WrapT = Repeat; -}; - -struct VertexIn { - float4 Position: POSITION; - float4 Tex0: TEXCOORD0; -}; - -struct VertexOut { - float4 Position: POSITION; - float2 Tex0: TEXCOORD0; - float4 ColorChannel: TEXCOORD1; - float4 NormalsChannel: TEXCOORD2; -}; - -float4 DecodeChannelMask(float x) -{ - if (x > 0) - return (x > 0.5f) ? float4(1,0,0,0) : float4(0,1,0,0); - else - return (x <-0.5f) ? float4(0,0,0,1) : float4(0,0,1,0); -} - -VertexOut Simple_vp(VertexIn v) { - VertexOut o; - o.Position = mul(mul(v.Position, TransformMatrix), View); - o.Tex0 = v.Tex0.xy; - o.ColorChannel = DecodeChannelMask(v.Tex0.z); - o.NormalsChannel = DecodeChannelMask(v.Tex0.w); - return o; -} - -float4 Simple_fp(VertexOut f) : COLOR0 { - float4 x = tex2D(DiffuseTexture, f.Tex0.xy); - vec4 color = tex2D(Palette, float2(dot(x, f.ColorChannel), PaletteRows.x)); - if (color.a < 0.01) - discard; - - float4 normal = (2.0*tex2D(Palette, vec2(dot(x, f.NormalsChannel), PaletteRows.y)) - 1.0); - float3 intensity = AmbientLight + DiffuseLight*max(dot(normal, LightDirection), 0.0); - return float4(intensity*color.rgb, color.a); -} - -technique high_quality { - pass p0 { - DepthTestEnable = true; - CullFaceEnable = false; - VertexProgram = compile latest Simple_vp(); - FragmentProgram = compile latest Simple_fp(); - } -} - -technique high_quality_cg21 { - pass p0 { - DepthTestEnable = true; - CullFaceEnable = false; - VertexProgram = compile arbvp1 Simple_vp(); - FragmentProgram = compile arbfp1 Simple_fp(); - } -} \ No newline at end of file diff --git a/packaging/osx/buildpackage.sh b/packaging/osx/buildpackage.sh index 943b5747a2..c076f31894 100755 --- a/packaging/osx/buildpackage.sh +++ b/packaging/osx/buildpackage.sh @@ -20,17 +20,6 @@ cp -rv $2/* $3/* "OpenRA.app/Contents/Resources/" || exit 3 rm OpenRA.app/Contents/Resources/OpenRA.ico rm OpenRA.app/Contents/Resources/OpenRA.Editor.exe -# SDL2 is the only supported renderer -rm -rf OpenRA.app/Contents/Resources/cg -rm OpenRA.app/Contents/Resources/OpenRA.Renderer.Cg.dll -rm OpenRA.app/Contents/Resources/Tao.Sdl.* -rm OpenRA.app/Contents/Resources/Tao.Cg.* - -# Change the .config to use the packaged SDL -sed "s/\/Library\/Frameworks\/SDL2.framework/./" OpenRA.app/Contents/Resources/SDL2-CS.dll.config > temp -mv temp OpenRA.app/Contents/Resources/SDL2-CS.dll.config -rm temp - # Package app bundle into a zip and clean up zip OpenRA-$1 -r -9 OpenRA.app mv OpenRA-$1.zip $4 diff --git a/packaging/package-all.sh b/packaging/package-all.sh index c83d7cfebe..42c94ce194 100755 --- a/packaging/package-all.sh +++ b/packaging/package-all.sh @@ -29,9 +29,9 @@ markdown DOCUMENTATION.md > DOCUMENTATION.html # List of files that are packaged on all platforms FILES=('OpenRA.Game.exe' 'OpenRA.Editor.exe' 'OpenRA.Utility.exe' \ -'OpenRA.Renderer.SdlCommon.dll' 'OpenRA.Renderer.Sdl2.dll' 'OpenRA.Renderer.Cg.dll' 'OpenRA.Renderer.Gl.dll' 'OpenRA.Renderer.Null.dll' 'OpenRA.Irc.dll' \ +'OpenRA.Renderer.Sdl2.dll' 'OpenRA.Renderer.Null.dll' 'OpenRA.Irc.dll' \ 'FreeSans.ttf' 'FreeSansBold.ttf' 'lua' \ -'cg' 'glsl' 'mods/common' 'mods/ra' 'mods/cnc' 'mods/d2k' 'mods/modchooser' \ +'glsl' 'mods/common' 'mods/ra' 'mods/cnc' 'mods/d2k' 'mods/modchooser' \ 'AUTHORS' 'COPYING' \ 'README.html' 'CONTRIBUTING.html' 'DOCUMENTATION.html' 'CHANGELOG.html' \ 'global mix database.dat' 'GeoLite2-Country.mmdb') diff --git a/packaging/windows/OpenRA.nsi b/packaging/windows/OpenRA.nsi index 3075e3ab12..800cea47f9 100644 --- a/packaging/windows/OpenRA.nsi +++ b/packaging/windows/OpenRA.nsi @@ -67,8 +67,6 @@ Section "Game" GAME File "${SRCDIR}\OpenRA.Game.exe" File "${SRCDIR}\OpenRA.Utility.exe" File "${SRCDIR}\OpenRA.Renderer.Null.dll" - File "${SRCDIR}\OpenRA.Renderer.SdlCommon.dll" - File "${SRCDIR}\OpenRA.Renderer.Gl.dll" File "${SRCDIR}\OpenRA.Renderer.Sdl2.dll" File "${SRCDIR}\OpenRA.Irc.dll" File "${SRCDIR}\ICSharpCode.SharpZipLib.dll" @@ -190,8 +188,6 @@ Function ${UN}Clean Delete $INSTDIR\OpenRA.Utility.exe Delete $INSTDIR\OpenRA.Editor.exe Delete $INSTDIR\OpenRA.Renderer.Null.dll - Delete $INSTDIR\OpenRA.Renderer.SdlCommon.dll - Delete $INSTDIR\OpenRA.Renderer.Gl.dll Delete $INSTDIR\OpenRA.Renderer.Sdl2.dll Delete $INSTDIR\OpenRA.Irc.dll Delete $INSTDIR\ICSharpCode.SharpZipLib.dll diff --git a/thirdparty/Tao/Tao.Cg.dll b/thirdparty/Tao/Tao.Cg.dll deleted file mode 100644 index 9d1bd7c388..0000000000 Binary files a/thirdparty/Tao/Tao.Cg.dll and /dev/null differ diff --git a/thirdparty/Tao/Tao.Cg.dll.config b/thirdparty/Tao/Tao.Cg.dll.config deleted file mode 100644 index f80891331b..0000000000 --- a/thirdparty/Tao/Tao.Cg.dll.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/thirdparty/Tao/Tao.Sdl.dll b/thirdparty/Tao/Tao.Sdl.dll deleted file mode 100644 index 2ecd2729e2..0000000000 Binary files a/thirdparty/Tao/Tao.Sdl.dll and /dev/null differ diff --git a/thirdparty/Tao/Tao.Sdl.dll.config b/thirdparty/Tao/Tao.Sdl.dll.config deleted file mode 100644 index b0a842cc54..0000000000 --- a/thirdparty/Tao/Tao.Sdl.dll.config +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -