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