summaryrefslogtreecommitdiff
path: root/src/SMAPI.Internal/RewriteFacades
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-05-01 18:44:39 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-05-01 18:44:39 -0400
commit009a387526ee10b18d0ed3030d6e8868edf17203 (patch)
tree2651a2c11cf33cbb9b75a680911249f4fce4da94 /src/SMAPI.Internal/RewriteFacades
parent3255518f0a9d18f2d25859747a21bd54759b8f84 (diff)
downloadSMAPI-009a387526ee10b18d0ed3030d6e8868edf17203.tar.gz
SMAPI-009a387526ee10b18d0ed3030d6e8868edf17203.tar.bz2
SMAPI-009a387526ee10b18d0ed3030d6e8868edf17203.zip
unify SMAPI.AssemblyRewriters and SMAPI.Common projects
Diffstat (limited to 'src/SMAPI.Internal/RewriteFacades')
-rw-r--r--src/SMAPI.Internal/RewriteFacades/SpriteBatchMethods.cs59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/SMAPI.Internal/RewriteFacades/SpriteBatchMethods.cs b/src/SMAPI.Internal/RewriteFacades/SpriteBatchMethods.cs
new file mode 100644
index 00000000..5e5d117e
--- /dev/null
+++ b/src/SMAPI.Internal/RewriteFacades/SpriteBatchMethods.cs
@@ -0,0 +1,59 @@
+using System.Diagnostics.CodeAnalysis;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace StardewModdingAPI.Internal.RewriteFacades
+{
+ /// <summary>Provides <see cref="SpriteBatch"/> method signatures that can be injected into mod code for compatibility between Linux/Mac or Windows.</summary>
+ public class SpriteBatchMethods : SpriteBatch
+ {
+ /*********
+ ** Public methods
+ *********/
+ /// <summary>Construct an instance.</summary>
+ public SpriteBatchMethods(GraphicsDevice graphicsDevice) : base(graphicsDevice) { }
+
+
+ /****
+ ** MonoGame signatures
+ ****/
+ [SuppressMessage("ReSharper", "CS0109", Justification = "The 'new' modifier applies when compiled on Linux/Mac.")]
+ public new void Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix? matrix)
+ {
+ base.Begin(sortMode, blendState, samplerState, depthStencilState, rasterizerState, effect, matrix ?? Matrix.Identity);
+ }
+
+ /****
+ ** XNA signatures
+ ****/
+ [SuppressMessage("ReSharper", "CS0109", Justification = "The 'new' modifier applies when compiled on Windows.")]
+ public new void Begin()
+ {
+ base.Begin();
+ }
+
+ [SuppressMessage("ReSharper", "CS0109", Justification = "The 'new' modifier applies when compiled on Windows.")]
+ public new void Begin(SpriteSortMode sortMode, BlendState blendState)
+ {
+ base.Begin(sortMode, blendState);
+ }
+
+ [SuppressMessage("ReSharper", "CS0109", Justification = "The 'new' modifier applies when compiled on Windows.")]
+ public new void Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState)
+ {
+ base.Begin(sortMode, blendState, samplerState, depthStencilState, rasterizerState);
+ }
+
+ [SuppressMessage("ReSharper", "CS0109", Justification = "The 'new' modifier applies when compiled on Windows.")]
+ public new void Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect)
+ {
+ base.Begin(sortMode, blendState, samplerState, depthStencilState, rasterizerState, effect);
+ }
+
+ [SuppressMessage("ReSharper", "CS0109", Justification = "The 'new' modifier applies when compiled on Windows.")]
+ public new void Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformMatrix)
+ {
+ base.Begin(sortMode, blendState, samplerState, depthStencilState, rasterizerState, effect, transformMatrix);
+ }
+ }
+}