diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-05-02 21:04:46 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-05-02 21:04:46 -0400 |
commit | b3e8f957e27839a1392b63689e7daf03862540c4 (patch) | |
tree | 1964394b2bca9e24451b36e846cf877c959eb582 /src/SMAPI | |
parent | dc47ff15c57b0ba2263ab3b94b49e9906620f648 (diff) | |
download | SMAPI-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')
-rw-r--r-- | src/SMAPI/Framework/RewriteFacades/SpriteBatchMethods.cs | 60 | ||||
-rw-r--r-- | src/SMAPI/Metadata/InstructionMetadata.cs | 2 | ||||
-rw-r--r-- | src/SMAPI/StardewModdingAPI.csproj | 4 |
3 files changed, 64 insertions, 2 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); + } + } +} diff --git a/src/SMAPI/Metadata/InstructionMetadata.cs b/src/SMAPI/Metadata/InstructionMetadata.cs index c7abfbef..1063ae71 100644 --- a/src/SMAPI/Metadata/InstructionMetadata.cs +++ b/src/SMAPI/Metadata/InstructionMetadata.cs @@ -4,7 +4,7 @@ using StardewModdingAPI.Events; using StardewModdingAPI.Framework.ModLoading; using StardewModdingAPI.Framework.ModLoading.Finders; using StardewModdingAPI.Framework.ModLoading.Rewriters; -using StardewModdingAPI.Internal.RewriteFacades; +using StardewModdingAPI.Framework.RewriteFacades; using StardewValley; namespace StardewModdingAPI.Metadata diff --git a/src/SMAPI/StardewModdingAPI.csproj b/src/SMAPI/StardewModdingAPI.csproj index 31bfd6fd..ca6459fe 100644 --- a/src/SMAPI/StardewModdingAPI.csproj +++ b/src/SMAPI/StardewModdingAPI.csproj @@ -127,6 +127,7 @@ <Compile Include="Framework\Models\MonitorColorScheme.cs" /> <Compile Include="Framework\Reflection\InterfaceProxyBuilder.cs" /> <Compile Include="Framework\Reflection\InterfaceProxyFactory.cs" /> + <Compile Include="Framework\RewriteFacades\SpriteBatchMethods.cs" /> <Compile Include="Framework\Serialisation\SmapiConverters\ManifestContentPackForConverter.cs" /> <Compile Include="Framework\Serialisation\SmapiConverters\ManifestDependencyArrayConverter.cs" /> <Compile Include="Framework\Serialisation\SmapiConverters\SemanticVersionConverter.cs" /> @@ -313,5 +314,6 @@ <Analyzer Include="..\SMAPI.ModBuildConfig.Analyzer\bin\netstandard1.3\StardewModdingAPI.ModBuildConfig.Analyzer.dll" /> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> - <Import Project="..\..\build\common.targets" /> + <Import Project="..\..\build\constants.targets" /> + <Import Project="..\..\build\build.targets" /> </Project>
\ No newline at end of file |