65 drawTimes[0].logText =
"Drawing Solid Tiles";
66 drawTimes[1].logText =
"Drawing Non-Solid Tiles";
67 drawTimes[2].logText =
"Drawing Wall Tiles";
68 drawTimes[3].logText =
"Drawing Underground Background";
69 drawTimes[4].logText =
"Drawing Water Tiles";
70 drawTimes[5].logText =
"Drawing Black Tiles";
134 Main.
NewText(
"Detailed logging started", 250, 250, 0);
144 for (
int j = 0; j <
drawTimes.Length; j++)
156 string path = Main.SavePath + Path.DirectorySeparatorChar +
"TerrariaDrawLog.7z";
167 Main.
NewText(
"Detailed logging could not be started.", 250, 250, 0);
172 logBuilder.AppendLine($
"Start of Frame #{currentFrame}");
182 logBuilder.AppendLine($
"End of Frame #{currentFrame}");
198 Main.
NewText(
"Detailed logging ended.", 250, 250, 0);
216 if (times[
type].resetMaxTime > 0)
234 logBuilder.AppendLine(
string.
Format(
" {0} : {1:F4}ms {2}", times[
type].logText, time, flag ?
" - New Maximum" :
string.Empty));
238 public static void RenderTime(
int renderType,
double timeElapsed)
240 if (renderType >= 0 && renderType <
renderTimes.Length)
256 public static void DrawTime(
int drawType,
double timeElapsed)
258 if (drawType >= 0 && drawType <
drawTimes.Length)
272 for (
int i = 0; i <
drawTimes.Length; i++)
281 if (lightingType >= 0 && lightingType <
lightingTimes.Length)
340 logBuilder.AppendLine($
"Menu Render Time : {timeElapsed:F4}");
348 logBuilder.AppendLine($
"Splash Render Time : {timeElapsed:F4}");
356 logBuilder.AppendLine($
"Full Screen Map Render Time : {timeElapsed:F4}");
override string ToString()
static void NewText(string newText, byte R=byte.MaxValue, byte G=byte.MaxValue, byte B=byte.MaxValue)
static float GetRenderMax(int renderType)
static float GetDrawTime(int drawType)
static float GetDetailedDrawTotal()
static TimeLogData[] detailedDrawTimes
static void EndDrawFrame()
static void MapDrawTime(double timeElapsed)
static void DetailedDrawReset()
static float GetDrawTotal()
static void DetailedDrawTime(int detailedDrawType)
static void UpdateTime(TimeLogData[] times, int type, double time)
static StringBuilder logBuilder
static float GetDetailedDrawTime(int detailedDrawType)
static float GetLightingTime(int lightingType)
static void LightingTime(int lightingType, double timeElapsed)
static void NewDrawFrame()
static bool currentlyLogging
static void RenderTime(int renderType, double timeElapsed)
static float GetLightingTotal()
static void DrawTime(int drawType, double timeElapsed)
static StreamWriter logWriter
static bool startLoggingNextFrame
static void MenuDrawTime(double timeElapsed)
static bool endLoggingThisFrame
static float GetRenderTime(int renderType)
static TimeLogData[] lightingTimes
static void SplashDrawTime(double timeElapsed)
static double lastDetailedDrawTime
static Stopwatch detailedDrawTimer
static TimeLogData[] drawTimes
static TimeLogData[] renderTimes
static void DrawException(Exception e)