Apply clang-format across the whole tree
Run clang-format (the repo's .clang-format: LLVM base, 120 cols, tabs, Allman functions) over every source file so the tree is formatter-clean. Whitespace only -- no behavior change; full x64 + x86 suites pass. Also set SortIncludes: false in .clang-format. Windows include order is load-bearing (windows.h must precede tlhelp32.h / mmreg.h / xinput.h / dinput.h; winsock2.h must precede windows.h), and the default alphabetical sort reorders tlhelp32.h ahead of windows.h -- a build break. Leaving order alone keeps the manual, correct grouping.
This commit is contained in:
@@ -27,8 +27,7 @@
|
||||
|
||||
using namespace coop;
|
||||
|
||||
namespace
|
||||
{
|
||||
namespace {
|
||||
|
||||
// Populate the hook back-channel with the worst case for the panels: every pad busy, and
|
||||
// the maximum number of render streams, each low-confidence (the longest provenance label)
|
||||
@@ -38,8 +37,7 @@ void fill_max_status(HookStatusView& st)
|
||||
st.attached = true;
|
||||
st.focus_spoof = true;
|
||||
st.heartbeat = 123456;
|
||||
for (std::uint32_t i = 0; i < kMaxPads; ++i)
|
||||
{
|
||||
for (std::uint32_t i = 0; i < kMaxPads; ++i) {
|
||||
st.get_state[i] = 9876543;
|
||||
st.get_caps[i] = 4242;
|
||||
st.rumble_left[i] = 65535;
|
||||
@@ -52,8 +50,7 @@ void fill_max_status(HookStatusView& st)
|
||||
st.game_pid = 4242;
|
||||
st.game_hwnd = 0x12345678;
|
||||
st.audio_streams_seen = kMaxAudioStreams + 5; // exercises the "(showing first N)" note
|
||||
for (std::uint32_t i = 0; i < kMaxAudioStreams; ++i)
|
||||
{
|
||||
for (std::uint32_t i = 0; i < kMaxAudioStreams; ++i) {
|
||||
AudioStreamInfo& s = st.audio_streams[i];
|
||||
s.is_primary = (i == 0) ? 1u : 0u;
|
||||
s.sample_rate = 192000;
|
||||
@@ -67,8 +64,7 @@ void fill_max_status(HookStatusView& st)
|
||||
|
||||
void fill_max_input(InputSnapshot& in)
|
||||
{
|
||||
for (std::uint32_t i = 0; i < kMaxPads; ++i)
|
||||
{
|
||||
for (std::uint32_t i = 0; i < kMaxPads; ++i) {
|
||||
in.pads[i].connected = true;
|
||||
in.pads[i].source = "XInput (RPT guest)";
|
||||
in.pads[i].state.connected = 1;
|
||||
@@ -90,8 +86,7 @@ bool run_size(float w, float h, AudioPanel& audio, ControllersPanel& controllers
|
||||
ImGui::GetIO().DisplaySize = ImVec2(w, h);
|
||||
set_layout_reference(w, h);
|
||||
set_layout_debug(true); // we drive the panels with Debug details on
|
||||
for (int frame = 0; frame < 4; ++frame)
|
||||
{
|
||||
for (int frame = 0; frame < 4; ++frame) {
|
||||
ImGui::GetIO().DeltaTime = 1.0f / 60.0f;
|
||||
ImGui::NewFrame();
|
||||
reset_panel_fit();
|
||||
@@ -103,8 +98,8 @@ bool run_size(float w, float h, AudioPanel& audio, ControllersPanel& controllers
|
||||
const bool over = panel_fit_overflow(&ox, &oy);
|
||||
char report[256];
|
||||
panel_fit_report(report, sizeof(report));
|
||||
std::printf(" %4.0fx%-4.0f %-9s %-28s (worst %.0f x, %.0f y)%s\n", w, h, over ? "OVERFLOW" : "fit",
|
||||
report, ox, oy, (over && !required) ? " [best-effort]" : "");
|
||||
std::printf(" %4.0fx%-4.0f %-9s %-28s (worst %.0f x, %.0f y)%s\n", w, h, over ? "OVERFLOW" : "fit", report, ox,
|
||||
oy, (over && !required) ? " [best-effort]" : "");
|
||||
return required ? !over : true;
|
||||
}
|
||||
|
||||
@@ -139,8 +134,7 @@ int main()
|
||||
run_size(1366, 768, audio, controllers, st, in, /*required=*/false);
|
||||
|
||||
ImGui::DestroyContext();
|
||||
if (!ok)
|
||||
{
|
||||
if (!ok) {
|
||||
std::printf("FAIL: a panel overflows its assigned size at 1920x1080 with Debug details on.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user