summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/RewriteFacades/SpriteBatchMethods.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-05-02 21:04:46 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-05-02 21:04:46 -0400
commitb3e8f957e27839a1392b63689e7daf03862540c4 (patch)
tree1964394b2bca9e24451b36e846cf877c959eb582 /src/SMAPI/Framework/RewriteFacades/SpriteBatchMethods.cs
parentdc47ff15c57b0ba2263ab3b94b49e9906620f648 (diff)
downloadSMAPI-b3e8f957e27839a1392b63689e7daf03862540c4.tar.gz
SMAPI-b3e8f957e27839a1392b63689e7daf03862540c4.tar.bz2
SMAPI-b3e8f957e27839a1392b63689e7daf03862540c4.zip
reorganise to avoid errors deploying web app, fix WMI error in Linux installer
Diffstat (limited to 'src/SMAPI/Framework/RewriteFacades/SpriteBatchMethods.cs')
-rw-r--r--src/SMAPI/Framework/RewriteFacades/SpriteBatchMethods.cs60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/RewriteFacades/SpriteBatchMethods.cs b/src/SMAPI/Framework/RewriteFacades/SpriteBatchMethods.cs
new file mode 100644
index 00000000..5dd21b92
--- /dev/null
+++ b/src/SMAPI/Framework/RewriteFacades/SpriteBatchMethods.cs
@@ -0,0 +1,60 @@
+using System.Diagnostics.CodeAnalysis;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace StardewModdingAPI.Framework.RewriteFacades
+{
+ /// <summary>Provides <see cref="SpriteBatch"/> method signatures that can be injected into mod code for compatibility between Linux/Mac or Windows.</summary>
+ /// <remarks>This is public to support SMAPI rewriting and should not be referenced directly by mods.</remarks>
+ 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);
+ }
+ }
+}