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:
@@ -11,16 +11,14 @@
|
||||
|
||||
#include "input/steam_input_source.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
namespace {
|
||||
std::string manifest_path()
|
||||
{
|
||||
char buffer[MAX_PATH] = {};
|
||||
const DWORD len = GetModuleFileNameA(nullptr, buffer, MAX_PATH);
|
||||
std::string path(buffer, len);
|
||||
const std::size_t slash = path.find_last_of("\\/");
|
||||
if (slash != std::string::npos)
|
||||
{
|
||||
if (slash != std::string::npos) {
|
||||
path.resize(slash + 1);
|
||||
}
|
||||
return path + "steam_input_actions.vdf";
|
||||
@@ -31,25 +29,21 @@ int main()
|
||||
{
|
||||
coop::SteamInputSource src;
|
||||
const bool ok = src.init(manifest_path());
|
||||
std::printf("init=%d steam_active=%d backend=\"%s\"\n", ok ? 1 : 0, src.steam_active() ? 1 : 0,
|
||||
src.name());
|
||||
std::printf("init=%d steam_active=%d backend=\"%s\"\n", ok ? 1 : 0, src.steam_active() ? 1 : 0, src.name());
|
||||
|
||||
for (int frame = 0; frame < 20; ++frame)
|
||||
{
|
||||
for (int frame = 0; frame < 20; ++frame) {
|
||||
src.poll();
|
||||
Sleep(50);
|
||||
}
|
||||
|
||||
std::printf("steam_controllers=%d\n", src.steam_controllers());
|
||||
const auto& pads = src.pads();
|
||||
for (std::uint32_t i = 0; i < coop::kMaxPads; ++i)
|
||||
{
|
||||
for (std::uint32_t i = 0; i < coop::kMaxPads; ++i) {
|
||||
const coop::PadInfo& p = pads[i];
|
||||
if (p.connected)
|
||||
{
|
||||
std::printf(" slot %u: source=\"%s\" buttons=0x%04X LX=%d LY=%d LT=%u RT=%u\n", i,
|
||||
p.source.c_str(), p.state.buttons, p.state.thumb_lx, p.state.thumb_ly,
|
||||
p.state.left_trigger, p.state.right_trigger);
|
||||
if (p.connected) {
|
||||
std::printf(" slot %u: source=\"%s\" buttons=0x%04X LX=%d LY=%d LT=%u RT=%u\n", i, p.source.c_str(),
|
||||
p.state.buttons, p.state.thumb_lx, p.state.thumb_ly, p.state.left_trigger,
|
||||
p.state.right_trigger);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user