From 73cc345f54b989aab39d05ad1b269a338771ab52 Mon Sep 17 00:00:00 2001 From: Vincent Zhang <73851560+bootsareme@users.noreply.github.com> Date: Thu, 5 Mar 2026 23:54:30 -0500 Subject: [PATCH] Add a launch argument for full screen (#663) * per user config should be .gitignored * add comment surrounding gitignore update * make it wildcard * add fullscreen to launch option struct * remove redundant forward declaration and use fullscreen launch option in main --- .gitignore | 3 +++ .../Minecraft.Client.vcxproj.user | 22 ------------------- .../Windows64/Windows64_Minecraft.cpp | 5 ++++- 3 files changed, 7 insertions(+), 23 deletions(-) delete mode 100644 Minecraft.Client/Minecraft.Client.vcxproj.user diff --git a/.gitignore b/.gitignore index 9caff84a..ef12716d 100644 --- a/.gitignore +++ b/.gitignore @@ -433,3 +433,6 @@ build/* # Local saves Minecraft.Client/Saves/ + +# Visual Studio Per-User Config +*.user diff --git a/Minecraft.Client/Minecraft.Client.vcxproj.user b/Minecraft.Client/Minecraft.Client.vcxproj.user deleted file mode 100644 index 24ca62f8..00000000 --- a/Minecraft.Client/Minecraft.Client.vcxproj.user +++ /dev/null @@ -1,22 +0,0 @@ - - - - Debug - - - $(SolutionDir)$(Platform)\$(Configuration)\ - WindowsLocalDebugger - - - $(SolutionDir)$(Platform)\$(Configuration)\ - WindowsLocalDebugger - - - $(SolutionDir)$(Platform)\$(Configuration)\ - WindowsLocalDebugger - - - $(SolutionDir)$(Platform)\$(Configuration)\ - WindowsLocalDebugger - - diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index 2eef5f73..1146b86d 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -110,6 +110,7 @@ struct Win64LaunchOptions { int screenMode; bool serverMode; + bool fullscreen; }; static void CopyWideArgToAnsi(LPCWSTR source, char* dest, size_t destSize) @@ -256,6 +257,8 @@ static Win64LaunchOptions ParseLaunchOptions() g_Win64MultiplayerPort = (int)port; } } + else if (_wcsicmp(argv[i], L"-fullscreen") == 0) + options.fullscreen = true; } LocalFree(argv); @@ -1245,7 +1248,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, } // Restore fullscreen state from previous session - if (LoadFullscreenOption() && !g_isFullscreen) + if (LoadFullscreenOption() && !g_isFullscreen || launchOptions.fullscreen) { ToggleFullscreen(); }