v0.14.6.0

This commit is contained in:
Joonas Rikkonen
2021-06-17 17:54:52 +03:00
parent 3f324b14e8
commit c27e2ea5ab
348 changed files with 13156 additions and 4266 deletions

View File

@@ -211,10 +211,7 @@ namespace FarseerPhysics.Common.Decomposition.CDT.Delaunay
for (int i = 0; i < 3; i++)
{
t = Neighbors[i];
if (t != null)
{
t.ClearNeighbor(this);
}
t?.ClearNeighbor(this);
}
ClearNeighbors();
Points[0] = Points[1] = Points[2] = null;

View File

@@ -491,10 +491,7 @@ namespace FarseerPhysics.Common.Decomposition.CDT.Delaunay.Sweep
{
triangle.MarkConstrainedEdge(index);
triangle = triangle.Neighbors[index];
if (triangle != null)
{
triangle.MarkConstrainedEdge(ep, eq);
}
triangle?.MarkConstrainedEdge(ep, eq);
return true;
}
return false;

View File

@@ -187,10 +187,7 @@ namespace FarseerPhysics.Common.Decomposition.CDT.Polygon
public void ClearSteinerPoints()
{
if (_steinerPoints != null)
{
_steinerPoints.Clear();
}
_steinerPoints?.Clear();
}
/// <summary>

View File

@@ -201,15 +201,9 @@ namespace GameAnalyticsSDK.Net.Store
}
finally
{
if(command != null)
{
command.Dispose();
}
command?.Dispose();
if(transaction != null)
{
transaction.Dispose();
}
transaction?.Dispose();
}
// Return results

View File

@@ -595,10 +595,7 @@ namespace GameAnalyticsSDK.Net.Utilities
break;
}
stack.Push(new JSONObject());
if (ctx != null)
{
ctx.Add(TokenName, stack.Peek());
}
ctx?.Add(TokenName, stack.Peek());
TokenName = "";
Token.Length = 0;
ctx = stack.Peek();
@@ -612,10 +609,7 @@ namespace GameAnalyticsSDK.Net.Utilities
}
stack.Push(new JSONArray());
if (ctx != null)
{
ctx.Add(TokenName, stack.Peek());
}
ctx?.Add(TokenName, stack.Peek());
TokenName = "";
Token.Length = 0;
ctx = stack.Peek();

View File

@@ -0,0 +1,13 @@
using System;
namespace Microsoft.Xna.Framework
{
public class FileDropEventArgs : EventArgs
{
public string FilePath;
public FileDropEventArgs(string filePath)
{
FilePath = filePath;
}
}
}

View File

@@ -88,6 +88,7 @@ namespace Microsoft.Xna.Framework {
#region Events
public event EventHandler<FileDropEventArgs> FileDropped;
public event EventHandler<EventArgs> ClientSizeChanged;
public event EventHandler<EventArgs> OrientationChanged;
public event EventHandler<EventArgs> ScreenDeviceNameChanged;
@@ -131,7 +132,7 @@ namespace Microsoft.Xna.Framework {
protected void OnDeactivated ()
{
}
protected void OnOrientationChanged ()
{
EventHelpers.Raise(this, OrientationChanged, EventArgs.Empty);
@@ -153,7 +154,12 @@ namespace Microsoft.Xna.Framework {
}
#endif
protected internal abstract void SetSupportedOrientations (DisplayOrientation orientations);
protected internal abstract void SetSupportedOrientations (DisplayOrientation orientations);
protected abstract void SetTitle (string title);
protected void OnFileDropped(FileDropEventArgs e)
{
EventHelpers.Raise(this, FileDropped, e);
}
}
}

View File

@@ -36,6 +36,7 @@
<EmbeddedResource Remove=".\**" />
<None Remove=".\**" />
<Compile Include="Clipboard.cs" />
<Compile Include="FileDropEventArgs.cs" />
<Compile Include="MessageBox.cs" />
<Compile Include="CurveContinuity.cs" />
<Compile Include="Curve.cs" />

View File

@@ -36,6 +36,7 @@
<EmbeddedResource Remove=".\**" />
<None Remove=".\**" />
<Compile Include="Clipboard.cs" />
<Compile Include="FileDropEventArgs.cs" />
<Compile Include="MessageBox.cs" />
<Compile Include="CurveContinuity.cs" />
<Compile Include="Curve.cs" />

View File

@@ -36,6 +36,7 @@
<EmbeddedResource Remove=".\**" />
<None Remove=".\**" />
<Compile Include="Clipboard.cs" />
<Compile Include="FileDropEventArgs.cs" />
<Compile Include="GraphicsDeviceManager.SDL.cs" />
<Compile Include="Graphics\SpriteEffects.cs" />
<Compile Include="Input\GamePad.SDL.cs" />

View File

@@ -146,6 +146,8 @@ internal static class Sdl
public Joystick.DeviceEvent JoystickDevice;
[FieldOffset(0)]
public GameController.DeviceEvent ControllerDevice;
[FieldOffset(0)]
public DropEvent DropEvent;
}
public struct Rectangle
@@ -172,6 +174,10 @@ internal static class Sdl
GetError(SDL_Init(flags));
}
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void d_sdl_free(IntPtr ptr);
public static d_sdl_free Free = FuncLoader.LoadFunction<d_sdl_free>(NativeLibrary, "SDL_free");
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void d_sdl_disablescreensaver();
public static d_sdl_disablescreensaver DisableScreenSaver = FuncLoader.LoadFunction<d_sdl_disablescreensaver>(NativeLibrary, "SDL_DisableScreenSaver");
@@ -310,6 +316,15 @@ internal static class Sdl
public delegate int d_sdl_sethint(string name, string value);
public static d_sdl_sethint SetHint = FuncLoader.LoadFunction<d_sdl_sethint>(NativeLibrary, "SDL_SetHint");
[StructLayout(LayoutKind.Sequential)]
public struct DropEvent
{
public EventType Type;
public uint Timestamp;
public IntPtr File;
public uint WndowID;
}
public static class Window
{
public const int PosUndefined = 0x1FFF0000;

View File

@@ -126,6 +126,12 @@ namespace Microsoft.Xna.Framework
Window.MouseState.X = ev.Motion.X;
Window.MouseState.Y = ev.Motion.Y;
}
else if (ev.Type == Sdl.EventType.DropFile)
{
string file = InteropHelpers.Utf8ToString(ev.DropEvent.File);
Sdl.Free(ev.DropEvent.File); //required according to SDL's documentation
_view.DropFile(file);
}
else if (ev.Type == Sdl.EventType.KeyDown)
{
var key = KeyboardUtil.ToXna(ev.Key.Keysym.Sym);
@@ -135,7 +141,7 @@ namespace Microsoft.Xna.Framework
//TODO: rethink all of this
char character = (char)KeyboardUtil.ApplyModifiers(ev.Key.Keysym.Sym, ev.Key.Keysym.Mod);
if ((int)((char)ev.Key.Keysym.Sym) != ev.Key.Keysym.Sym)
{
character = '\0';

View File

@@ -286,7 +286,7 @@ namespace Microsoft.Xna.Framework
// to not try and set the window position because it will be wrong.
if ((Sdl.Patch > 4 || !AllowUserResizing) && !_wasMoved)
Sdl.Window.SetPosition(Handle, centerX, centerY);
Sdl.Window.Show(Handle);
Sdl.Window.Raise(Handle);
@@ -333,6 +333,11 @@ namespace Microsoft.Xna.Framework
OnTextInput(this, new TextInputEventArgs(c, key));
}
public void DropFile(string filePath)
{
OnFileDropped(new FileDropEventArgs(filePath));
}
protected internal override void SetSupportedOrientations(DisplayOrientation orientations)
{
// Nothing to do here