/// <summary>The method to call before <see cref="SpriteBatch.Draw(Texture2D,Vector2,Rectangle?,Color,float,Vector2,float,SpriteEffects,float)"/>.</summary> private static void Before_Draw4(SpriteBatch __instance, ref Texture2D texture, Vector2 position, ref Rectangle?sourceRectangle, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) { if (sourceRectangle.HasValue) { Rectangle rect = sourceRectangle.Value; SpriteBatchPatcher.FixTilesheetReference(ref texture, ref rect); sourceRectangle = rect; } }
/// <summary>The method to call before <see cref="SpriteBatch.Draw(Texture2D,Rectangle,Rectangle?,Color)"/>.</summary> private static void Before_Draw2(SpriteBatch __instance, ref Texture2D texture, Rectangle destinationRectangle, ref Rectangle?sourceRectangle, Color color) { if (sourceRectangle.HasValue) { Rectangle rect = sourceRectangle.Value; SpriteBatchPatcher.FixTilesheetReference(ref texture, ref rect); sourceRectangle = rect; } }