internal static void DumpAllStats() { var currentProcess = Process.GetCurrentProcess(); var workingSet = currentProcess.WorkingSet64; var virtualMem = currentProcess.VirtualMemorySize64; var gcAllocated = GC.GetTotalMemory(false); var lines = new List <string> { "SpriteMaster Stats Dump:", "\tVM:", $"\t\tProcess Working Set : {workingSet.AsDataSize()}", $"\t\tProcess Virtual Memory : {virtualMem.AsDataSize()}:", $"\t\tGC Allocated Memory : {gcAllocated.AsDataSize()}:", "", "\tSuspended Sprite Cache Stats:" }; lines.AddRange(SuspendedSpriteCache.DumpStats().SelectF(s => $"\t{s}")); lines.Add(""); ManagedTexture2D.DumpStats(lines); foreach (var line in lines) { Info(line); } }
internal static bool OnDrawLast( SpriteBatch __instance, ref Texture2D texture, ref Rectangle destinationRectangle, ref Rectangle?sourceRectangle, Color color, float rotation, ref Vector2 origin, SpriteEffects effects, ref float layerDepth, ref ManagedTexture2D __state ) { if (!Config.Enabled) { return(true); } return(__instance.OnDraw( texture: ref texture, destination: ref destinationRectangle, source: ref sourceRectangle, color: color, rotation: rotation, origin: ref origin, effects: effects, layerDepth: ref layerDepth, __state: ref __state )); }
internal static long SizeBytes(this ManagedTexture2D texture) => (long)texture.Area() * 4;
internal static long SizeBytes(this ManagedTexture2D texture) { return((long)texture.Area() * 4); }