Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ NewDrawFrame()

static void Terraria.TimeLogger.NewDrawFrame ( )
inlinestatic

Definition at line 138 of file TimeLogger.cs.

139 {
140 for (int i = 0; i < renderTimes.Length; i++)
141 {
142 renderTimes[i].usedLastDraw = false;
143 }
144 for (int j = 0; j < drawTimes.Length; j++)
145 {
146 drawTimes[j].usedLastDraw = false;
147 }
148 for (int k = 0; k < lightingTimes.Length; k++)
149 {
150 lightingTimes[k].usedLastDraw = false;
151 }
153 {
154 startLoggingNextFrame = false;
155 _ = DateTime.Now;
156 string path = Main.SavePath + Path.DirectorySeparatorChar + "TerrariaDrawLog.7z";
157 try
158 {
159 logWriter = new StreamWriter(new GZipStream(new FileStream(path, FileMode.Create), CompressionMode.Compress));
160 logBuilder = new StringBuilder(5000);
161 framesToLog = 600;
162 currentFrame = 1;
163 currentlyLogging = true;
164 }
165 catch
166 {
167 Main.NewText("Detailed logging could not be started.", 250, 250, 0);
168 }
169 }
171 {
172 logBuilder.AppendLine($"Start of Frame #{currentFrame}");
173 }
174 detailedDrawTimer.Restart();
175 lastDetailedDrawTime = detailedDrawTimer.Elapsed.TotalMilliseconds;
176 }
static StringBuilder logBuilder
Definition TimeLogger.cs:26
static bool currentlyLogging
Definition TimeLogger.cs:36
static int framesToLog
Definition TimeLogger.cs:28
static StreamWriter logWriter
Definition TimeLogger.cs:24
static bool startLoggingNextFrame
Definition TimeLogger.cs:32
static TimeLogData[] lightingTimes
Definition TimeLogger.cs:46
static double lastDetailedDrawTime
Definition TimeLogger.cs:40
static Stopwatch detailedDrawTimer
Definition TimeLogger.cs:38
static TimeLogData[] drawTimes
Definition TimeLogger.cs:44
static int currentFrame
Definition TimeLogger.cs:30
static TimeLogData[] renderTimes
Definition TimeLogger.cs:42
static DateTime Now
Definition DateTime.cs:103

References Terraria.TimeLogger.currentFrame, Terraria.TimeLogger.currentlyLogging, Terraria.TimeLogger.detailedDrawTimer, Terraria.TimeLogger.drawTimes, Terraria.TimeLogger.framesToLog, Terraria.TimeLogger.lastDetailedDrawTime, Terraria.TimeLogger.lightingTimes, Terraria.TimeLogger.logBuilder, Terraria.TimeLogger.logWriter, Terraria.Main.NewText(), System.DateTime.Now, Terraria.TimeLogger.renderTimes, and Terraria.TimeLogger.startLoggingNextFrame.

Referenced by Terraria.Main.DoDraw().