Merge pull request #5073 from pchote/sdl-spaces-yaaaaaaay

Upgrade to SDL 2.0.3
This commit is contained in:
Matthias Mailänder
2014-04-13 08:05:43 +02:00
10 changed files with 25 additions and 20 deletions

View File

@@ -159,6 +159,7 @@ NEW:
Modified Teleport activity to use the best/closest open cell to the target destination for teleports (for ChronoshiftPower this only applies on the return trip).
Renamed ChronoshiftDeploy trait to PortableChrono.
Added LineBuildNode trait to filter which structure(s) a LineBuild actor can be attached to.
Updated to SDL 2.0.3 under OSX, which improves platform integration.
Server:
Message of the day is now shared between all mods and a default motd.txt gets created in the user directory.
Asset Browser:

View File

@@ -129,7 +129,7 @@ rsdl2_SRCS := $(shell find OpenRA.Renderer.Sdl2/ -iname '*.cs')
rsdl2_TARGET = OpenRA.Renderer.Sdl2.dll
rsdl2_KIND = library
rsdl2_DEPS = $(fileformats_TARGET) $(game_TARGET) $(rsdl_TARGET) $(rgl_TARGET)
rsdl2_LIBS = $(COMMON_LIBS) thirdparty/Tao/Tao.OpenGl.dll thirdparty/SDL2\#.dll $(rsdl2_DEPS)
rsdl2_LIBS = $(COMMON_LIBS) thirdparty/Tao/Tao.OpenGl.dll thirdparty/SDL2-CS.dll $(rsdl2_DEPS)
rnull_SRCS := $(shell find OpenRA.Renderer.Null/ -iname '*.cs')
rnull_TARGET = OpenRA.Renderer.Null.dll

View File

@@ -37,8 +37,8 @@
<HintPath>..\thirdparty\Tao\Tao.OpenGl.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="SDL2#">
<HintPath>..\thirdparty\SDL2#.dll</HintPath>
<Reference Include="SDL2-CS">
<HintPath>..\thirdparty\SDL2-CS.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>

View File

@@ -57,15 +57,6 @@ namespace OpenRA.Renderer.Sdl2
SDL.SDL_GL_SetAttribute(SDL.SDL_GLattr.SDL_GL_BLUE_SIZE, 8);
SDL.SDL_GL_SetAttribute(SDL.SDL_GLattr.SDL_GL_ALPHA_SIZE, 0);
var windowFlags = SDL.SDL_WindowFlags.SDL_WINDOW_OPENGL;
if (windowMode == WindowMode.Fullscreen)
windowFlags |= SDL.SDL_WindowFlags.SDL_WINDOW_FULLSCREEN;
else if (windowMode == WindowMode.PseudoFullscreen)
{
windowFlags |= SDL.SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP;
Environment.SetEnvironmentVariable("SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS", "0");
}
SDL.SDL_DisplayMode display;
SDL.SDL_GetCurrentDisplayMode(0, out display);
@@ -78,7 +69,20 @@ namespace OpenRA.Renderer.Sdl2
Console.WriteLine("Using resolution: {0}x{1}", size.Width, size.Height);
window = SDL.SDL_CreateWindow("OpenRA", SDL.SDL_WINDOWPOS_CENTERED, SDL.SDL_WINDOWPOS_CENTERED, size.Width, size.Height, windowFlags);
window = SDL.SDL_CreateWindow("OpenRA", SDL.SDL_WINDOWPOS_CENTERED, SDL.SDL_WINDOWPOS_CENTERED, size.Width, size.Height, SDL.SDL_WindowFlags.SDL_WINDOW_OPENGL);
if (windowMode == WindowMode.Fullscreen)
SDL.SDL_SetWindowFullscreen(window, (uint)SDL.SDL_WindowFlags.SDL_WINDOW_FULLSCREEN);
else if (windowMode == WindowMode.PseudoFullscreen)
{
// Work around a visual glitch in OSX: the window is offset
// partially offscreen if the dock is at the left of the screen
if (Platform.CurrentPlatform == PlatformType.OSX)
SDL.SDL_SetWindowPosition(window, 0, 0);
SDL.SDL_SetWindowFullscreen(window, (uint)SDL.SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP);
SDL.SDL_SetHint(SDL.SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");
}
SDL.SDL_ShowCursor(0);
SDL.SDL_GL_CreateContext(window);

View File

@@ -28,8 +28,8 @@ 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\#.dll.config > temp
mv temp OpenRA.app/Contents/Resources/SDL2\#.dll.config
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

View File

@@ -51,8 +51,8 @@ cp thirdparty/FuzzyLogicLibrary.dll packaging/built
# SharpFont for FreeType support
cp thirdparty/SharpFont* packaging/built
# SDL2#
cp thirdparty/SDL2\#* packaging/built
# SDL2-CS
cp thirdparty/SDL2-CS packaging/built
# Mono.NAT for UPnP support
cp thirdparty/Mono.Nat.dll packaging/built

BIN
thirdparty/SDL2#.dll vendored

Binary file not shown.

BIN
thirdparty/SDL2-CS.dll vendored Executable file

Binary file not shown.

View File

@@ -16,7 +16,7 @@
<dllmap dll="SDL2_ttf.dll" os="osx" target="libSDL2_ttf-2.0.0.dylib"/>
<dllmap dll="SDL2_ttf.dll" os="linux" target="libSDL2_ttf-2.0.so.0"/>
<dllmap dll="openal32.dll" os="windows" target="openal32.dll"/>
<dllmap dll="openal32.dll" os="osx" target="libopenal.1.dylib"/>
<dllmap dll="openal32.dll" os="linux" target="libopenal.so.1"/>
<dllmap dll="soft_oal.dll" os="windows" target="soft_oal.dll"/>
<dllmap dll="soft_oal.dll" os="osx" target="libopenal.1.dylib"/>
<dllmap dll="soft_oal.dll" os="linux" target="libopenal.so.1"/>
</configuration>