Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros
TestHighFPSIssues.cs
Go to the documentation of this file.
4
5namespace Terraria;
6
7public class TestHighFPSIssues
8{
9 private static List<double> _tapUpdates = new List<double>();
10
12
13 private static List<double> _tapDraws = new List<double>();
14
15 private static int conU;
16
17 private static int conUH;
18
19 private static int conD;
20
21 private static int conDH;
22
23 private static int race;
24
25 public static void TapUpdate(GameTime gt)
26 {
27 _tapUpdates.Add(gt.TotalGameTime.TotalMilliseconds);
28 conD = 0;
29 race--;
30 if (++conU > conUH)
31 {
32 conUH = conU;
33 }
34 }
35
36 public static void TapUpdateEnd(GameTime gt)
37 {
38 _tapUpdateEnds.Add(gt.TotalGameTime.TotalMilliseconds);
39 }
40
41 public static void TapDraw(GameTime gt)
42 {
43 _tapDraws.Add(gt.TotalGameTime.TotalMilliseconds);
44 conU = 0;
45 race++;
46 if (++conD > conDH)
47 {
48 conDH = conD;
49 }
50 }
51
52 public static void Update(GameTime gt)
53 {
54 if (PlayerInput.Triggers.Current.Down)
55 {
56 race = (conUH = (conDH = 0));
57 }
58 double num = gt.TotalGameTime.TotalMilliseconds - 5000.0;
59 while (_tapUpdates.Count > 0 && _tapUpdates[0] < num)
60 {
61 _tapUpdates.RemoveAt(0);
62 }
63 while (_tapDraws.Count > 0 && _tapDraws[0] < num)
64 {
65 _tapDraws.RemoveAt(0);
66 }
67 while (_tapUpdateEnds.Count > 0 && _tapUpdateEnds[0] < num)
68 {
69 _tapUpdateEnds.RemoveAt(0);
70 }
71 Main.versionNumber = "total (u/d) " + _tapUpdates.Count + " " + _tapUpdateEnds.Count + " " + race + " " + conUH + " " + conDH;
73 }
74}
static TriggersPack Triggers
static string versionNumber
Definition Main.cs:303
static void NewText(string newText, byte R=byte.MaxValue, byte G=byte.MaxValue, byte B=byte.MaxValue)
Definition Main.cs:61429
static void TapDraw(GameTime gt)
static void TapUpdateEnd(GameTime gt)
static void Update(GameTime gt)
static List< double > _tapDraws
static List< double > _tapUpdates
static void TapUpdate(GameTime gt)
static List< double > _tapUpdateEnds