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,13 +11,11 @@
|
||||
#include "ui/app_chrome.hpp"
|
||||
#include "util/utf8.hpp"
|
||||
|
||||
namespace coop
|
||||
{
|
||||
namespace coop {
|
||||
|
||||
ImGuiLayer::~ImGuiLayer()
|
||||
{
|
||||
if (initialized_)
|
||||
{
|
||||
if (initialized_) {
|
||||
ImGui_ImplDX11_Shutdown();
|
||||
ImGui_ImplWin32_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
@@ -42,12 +40,10 @@ bool ImGuiLayer::init(HWND hwnd, ID3D11Device* device, ID3D11DeviceContext* cont
|
||||
io.IniFilename = ini_path_.c_str();
|
||||
set_layout_persisted(had_layout);
|
||||
|
||||
if (!ImGui_ImplWin32_Init(hwnd))
|
||||
{
|
||||
if (!ImGui_ImplWin32_Init(hwnd)) {
|
||||
return false;
|
||||
}
|
||||
if (!ImGui_ImplDX11_Init(device, context))
|
||||
{
|
||||
if (!ImGui_ImplDX11_Init(device, context)) {
|
||||
return false;
|
||||
}
|
||||
initialized_ = true;
|
||||
@@ -78,8 +74,7 @@ void ImGuiLayer::apply_dpi(unsigned dpi)
|
||||
|
||||
// Drop the DX11 backend's cached font texture so it rebuilds from the new atlas next frame. Before
|
||||
// the first frame nothing is built yet, so this is a harmless no-op during init().
|
||||
if (initialized_)
|
||||
{
|
||||
if (initialized_) {
|
||||
ImGui_ImplDX11_InvalidateDeviceObjects();
|
||||
}
|
||||
dpi_scale_ = scale;
|
||||
@@ -87,8 +82,7 @@ void ImGuiLayer::apply_dpi(unsigned dpi)
|
||||
|
||||
void ImGuiLayer::set_dpi(unsigned dpi)
|
||||
{
|
||||
if (!initialized_ || dpi_scale_from(dpi) == dpi_scale_)
|
||||
{
|
||||
if (!initialized_ || dpi_scale_from(dpi) == dpi_scale_) {
|
||||
return; // not up yet, or the scale didn't actually change -- skip a needless atlas rebuild
|
||||
}
|
||||
apply_dpi(dpi);
|
||||
|
||||
Reference in New Issue
Block a user