For a static constant integer value, it's stylistically clearer to use constexpr instead of const. The resulting variable is implicitly const, but is also guaranteed to have a compile-time-computable value.
Use snprintf instead of _itoa as it's not available on all platforms. Also change the format specifies for unsigned variables to %u instead of %i, to be more correct...
Introduce a named constant for the width of a tab in the Guest window, and touch the places that set the window width to add it to the minimum window width when the debugging tab is enabled, so that the tab doesn't render off the side of the window.
Add a new tab to the Guest window which we can use to display debug information and tools for guests. At the moment it's blank and always visible; next step is to make it only show up when debugging tools are enabled.
Remove the widget_invalidate() call after changing a guest's
guest_heading_to_ride_id, because that call fails a debug assertion if
the guest window is open and the currently active tab is not the
"overview" tab. In Release builds (if assertion is disabled),
widget_invalidate() might access the widgets array out of bounds.
Instead, introduce a new flag PEEP_INVALIDATE_PEEP_ACTION for
window_invalidate_flags in the peep struct and set that flag. The guest
window update function then makes sure to invalidate the label if the
flag is set.
The flag could be used in other places to reduce libopenrct2 dependency
on window_*() calls (see #6808), but this commit only cares about cases
where the assertion would fail.
Previously when the arguments of a function wouldn't fit on a single line, clang-format would put each argument on its own line instead. By enabling the binpack parameter setting, it tried to fit as many on one line as possible instead.
Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.
I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).