From c4897f46e1380975a6ce0e7734314579176543f8 Mon Sep 17 00:00:00 2001 From: Liriosha <57261793+Liriosha@users.noreply.github.com> Date: Thu, 19 Mar 2026 11:04:59 -0400 Subject: [PATCH] clang-format --- 4J.Render/4J_Render.cpp | 30 ++++++++++++++++++------------ Minecraft.Client/Minecraft.cpp | 9 ++++----- subprojects/shiggy | 1 + 3 files changed, 23 insertions(+), 17 deletions(-) create mode 160000 subprojects/shiggy diff --git a/4J.Render/4J_Render.cpp b/4J.Render/4J_Render.cpp index db8a84051..1153b18d6 100644 --- a/4J.Render/4J_Render.cpp +++ b/4J.Render/4J_Render.cpp @@ -20,7 +20,7 @@ static SDL_Window* s_window = nullptr; static SDL_GLContext s_glContext = nullptr; static bool s_shouldClose = false; static int s_textureLevels = 1; -static int s_windowWidth = 1920; +static int s_windowWidth = 1920; static int s_windowHeight = 1080; // We set Window size with the monitor's res, so that I can get rid of ugly @@ -34,14 +34,20 @@ static void SetInitialWindowSize() { h = (int)(mode.h * 0.4f); } } - if (w > 0 && h > 0) { s_windowWidth = w; s_windowHeight = h; } - else { s_windowWidth = 1920; s_windowHeight = 1080; } + if (w > 0 && h > 0) { + s_windowWidth = w; + s_windowHeight = h; + } else { + s_windowWidth = 1920; + s_windowHeight = 1080; + } } // (can't believe i had to rewrite this, i literally did it TODAY.) -static int s_reqWidth = 1920; -static int s_reqHeight = 1080; -// When we'll have a settings system in order, we'll set bool to that value, right now it's hardcoded. -static bool s_fullscreen = false; +static int s_reqWidth = 1920; +static int s_reqHeight = 1080; +// When we'll have a settings system in order, we'll set bool to that value, +// right now it's hardcoded. +static bool s_fullscreen = false; static pthread_key_t s_glCtxKey; static pthread_once_t s_glCtxKeyOnce = PTHREAD_ONCE_INIT; @@ -126,14 +132,14 @@ void C4JRender::Initialise() { } int w, h, channels; - unsigned char* data = stbi_load("Common/Media/Graphics/MinecraftIcon.png", &w, &h, &channels, 4); + unsigned char* data = stbi_load("Common/Media/Graphics/MinecraftIcon.png", + &w, &h, &channels, 4); if (!data) { SDL_Log("Failed to load icon: %s", SDL_GetError()); } else { - SDL_Surface* icon = SDL_CreateRGBSurfaceFrom( - data, w, h, 32, w * 4, - 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 - ); + SDL_Surface* icon = + SDL_CreateRGBSurfaceFrom(data, w, h, 32, w * 4, 0x000000FF, + 0x0000FF00, 0x00FF0000, 0xFF000000); if (!icon) { SDL_Log("Failed to load icon: %s", SDL_GetError()); } else { diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 67ce2c4da..2f6741000 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -2066,11 +2066,10 @@ void Minecraft::run_middle() { // If there's an unoccupied quadrant, then clear that to black if (unoccupiedQuadrant > -1) { // render a logo - RenderManager.StateSetViewport(( - C4JRender:: - eViewportType)(C4JRender:: - VIEWPORT_TYPE_QUADRANT_TOP_LEFT + - unoccupiedQuadrant)); + RenderManager.StateSetViewport( + static_cast( + C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT + + unoccupiedQuadrant)); glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT); diff --git a/subprojects/shiggy b/subprojects/shiggy new file mode 160000 index 000000000..7adc6c478 --- /dev/null +++ b/subprojects/shiggy @@ -0,0 +1 @@ +Subproject commit 7adc6c47882409c31e4f2d66fbfabdf4a3a98fd1