Description:
Keep ordered list of FPS. Keep a second list in original order.
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r672:4bbcf0283f69 -

@@ -70,7 +70,8
70 70 TimeSpan worldUpdateTime = TimeSpan.Zero;
71 71 TimeSpan simulationUpdateTime = TimeSpan.Zero;
72 72
73 List<float> past_fps = new List<float>(100);
73 Queue<float> past_fps = new Queue<float>(100);
74 List<float> past_fps_sorted = new List<float>(100);
74 75 // Queue<TimeSpan> past_draw = new Queue<TimeSpan>(100);
75 76 List<float> past_draw_millis = new List<float>(100);
76 77 int tilesDrawn = 0;
@@ -1003,9 +1004,9
1003 1004 {
1004 1005 past_draw_millis.Add((float)this.drawTime.TotalMilliseconds);
1005 1006 past_draw_millis.Sort();
1006 past_fps.Add(this.frameRate);
1007 past_fps.Sort();
1008
1007 past_fps.Enqueue(this.frameRate);
1008 past_fps_sorted.Add(this.frameRate);
1009 past_fps_sorted.Sort();
1009 1010
1010 1011 /*
1011 1012 if (this.frameRate > 60.0)
@@ -1079,8 +1080,8
1079 1080 additionalInfo.Add("Dialog entries", entries);
1080 1081 additionalInfo.Add("Metadata entries", descriptions);
1081 1082
1082 if ((past_fps.Count() > 5) && show_another_window) {
1083 var past_fps_floats = past_fps.ToArray();
1083 if ((past_fps_sorted.Count() > 5) && show_another_window) {
1084 var past_fps_floats = past_fps_sorted.ToArray();
1084 1085 additionalInfo.Add(".01%% fps", MathUtils.Percentile(past_fps_floats, 0.0001f).ToString());
1085 1086 additionalInfo.Add(".1%% fps", MathUtils.Percentile(past_fps_floats, 0.001f).ToString());
1086 1087 additionalInfo.Add("1%% fps", MathUtils.Percentile(past_fps_floats, 0.01f).ToString());
@@ -56,7 +56,6
56 56 }
57 57 }
58 58
59
60 59 private const float SPONTANEOUS_NEW_TREE_CHANCE = 0.9995f;
61 60 private const float NEIGHBOR_NEW_TREE_CHANCE = 0.995f;
62 61 private const float NEIGHBOR_CROWDS_TREE_CHANCE = 0.995f;
@@ -133,14 +132,12
133 132 {
134 133 if (this.budgets.Count >= 2) {
135 134 return this.budgets[this.budgets.Count - 2];
136
137 135 }
138 136 else
139 137 {
140 138 return new Budget { };
141 139 }
142 140 }
143
144 141 }
145 142
146 143 public System.Collections.Generic.IEnumerable<Budget> allBudgets()
@@ -215,7 +212,6
215 212 {
216 213 get {
217 214 return this.map.iterate_cells_with_neighbors(7).Where(c => c.HasTree).Count();
218
219 215 }
220 216 }
221 217
@@ -375,12 +371,10
375 371
376 372 public Budget applyBudget(Budget budget)
377 373 {
378
379 374 this.money = budget.money
380 375 - (budget.upkeep + budget.tree_planting + budget.tree_clearing + budget.enforcement)
381 376 + (budget.subsidy + budget.contracts + budget.misc);
382 377
383
384 378 budget.final_money = this.money;
385 379 budget.cashflow = budget.final_money - budget.money;
386 380
You need to be logged in to leave comments. Login now