Commit Graph

17 Commits (a19a43a4f73046e72db1843b189c604f0d00c925)

Author SHA1 Message Date
Rubidium a19a43a4f7 Codechange: use fmt::format and time conversions over "custom" implementation 1 year ago
Rubidium 411379f587 Codechange: replace puts with fmt::print 1 year ago
Patric Stout 1fe7bbba8a
Codechange: rework NewGRFProfiler to use ticks instead of calendar-days (#10815)
We are planning to allow things like freezing the calendar, which
makes this variable a bit problemetic. So instead, suggest to the
user how many ticks there are in a calendar day, and let them figure
out how many ticks they want.

Additionally, use a TimeoutTimer for this, instead of an end-date
variable which is checked in an IntervalTimer.
1 year ago
Patric Stout d54660184a
Fix: NewGRF Profile didn't stop if there were no events yet (#10816)
This meant you could have the following situation:
- You start a profile on a GRF with no events, for N days.
- The days pass, the profile should stop. It doesn't.
- The profile will never stop, even if the GRF start generating events.
- There is no real way to discover this, so .. byebye memory? :)
1 year ago
Tyler Trahan 98d809c33b
Codechange: Don't use macros for DAYS_TILL and friends (#10746) 1 year ago
Rubidium 630d3bc053 Codechange: use fmt::format instead of printf for the NewGRF profiler 1 year ago
Tyler Trahan 930f0a16d8 Codechange: Define Date/Year/Month/Day within TimerGameCalendar class 1 year ago
Patric Stout 31ad990831
Codechange: move tick-counter into TimerGameTick (#10712) 1 year ago
Patric Stout 7aa2b9ab0a
Codechange: move all date-related variables inside the timer (#10706) 1 year ago
Patric Stout 3ebc7ad16e Codechange: migrate all game-time-related timers to the new framework 1 year ago
dP 548f0496a9
Change: Make _tick_counter 64bit to avoid wrapping (#10035) 2 years ago
rubidium42 eb6cdadc4d Codechange: replace IConsolePrintF with IConsolePrint and fmt formatting
Also make some strings more consistent with the rest of the console strings.
3 years ago
rubidium42 aa5a8fe28a Codechange: use thread safe time functions
Functions like localtime, gmtime and asctime are not thread safe as they (might) reuse the same buffer. So use the safer _s/_r variant for localtime and gmtime, and use strftime in favour of asctime.
3 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 3 years ago
Michael Lutz 5cbb2da794 Codechange: Even more std::string usage in file IO. 3 years ago
Quipyowert2 acb3d10832 Codechange: Format unsigned integers with %u instead of %i or %d. 4 years ago
Niels Martin Hansen c8779fb311
Feature: NewGRF callback profiling (#7868)
Adds a console command newgrf_profile to collect some profiling data about NewGRF action 2 callbacks and produce a CSV file.
4 years ago