Exemplo n.º 1
0
 /*********
 ** Private methods
 *********/
 /// <summary>The method to call after any of the <see cref="SpriteBatch"/> <c>Draw</c> methods.</summary>
 /// <param name="texture">The texture that was drawn.</param>
 /// <param name="sourceRectangle">The pixel area within the texture that was drawn, or <c>null</c> if the entire texture was drawn.</param>
 private static void After_Draw(ref Texture2D texture, ref Rectangle?sourceRectangle)
 {
     if (!string.IsNullOrWhiteSpace(texture?.Name))
     {
         AssetDrawTracker tracker = SpriteBatchPatcher.GetDrawTracker();
         tracker.Track(Mod.instance.Helper.GameContent.ParseAssetName(texture.Name), sourceRectangle);
     }
 }
Exemplo n.º 2
0
        /// <summary>The method to call after any of the <see cref="SpriteBatch"/> <c>Draw</c> methods that doesn't have a <c>sourceRectangle</c> parameter.</summary>
        /// <param name="texture">The texture that was drawn.</param>
        private static void After_Draw_WithoutSourceRectangle(ref Texture2D texture)
        {
            Rectangle?sourceRectangle = null;

            SpriteBatchPatcher.After_Draw(ref texture, ref sourceRectangle);
        }