From acf4a38555b4fd5f90319354178ea66af287f741 Mon Sep 17 00:00:00 2001 From: void_17 Date: Tue, 3 Mar 2026 09:45:52 +0700 Subject: [PATCH 1/5] Enable more aggressive optimizations /O2 /Ob3 --- Minecraft.Client/Minecraft.Client.vcxproj | 6 +++++- Minecraft.World/Minecraft.World.vcxproj | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Minecraft.Client/Minecraft.Client.vcxproj b/Minecraft.Client/Minecraft.Client.vcxproj index 5135fec9..54915636 100644 --- a/Minecraft.Client/Minecraft.Client.vcxproj +++ b/Minecraft.Client/Minecraft.Client.vcxproj @@ -1757,7 +1757,7 @@ xcopy /q /y /i /s /e $(ProjectDir)DurangoMedia\CU $(LayoutDir)Image\Loose\CUUse TurnOffAllWarnings ProgramDatabase - Full + MaxSpeed Sync false $(OutDir)$(ProjectName).pch @@ -1770,6 +1770,10 @@ xcopy /q /y /i /s /e $(ProjectDir)DurangoMedia\CU $(LayoutDir)Image\Loose\CUDefault false Speed + true + true + true + /Ob3 true diff --git a/Minecraft.World/Minecraft.World.vcxproj b/Minecraft.World/Minecraft.World.vcxproj index 16a93e1a..58880529 100644 --- a/Minecraft.World/Minecraft.World.vcxproj +++ b/Minecraft.World/Minecraft.World.vcxproj @@ -1339,7 +1339,7 @@ Use TurnOffAllWarnings ProgramDatabase - Full + MaxSpeed Sync false $(OutDir)$(ProjectName).pch @@ -1352,6 +1352,10 @@ true Default Speed + true + true + true + /Ob3 true From 0b1e51f620317e29666d6f3382a442544d783af6 Mon Sep 17 00:00:00 2001 From: Fayaz Shaikh <61674751+fayaz12g@users.noreply.github.com> Date: Mon, 2 Mar 2026 22:11:16 -0500 Subject: [PATCH 2/5] Cleaner implementation of support dynamic resizing aspect ratio (#228) * Add dynamic resolution * Clean up implementation * Use existing ints instead of new ones * Remove WM_SIZE argument (unecessary now that we directly use g_iScreenWidth and g_iScreenHeight) --- Minecraft.Client/glWrapper.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Minecraft.Client/glWrapper.cpp b/Minecraft.Client/glWrapper.cpp index 93b13d40..540271b9 100644 --- a/Minecraft.Client/glWrapper.cpp +++ b/Minecraft.Client/glWrapper.cpp @@ -48,12 +48,13 @@ void glLoadIdentity() RenderManager.MatrixSetIdentity(); } -extern UINT g_ScreenWidth; -extern UINT g_ScreenHeight; +extern int g_iScreenWidth; +extern int g_iScreenHeight; void gluPerspective(float fovy, float aspect, float zNear, float zFar) { - RenderManager.MatrixPerspective(fovy,aspect,zNear,zFar); + float dynamicAspect = (float)g_iScreenWidth / (float)g_iScreenHeight; + RenderManager.MatrixPerspective(fovy, dynamicAspect, zNear, zFar); } void glOrtho(float left,float right,float bottom,float top,float zNear,float zFar) From 77a161e8134f5121020b8e905baf09f226553f46 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Tue, 3 Mar 2026 11:23:15 +0800 Subject: [PATCH 3/5] docs: update Discord invite link in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 84d0186d..ba02cdda 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MinecraftConsoles -[![Discord](https://img.shields.io/badge/Discord-Join%20Server-5865F2?logo=discord&logoColor=white)](https://discord.gg/5CSzhc9t) +[![Discord](https://img.shields.io/badge/Discord-Join%20Server-5865F2?logo=discord&logoColor=white)](https://discord.gg/jrum7HhegA) ![Tutorial World](.github/TutorialWorld.png) From 7f7d99501cf87fcc234a5d3af453e7e0642f96a3 Mon Sep 17 00:00:00 2001 From: void_17 <61356189+void2012@users.noreply.github.com> Date: Tue, 3 Mar 2026 10:23:28 +0700 Subject: [PATCH 4/5] =?UTF-8?q?Revert=20"Win64:=20configurable=20username?= =?UTF-8?q?=20(username.txt)=20and=20persistent=20game=20setti=E2=80=A6"?= =?UTF-8?q?=20(#234)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b8a7f816b52775fdcfb3503f0000accb8cd65765. --- Minecraft.Client/Common/Consoles_App.cpp | 45 --------------- Minecraft.Client/Extrax64Stubs.cpp | 9 ++- Minecraft.Client/Windows64/Windows64_App.cpp | 57 +------------------ Minecraft.Client/Windows64/Windows64_App.h | 2 - .../Windows64/Windows64_Minecraft.cpp | 27 +-------- 5 files changed, 8 insertions(+), 132 deletions(-) diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index b476ca90..0e02ab40 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -760,43 +760,6 @@ bool CMinecraftApp::LoadBeaconMenu(int iPad ,shared_ptr inventory, sh ////////////////////////////////////////////// // GAME SETTINGS ////////////////////////////////////////////// - -#ifdef _WINDOWS64 -static void Win64_GetSettingsPath(char *outPath, DWORD size) -{ - GetModuleFileNameA(NULL, outPath, size); - char *lastSlash = strrchr(outPath, '\\'); - if (lastSlash) *(lastSlash + 1) = '\0'; - strncat_s(outPath, size, "settings.dat", _TRUNCATE); -} -static void Win64_SaveSettings(GAME_SETTINGS *gs) -{ - if (!gs) return; - char filePath[MAX_PATH] = {}; - Win64_GetSettingsPath(filePath, MAX_PATH); - FILE *f = NULL; - if (fopen_s(&f, filePath, "wb") == 0 && f) - { - fwrite(gs, sizeof(GAME_SETTINGS), 1, f); - fclose(f); - } -} -static void Win64_LoadSettings(GAME_SETTINGS *gs) -{ - if (!gs) return; - char filePath[MAX_PATH] = {}; - Win64_GetSettingsPath(filePath, MAX_PATH); - FILE *f = NULL; - if (fopen_s(&f, filePath, "rb") == 0 && f) - { - GAME_SETTINGS temp = {}; - if (fread(&temp, sizeof(GAME_SETTINGS), 1, f) == 1) - memcpy(gs, &temp, sizeof(GAME_SETTINGS)); - fclose(f); - } -} -#endif - void CMinecraftApp::InitGameSettings() { for(int i=0;ibSettingsChanged=false; } @@ -2427,9 +2385,6 @@ void CMinecraftApp::CheckGameSettingsChanged(bool bOverride5MinuteTimer, int iPa StorageManager.WriteToProfile(iPad,true, bOverride5MinuteTimer); #else ProfileManager.WriteToProfile(iPad,true, bOverride5MinuteTimer); -#ifdef _WINDOWS64 - Win64_SaveSettings(GameSettingsA[iPad]); -#endif #endif GameSettingsA[iPad]->bSettingsChanged=false; } diff --git a/Minecraft.Client/Extrax64Stubs.cpp b/Minecraft.Client/Extrax64Stubs.cpp index 23b2c7f0..f368afed 100644 --- a/Minecraft.Client/Extrax64Stubs.cpp +++ b/Minecraft.Client/Extrax64Stubs.cpp @@ -199,11 +199,10 @@ DWORD IQNetPlayer::GetSendQueueSize(IQNetPlayer * player, DWORD dwFlags) { retur DWORD IQNetPlayer::GetCurrentRtt() { return 0; } bool IQNetPlayer::IsHost() { return m_isHostPlayer; } bool IQNetPlayer::IsGuest() { return false; } -bool IQNetPlayer::IsLocal() { return true; } -PlayerUID IQNetPlayer::GetXuid() { return INVALID_XUID; } -extern wstring g_playerName; -LPCWSTR IQNetPlayer::GetGamertag() { return g_playerName.empty() ? L"Windows" : g_playerName.c_str(); } -int IQNetPlayer::GetSessionIndex() { return 0; } +bool IQNetPlayer::IsLocal() { return !m_isRemote; } +PlayerUID IQNetPlayer::GetXuid() { return (PlayerUID)(0xe000d45248242f2e + m_smallId); } +LPCWSTR IQNetPlayer::GetGamertag() { return m_gamertag; } +int IQNetPlayer::GetSessionIndex() { return m_smallId; } bool IQNetPlayer::IsTalking() { return false; } bool IQNetPlayer::IsMutedByLocalUser(DWORD dwUserIndex) { return false; } bool IQNetPlayer::HasVoice() { return false; } diff --git a/Minecraft.Client/Windows64/Windows64_App.cpp b/Minecraft.Client/Windows64/Windows64_App.cpp index 461e8c34..dbc1bfc5 100644 --- a/Minecraft.Client/Windows64/Windows64_App.cpp +++ b/Minecraft.Client/Windows64/Windows64_App.cpp @@ -10,46 +10,11 @@ #include "..\..\Minecraft.World\BiomeSource.h" #include "..\..\Minecraft.World\LevelType.h" -wstring g_playerName; - CConsoleMinecraftApp app; -static void LoadPlayerName() -{ - if (!g_playerName.empty()) return; - g_playerName = L"Windows"; - - char exePath[MAX_PATH] = {}; - GetModuleFileNameA(NULL, exePath, MAX_PATH); - char *lastSlash = strrchr(exePath, '\\'); - if (lastSlash) *(lastSlash + 1) = '\0'; - char filePath[MAX_PATH] = {}; - _snprintf_s(filePath, sizeof(filePath), _TRUNCATE, "%susername.txt", exePath); - - FILE *f = NULL; - if (fopen_s(&f, filePath, "r") == 0 && f) - { - char buf[128] = {}; - if (fgets(buf, sizeof(buf), f)) - { - int len = (int)strlen(buf); - while (len > 0 && (buf[len-1] == '\n' || buf[len-1] == '\r' || buf[len-1] == ' ')) - buf[--len] = '\0'; - if (len > 0) - { - wchar_t wbuf[128] = {}; - mbstowcs(wbuf, buf, 127); - g_playerName = wbuf; - } - } - fclose(f); - } -} - CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp() { m_bShutdown = false; - LoadPlayerName(); } void CConsoleMinecraftApp::SetRichPresenceContext(int iPad, int contextId) @@ -70,27 +35,9 @@ void CConsoleMinecraftApp::FatalLoadError() void CConsoleMinecraftApp::CaptureSaveThumbnail() { - RenderManager.CaptureThumbnail(&m_ThumbnailBuffer); } void CConsoleMinecraftApp::GetSaveThumbnail(PBYTE *pbData,DWORD *pdwSize) { - // On a save caused by a create world, the thumbnail capture won't have happened - if (m_ThumbnailBuffer.Allocated()) - { - if (pbData) - { - *pbData = new BYTE[m_ThumbnailBuffer.GetBufferSize()]; - *pdwSize = m_ThumbnailBuffer.GetBufferSize(); - memcpy(*pbData, m_ThumbnailBuffer.GetBufferPointer(), *pdwSize); - } - m_ThumbnailBuffer.Release(); - } - else - { - // No capture happened (e.g. first save on world creation) leave thumbnail as NULL - if (pbData) *pbData = NULL; - if (pdwSize) *pdwSize = 0; - } } void CConsoleMinecraftApp::ReleaseSaveThumbnail() { @@ -110,8 +57,8 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() Minecraft *pMinecraft=Minecraft::GetInstance(); app.ReleaseSaveThumbnail(); ProfileManager.SetLockedProfile(0); - LoadPlayerName(); - pMinecraft->user->name = g_playerName; + extern wchar_t g_Win64UsernameW[17]; + pMinecraft->user->name = g_Win64UsernameW; app.ApplyGameSettingsChanged(0); ////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameJoinLoad::OnInit diff --git a/Minecraft.Client/Windows64/Windows64_App.h b/Minecraft.Client/Windows64/Windows64_App.h index bff916ec..de8f6d85 100644 --- a/Minecraft.Client/Windows64/Windows64_App.h +++ b/Minecraft.Client/Windows64/Windows64_App.h @@ -1,9 +1,7 @@ #pragma once -#include "4JLibs\inc\4J_Render.h" class CConsoleMinecraftApp : public CMinecraftApp { - ImageFileBuffer m_ThumbnailBuffer; public: CConsoleMinecraftApp(); diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index 48040c66..272b29bf 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -729,16 +729,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); - // 4J-Win64: set CWD to exe dir so asset paths resolve correctly - { - char szExeDir[MAX_PATH] = {}; - GetModuleFileNameA(NULL, szExeDir, MAX_PATH); - char *pSlash = strrchr(szExeDir, '\\'); - if (pSlash) { *(pSlash + 1) = '\0'; SetCurrentDirectoryA(szExeDir); } - } - - // Declare DPI awareness so GetSystemMetrics returns physical pixels - SetProcessDPIAware(); + dyn_SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE); g_iScreenWidth = GetSystemMetrics(SM_CXSCREEN); g_iScreenHeight = GetSystemMetrics(SM_CYSCREEN); @@ -1272,21 +1263,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, } } - // F3 toggles the debug console overlay, F11 toggles fullscreen - if (KMInput.IsKeyPressed(VK_F3)) - { - static bool s_debugConsole = false; - s_debugConsole = !s_debugConsole; - ui.ShowUIDebugConsole(s_debugConsole); - } - -#ifdef _DEBUG_MENUS_ENABLED - if (KMInput.IsKeyPressed(VK_F4)) - { - ui.NavigateToScene(ProfileManager.GetPrimaryPad(), eUIScene_DebugOverlay, NULL, eUILayer_Debug); - } -#endif - + // F11 toggles fullscreen if (KMInput.IsKeyPressed(VK_F11)) { ToggleFullscreen(); From b42a4a4e4d72f6dea0a243c77247f7b9e739f5eb Mon Sep 17 00:00:00 2001 From: void_17 <61356189+void2012@users.noreply.github.com> Date: Tue, 3 Mar 2026 10:31:09 +0700 Subject: [PATCH 5/5] =?UTF-8?q?Revert=20"Revert=20"Win64:=20configurable?= =?UTF-8?q?=20username=20(username.txt)=20and=20persistent=20ga=E2=80=A6"?= =?UTF-8?q?=20(#235)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7f7d99501cf87fcc234a5d3af453e7e0642f96a3. --- Minecraft.Client/Common/Consoles_App.cpp | 45 +++++++++++++++ Minecraft.Client/Extrax64Stubs.cpp | 9 +-- Minecraft.Client/Windows64/Windows64_App.cpp | 57 ++++++++++++++++++- Minecraft.Client/Windows64/Windows64_App.h | 2 + .../Windows64/Windows64_Minecraft.cpp | 27 ++++++++- 5 files changed, 132 insertions(+), 8 deletions(-) diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index 0e02ab40..b476ca90 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -760,6 +760,43 @@ bool CMinecraftApp::LoadBeaconMenu(int iPad ,shared_ptr inventory, sh ////////////////////////////////////////////// // GAME SETTINGS ////////////////////////////////////////////// + +#ifdef _WINDOWS64 +static void Win64_GetSettingsPath(char *outPath, DWORD size) +{ + GetModuleFileNameA(NULL, outPath, size); + char *lastSlash = strrchr(outPath, '\\'); + if (lastSlash) *(lastSlash + 1) = '\0'; + strncat_s(outPath, size, "settings.dat", _TRUNCATE); +} +static void Win64_SaveSettings(GAME_SETTINGS *gs) +{ + if (!gs) return; + char filePath[MAX_PATH] = {}; + Win64_GetSettingsPath(filePath, MAX_PATH); + FILE *f = NULL; + if (fopen_s(&f, filePath, "wb") == 0 && f) + { + fwrite(gs, sizeof(GAME_SETTINGS), 1, f); + fclose(f); + } +} +static void Win64_LoadSettings(GAME_SETTINGS *gs) +{ + if (!gs) return; + char filePath[MAX_PATH] = {}; + Win64_GetSettingsPath(filePath, MAX_PATH); + FILE *f = NULL; + if (fopen_s(&f, filePath, "rb") == 0 && f) + { + GAME_SETTINGS temp = {}; + if (fread(&temp, sizeof(GAME_SETTINGS), 1, f) == 1) + memcpy(gs, &temp, sizeof(GAME_SETTINGS)); + fclose(f); + } +} +#endif + void CMinecraftApp::InitGameSettings() { for(int i=0;ibSettingsChanged=false; } @@ -2385,6 +2427,9 @@ void CMinecraftApp::CheckGameSettingsChanged(bool bOverride5MinuteTimer, int iPa StorageManager.WriteToProfile(iPad,true, bOverride5MinuteTimer); #else ProfileManager.WriteToProfile(iPad,true, bOverride5MinuteTimer); +#ifdef _WINDOWS64 + Win64_SaveSettings(GameSettingsA[iPad]); +#endif #endif GameSettingsA[iPad]->bSettingsChanged=false; } diff --git a/Minecraft.Client/Extrax64Stubs.cpp b/Minecraft.Client/Extrax64Stubs.cpp index f368afed..23b2c7f0 100644 --- a/Minecraft.Client/Extrax64Stubs.cpp +++ b/Minecraft.Client/Extrax64Stubs.cpp @@ -199,10 +199,11 @@ DWORD IQNetPlayer::GetSendQueueSize(IQNetPlayer * player, DWORD dwFlags) { retur DWORD IQNetPlayer::GetCurrentRtt() { return 0; } bool IQNetPlayer::IsHost() { return m_isHostPlayer; } bool IQNetPlayer::IsGuest() { return false; } -bool IQNetPlayer::IsLocal() { return !m_isRemote; } -PlayerUID IQNetPlayer::GetXuid() { return (PlayerUID)(0xe000d45248242f2e + m_smallId); } -LPCWSTR IQNetPlayer::GetGamertag() { return m_gamertag; } -int IQNetPlayer::GetSessionIndex() { return m_smallId; } +bool IQNetPlayer::IsLocal() { return true; } +PlayerUID IQNetPlayer::GetXuid() { return INVALID_XUID; } +extern wstring g_playerName; +LPCWSTR IQNetPlayer::GetGamertag() { return g_playerName.empty() ? L"Windows" : g_playerName.c_str(); } +int IQNetPlayer::GetSessionIndex() { return 0; } bool IQNetPlayer::IsTalking() { return false; } bool IQNetPlayer::IsMutedByLocalUser(DWORD dwUserIndex) { return false; } bool IQNetPlayer::HasVoice() { return false; } diff --git a/Minecraft.Client/Windows64/Windows64_App.cpp b/Minecraft.Client/Windows64/Windows64_App.cpp index dbc1bfc5..461e8c34 100644 --- a/Minecraft.Client/Windows64/Windows64_App.cpp +++ b/Minecraft.Client/Windows64/Windows64_App.cpp @@ -10,11 +10,46 @@ #include "..\..\Minecraft.World\BiomeSource.h" #include "..\..\Minecraft.World\LevelType.h" +wstring g_playerName; + CConsoleMinecraftApp app; +static void LoadPlayerName() +{ + if (!g_playerName.empty()) return; + g_playerName = L"Windows"; + + char exePath[MAX_PATH] = {}; + GetModuleFileNameA(NULL, exePath, MAX_PATH); + char *lastSlash = strrchr(exePath, '\\'); + if (lastSlash) *(lastSlash + 1) = '\0'; + char filePath[MAX_PATH] = {}; + _snprintf_s(filePath, sizeof(filePath), _TRUNCATE, "%susername.txt", exePath); + + FILE *f = NULL; + if (fopen_s(&f, filePath, "r") == 0 && f) + { + char buf[128] = {}; + if (fgets(buf, sizeof(buf), f)) + { + int len = (int)strlen(buf); + while (len > 0 && (buf[len-1] == '\n' || buf[len-1] == '\r' || buf[len-1] == ' ')) + buf[--len] = '\0'; + if (len > 0) + { + wchar_t wbuf[128] = {}; + mbstowcs(wbuf, buf, 127); + g_playerName = wbuf; + } + } + fclose(f); + } +} + CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp() { m_bShutdown = false; + LoadPlayerName(); } void CConsoleMinecraftApp::SetRichPresenceContext(int iPad, int contextId) @@ -35,9 +70,27 @@ void CConsoleMinecraftApp::FatalLoadError() void CConsoleMinecraftApp::CaptureSaveThumbnail() { + RenderManager.CaptureThumbnail(&m_ThumbnailBuffer); } void CConsoleMinecraftApp::GetSaveThumbnail(PBYTE *pbData,DWORD *pdwSize) { + // On a save caused by a create world, the thumbnail capture won't have happened + if (m_ThumbnailBuffer.Allocated()) + { + if (pbData) + { + *pbData = new BYTE[m_ThumbnailBuffer.GetBufferSize()]; + *pdwSize = m_ThumbnailBuffer.GetBufferSize(); + memcpy(*pbData, m_ThumbnailBuffer.GetBufferPointer(), *pdwSize); + } + m_ThumbnailBuffer.Release(); + } + else + { + // No capture happened (e.g. first save on world creation) leave thumbnail as NULL + if (pbData) *pbData = NULL; + if (pdwSize) *pdwSize = 0; + } } void CConsoleMinecraftApp::ReleaseSaveThumbnail() { @@ -57,8 +110,8 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() Minecraft *pMinecraft=Minecraft::GetInstance(); app.ReleaseSaveThumbnail(); ProfileManager.SetLockedProfile(0); - extern wchar_t g_Win64UsernameW[17]; - pMinecraft->user->name = g_Win64UsernameW; + LoadPlayerName(); + pMinecraft->user->name = g_playerName; app.ApplyGameSettingsChanged(0); ////////////////////////////////////////////////////////////////////////////////////////////// From CScene_MultiGameJoinLoad::OnInit diff --git a/Minecraft.Client/Windows64/Windows64_App.h b/Minecraft.Client/Windows64/Windows64_App.h index de8f6d85..bff916ec 100644 --- a/Minecraft.Client/Windows64/Windows64_App.h +++ b/Minecraft.Client/Windows64/Windows64_App.h @@ -1,7 +1,9 @@ #pragma once +#include "4JLibs\inc\4J_Render.h" class CConsoleMinecraftApp : public CMinecraftApp { + ImageFileBuffer m_ThumbnailBuffer; public: CConsoleMinecraftApp(); diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index 272b29bf..48040c66 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -729,7 +729,16 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); - dyn_SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE); + // 4J-Win64: set CWD to exe dir so asset paths resolve correctly + { + char szExeDir[MAX_PATH] = {}; + GetModuleFileNameA(NULL, szExeDir, MAX_PATH); + char *pSlash = strrchr(szExeDir, '\\'); + if (pSlash) { *(pSlash + 1) = '\0'; SetCurrentDirectoryA(szExeDir); } + } + + // Declare DPI awareness so GetSystemMetrics returns physical pixels + SetProcessDPIAware(); g_iScreenWidth = GetSystemMetrics(SM_CXSCREEN); g_iScreenHeight = GetSystemMetrics(SM_CYSCREEN); @@ -1263,7 +1272,21 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, } } - // F11 toggles fullscreen + // F3 toggles the debug console overlay, F11 toggles fullscreen + if (KMInput.IsKeyPressed(VK_F3)) + { + static bool s_debugConsole = false; + s_debugConsole = !s_debugConsole; + ui.ShowUIDebugConsole(s_debugConsole); + } + +#ifdef _DEBUG_MENUS_ENABLED + if (KMInput.IsKeyPressed(VK_F4)) + { + ui.NavigateToScene(ProfileManager.GetPrimaryPad(), eUIScene_DebugOverlay, NULL, eUILayer_Debug); + } +#endif + if (KMInput.IsKeyPressed(VK_F11)) { ToggleFullscreen();