From df2a4d85ef2150c3db4b3220e068e9b2e7c0324b Mon Sep 17 00:00:00 2001 From: str1k3r <115313679+S1l3ntStr1ke87@users.noreply.github.com> Date: Tue, 11 Aug 2026 15:29:53 -0400 Subject: [PATCH 1/5] fix: save space indicator & windows64 image scaling --- Minecraft.Client/Common/UI/UIController.cpp | 2 +- .../Common/UI/UIScene_LoadOrJoinMenu.cpp | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index cad6d771..c0bf848b 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -1399,7 +1399,7 @@ GDrawTexture * RADLINK UIController::TextureSubstitutionCreateCallback ( void * // 4J Stu - All our flash controls that allow replacing textures use a special 64x64 symbol // Force this size here so that our images don't get scaled wildly - #if (defined __ORBIS__ || defined _DURANGO ) + #if (defined __ORBIS__ || defined _DURANGO || defined _WINDOWS64 ) *width = 96; *height = 96; #else diff --git a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp index eee6c507..8e863519 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp @@ -636,15 +636,20 @@ void UIScene_LoadOrJoinMenu::tick() #elif defined(_WINDOWS64) ZeroMemory(m_saveDetails[i].UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH); memcpy(m_saveDetails[i].UTF8SaveFilename, m_pSaveDetails->SaveInfoA[i].UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH - 1); - wstring filePath = wstring(L"Windows64\\GameHDD\\") + app.UTF8ToWide(m_saveDetails[i].UTF8SaveFilename) + wstring(L"\\saveData.ms"); + wstring folderPath = wstring(L"Windows64\\GameHDD\\") + app.UTF8ToWide(m_saveDetails[i].UTF8SaveFilename) + L"\\*"; DWORD fileSize = 0; WIN32_FIND_DATAW findData; - HANDLE hFile = FindFirstFileW(filePath.c_str(), &findData); + HANDLE hFile = FindFirstFileW(folderPath.c_str(), &findData); if (hFile != INVALID_HANDLE_VALUE) { - if (findData.nFileSizeHigh == 0 && findData.nFileSizeLow >= 12) - fileSize = findData.nFileSizeLow; + do { + if (!(findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + { + fileSize = findData.nFileSizeLow; + break; + } + } while (FindNextFileW(hFile, &findData)); FindClose(hFile); } m_spaceIndicatorSaves.addSave(fileSize); From 251cd8e304dd8dbec3a76557322a7c1b95465f20 Mon Sep 17 00:00:00 2001 From: str1k3r <115313679+S1l3ntStr1ke87@users.noreply.github.com> Date: Tue, 11 Aug 2026 18:36:29 -0400 Subject: [PATCH 2/5] feat(Windows64): fetch screen size instead of hardcoding & cleanup project filter --- Minecraft.Client/Common/UI/UIController.cpp | 37 ++++++++++---- Minecraft.Client/Common/UI/UIScene.cpp | 6 +-- Minecraft.Client/Minecraft.Client.vcxproj | 37 ++++++++++++++ .../Minecraft.Client.vcxproj.filters | 27 +++++----- Minecraft.Client/PSVita/PSVitaExtras/OldSdk.h | 6 +-- .../Windows64/Windows64_Minecraft.cpp | 50 +++++++++++++------ .../Windows64/Windows64_Minecraft.h | 4 ++ 7 files changed, 122 insertions(+), 45 deletions(-) create mode 100644 Minecraft.Client/Windows64/Windows64_Minecraft.h diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index c0bf848b..781d0f37 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -13,6 +13,8 @@ #include "UIFontData.h" #ifdef __PSVITA__ #include +#elif _WINDOWS64 +#include "Windows64\Windows64_Minecraft.h" #endif // 4J Stu - Enable this to override the Iggy Allocator @@ -179,10 +181,17 @@ UIController::UIController() #endif // 4J Stu - This is a bit of a hack until we change the Minecraft initialisation to store the proper screen size for other platforms -#if defined _WINDOWS64 || defined _DURANGO || defined __ORBIS__ - m_fScreenWidth = 1920.0f; - m_fScreenHeight = 1080.0f; +#if defined _DURANGO || defined __ORBIS__ + m_fScreenWidth = 1920; + m_fScreenHeight = 1080; m_bScreenWidthSetup = true; +#elif _WINDOWS64 + m_fScreenWidth = g_iScreenWidth; + m_fScreenHeight = g_iScreenHeight; + m_bScreenWidthSetup = true; +#ifdef _DEBUG + app.DebugPrintf("[UIController] Width: %d, Height: %d\n", m_fScreenWidth, m_fScreenHeight); +#endif #else m_fScreenWidth = 1280.0f; m_fScreenHeight = 720.0f; @@ -316,7 +325,7 @@ UIController::EFont UIController::getFontForLanguage(int language) switch(language) { case XC_LANGUAGE_JAPANESE: return eFont_Japanese; -#ifdef _DURANGO +#if defined(_DURANGO) || defined(_WINDOWS64) case XC_LANGUAGE_SCHINESE: return eFont_SimpChinese; #endif case XC_LANGUAGE_TCHINESE: return eFont_TradChinese; @@ -331,12 +340,11 @@ UITTFFont *UIController::createFont(EFont fontLanguage) { #if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) case eFont_Japanese: return new UITTFFont("Mojangles_TTF_jaJP", "Common/Media/font/JPN/DF-DotDotGothic16.ttf", 0x203B); // JPN - // case eFont_SimpChinese: Simplified Chinese is unsupported. case eFont_TradChinese: return new UITTFFont("Mojangles_TTF_cnTD", "Common/Media/font/CHT/DFTT_R5.TTC", 0x203B); // CHT case eFont_Korean: return new UITTFFont("Mojangles_TTF_koKR", "Common/Media/font/KOR/candadite2.ttf", 0x203B); // KOR #else case eFont_Japanese: return new UITTFFont("Mojangles_TTF_jaJP", "Common/Media/font/JPN/DFGMaruGothic-Md.ttf", 0x2022); // JPN -#ifdef _DURANGO +#if defined(_DURANGO) || defined(_WINDOWS64) case eFont_SimpChinese: return new UITTFFont("Mojangled_TTF_cnCN", "Common/Media/font/CHS/MSYH.ttf", 0x2022); // CHS #endif case eFont_TradChinese: return new UITTFFont("Mojangles_TTF_cnTD", "Common/Media/font/CHT/DFHeiMedium-B5.ttf", 0x2022); // CHT @@ -500,7 +508,7 @@ void UIController::loadSkins() #elif defined __PSVITA__ platformSkinPath = L"skinVita.swf"; #elif defined _WINDOWS64 - if(m_fScreenHeight >= 1080.0f) + if(m_fScreenWidth >= 1920.0f) { platformSkinPath = L"skinHDWin.swf"; } @@ -531,7 +539,7 @@ void UIController::loadSkins() // str1k3r - Fixes 720p/480p Crashes on Windows64, also allows this to be used on 1080p consoles instead of just Windows64 // This also cleans up some 4J code and turns 3 if statements into 1. - if (m_fScreenHeight >= 1080.0f) + if (m_fScreenWidth >= 1920.0f) { m_iggyLibraries[eLibrary_Platform] = loadSkin(platformSkinPath, L"platformskinHD.swf"); m_iggyLibraries[eLibrary_GraphicsDefault] = loadSkin(L"skinHDGraphics.swf", L"skinHDGraphics.swf"); @@ -1399,9 +1407,20 @@ GDrawTexture * RADLINK UIController::TextureSubstitutionCreateCallback ( void * // 4J Stu - All our flash controls that allow replacing textures use a special 64x64 symbol // Force this size here so that our images don't get scaled wildly - #if (defined __ORBIS__ || defined _DURANGO || defined _WINDOWS64 ) + #if (defined __ORBIS__ || defined _DURANGO ) *width = 96; *height = 96; + #elif _WINDOWS64 + if(ui.getScreenWidth() >= 1920) + { + *width = 96; + *height = 96; + } + else + { + *width = 64; + *height = 64; + } #else *width = 64; *height = 64; diff --git a/Minecraft.Client/Common/UI/UIScene.cpp b/Minecraft.Client/Common/UI/UIScene.cpp index 105a7fed..1d34195f 100644 --- a/Minecraft.Client/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Common/UI/UIScene.cpp @@ -285,17 +285,17 @@ void UIScene::loadMovie() moviePath.append(L"Vita.swf"); m_loadedResolution = eSceneResolution_Vita; #elif defined _WINDOWS64 - if(ui.getScreenHeight() >= 1080) + if(ui.getScreenWidth() >= 1920) { moviePath.append(L"1080.swf"); m_loadedResolution = eSceneResolution_1080; } - else if(ui.getScreenHeight() >= 720) + else if(ui.getScreenWidth() >= 1280) { moviePath.append(L"720.swf"); m_loadedResolution = eSceneResolution_720; } - else if(ui.getScreenHeight() >= 544) + else if(ui.getScreenWidth() >= 960) { moviePath.append(L"Vita.swf"); m_loadedResolution = eSceneResolution_Vita; diff --git a/Minecraft.Client/Minecraft.Client.vcxproj b/Minecraft.Client/Minecraft.Client.vcxproj index 62853624..34d9a696 100644 --- a/Minecraft.Client/Minecraft.Client.vcxproj +++ b/Minecraft.Client/Minecraft.Client.vcxproj @@ -16163,6 +16163,43 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CUtrue true + + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true true diff --git a/Minecraft.Client/Minecraft.Client.vcxproj.filters b/Minecraft.Client/Minecraft.Client.vcxproj.filters index cbd68eda..ab858593 100644 --- a/Minecraft.Client/Minecraft.Client.vcxproj.filters +++ b/Minecraft.Client/Minecraft.Client.vcxproj.filters @@ -1369,9 +1369,6 @@ Xbox\GameConfig - - Xbox\Source Files - net\minecraft\server\network @@ -2968,9 +2965,6 @@ Common\Source Files\UI\Scenes\Debug - - Xbox\Source Files - Common\Source Files\Network @@ -3793,6 +3787,15 @@ PSVita + + Windows64\Source Files + + + Xbox + + + Xbox + @@ -4236,9 +4239,6 @@ Source Files - - Xbox\Source Files - Xbox\Source Files @@ -5202,9 +5202,6 @@ Common\Source Files\UI\Scenes\Debug - - Xbox\Source Files - Common\Source Files\Network @@ -5937,6 +5934,12 @@ PSVita + + Xbox + + + Xbox + diff --git a/Minecraft.Client/PSVita/PSVitaExtras/OldSdk.h b/Minecraft.Client/PSVita/PSVitaExtras/OldSdk.h index 2739b5f6..3c97a951 100644 --- a/Minecraft.Client/PSVita/PSVitaExtras/OldSdk.h +++ b/Minecraft.Client/PSVita/PSVitaExtras/OldSdk.h @@ -1,6 +1,4 @@ #pragma once -#ifndef _OLD_SDK_H -#define _OLD_SDK_H 1 #include #include @@ -48,6 +46,4 @@ int sceNpBasicGetRequestedFriendRequestEntryCount(SceSize *count); int sceNpBasicGetRequestedFriendRequestEntries(unsigned int startIndex, SceNpId *entries, SceSize numEntries, SceSize *retrieved); SceInt32 sceAppUtilAppEventParseNpBasicJoinablePresence(const SceAppUtilAppEventParam *eventParam, SceAppUtilNpBasicJoinablePresenceParam *param); -#define SCE_APPUTIL_APPEVENT_TYPE_NP_BASIC_JOINABLE_PRESENCE (3) - -#endif \ No newline at end of file +#define SCE_APPUTIL_APPEVENT_TYPE_NP_BASIC_JOINABLE_PRESENCE (3) \ No newline at end of file diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index 0aae8055..b62ada18 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -37,6 +37,7 @@ #include "..\..\Minecraft.World\compression.h" #include "..\..\Minecraft.World\OldChunkStorage.h" +#include "Windows64_Minecraft.h" #include "Xbox/resource.h" HINSTANCE hMyInst; @@ -468,15 +469,16 @@ HRESULT InitDevice() RECT rc; GetClientRect( g_hWnd, &rc ); - UINT width = rc.right - rc.left; - UINT height = rc.bottom - rc.top; -//app.DebugPrintf("width: %d, height: %d\n", width, height); - width = g_iScreenWidth; - height = g_iScreenHeight; -app.DebugPrintf("width: %d, height: %d\n", width, height); + g_iScreenWidth = rc.right - rc.left; + g_iScreenHeight = rc.bottom - rc.top; + + //str1k3r - stop hardcoding size and just use the screens actual size + UINT width = g_iScreenWidth; + UINT height = g_iScreenHeight; UINT createDeviceFlags = 0; #ifdef _DEBUG + app.DebugPrintf("Screen Width: %d, Screen Height: %d\n", width, height); createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG; #endif @@ -611,23 +613,39 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, { if(lpCmdLine[0] == '1') { - g_iScreenWidth = 1280; - g_iScreenHeight = 720; + // 2160p + g_iScreenWidth = 3840; + g_iScreenHeight = 2160; } else if(lpCmdLine[0] == '2') { + // 1440p + g_iScreenWidth = 2560; + g_iScreenHeight = 1440; + } + else if (lpCmdLine[0] == '3') + { + // 1080p + g_iScreenWidth = 1920; + g_iScreenHeight = 1080; + } + else if(lpCmdLine[0] == '4') + { + // 720p + g_iScreenWidth = 1280; + g_iScreenHeight = 720; + } + else if(lpCmdLine[0] == '5') + { + // 480p g_iScreenWidth = 640; g_iScreenHeight = 480; } - else if(lpCmdLine[0] == '3') + else if(lpCmdLine[0] == '6') { - // Vita - g_iScreenWidth = 720; - g_iScreenHeight = 408; - - // Vita native - //g_iScreenWidth = 960; - //g_iScreenHeight = 544; + // Vita Native, 544p + g_iScreenWidth = 960; + g_iScreenHeight = 544; } } diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.h b/Minecraft.Client/Windows64/Windows64_Minecraft.h new file mode 100644 index 00000000..1e62aedf --- /dev/null +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.h @@ -0,0 +1,4 @@ +#pragma once + +extern int g_iScreenWidth; +extern int g_iScreenHeight; \ No newline at end of file From 0031cae3e313c20ee8e7f258081a3ed752349892 Mon Sep 17 00:00:00 2001 From: str1k3r <115313679+S1l3ntStr1ke87@users.noreply.github.com> Date: Tue, 11 Aug 2026 18:45:04 -0400 Subject: [PATCH 3/5] fix: m_fScreen Width & Height missing .0f for 8th gen consoles --- Minecraft.Client/Common/UI/UIController.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index 781d0f37..ada6ae3d 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -182,8 +182,8 @@ UIController::UIController() // 4J Stu - This is a bit of a hack until we change the Minecraft initialisation to store the proper screen size for other platforms #if defined _DURANGO || defined __ORBIS__ - m_fScreenWidth = 1920; - m_fScreenHeight = 1080; + m_fScreenWidth = 1920.0f; + m_fScreenHeight = 1080.0f; m_bScreenWidthSetup = true; #elif _WINDOWS64 m_fScreenWidth = g_iScreenWidth; From 81d41a6a04bf933027b55171064462bf5972001d Mon Sep 17 00:00:00 2001 From: str1k3r <115313679+S1l3ntStr1ke87@users.noreply.github.com> Date: Tue, 11 Aug 2026 20:27:34 -0400 Subject: [PATCH 4/5] feat(Windows64): use screen size instead of window size, fix exit game, fix oprhaned saves on exit without saving --- Minecraft.Client/Common/UI/UIScene_MainMenu.cpp | 5 +---- Minecraft.Client/MinecraftServer.cpp | 3 +++ Minecraft.Client/Windows64/Windows64_App.cpp | 1 + Minecraft.Client/Windows64/Windows64_Minecraft.cpp | 10 +++++----- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp b/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp index 0603360a..19505e73 100644 --- a/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp @@ -359,7 +359,7 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId) m_eAction=eAction_RunUnlockOrDLC; signInReturnedFunc = &UIScene_MainMenu::UnlockFullGame_SignInReturned; break; -#if defined _XBOX +#if defined(_XBOX) || defined(_WINDOWS64) case eControl_Exit: if( ProfileManager.IsFullVersion() ) { @@ -370,9 +370,6 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId) } else { -#ifdef _XBOX_ONE - ui.ShowPlayerDisplayname(true); -#endif ui.NavigateToScene(primaryPad,eUIScene_TrialExitUpsell); } break; diff --git a/Minecraft.Client/MinecraftServer.cpp b/Minecraft.Client/MinecraftServer.cpp index 026c3fa4..1a35b6fd 100644 --- a/Minecraft.Client/MinecraftServer.cpp +++ b/Minecraft.Client/MinecraftServer.cpp @@ -753,10 +753,13 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring if( s_bServerHalted || !g_NetworkManager.IsInSession() ) return false; + //str1k3r - if used on windows64 a orphaned save gets left behind if you exit without saving +#ifndef _WINDOWS64 if( levels[0]->isNew || levels[1]->isNew || levels[2]->isNew ) { levels[0]->saveToDisc(mcprogress, false); } +#endif if( s_bServerHalted || !g_NetworkManager.IsInSession() ) return false; diff --git a/Minecraft.Client/Windows64/Windows64_App.cpp b/Minecraft.Client/Windows64/Windows64_App.cpp index 3cc0d21a..ad8aa6e7 100644 --- a/Minecraft.Client/Windows64/Windows64_App.cpp +++ b/Minecraft.Client/Windows64/Windows64_App.cpp @@ -26,6 +26,7 @@ void CConsoleMinecraftApp::StoreLaunchData() } void CConsoleMinecraftApp::ExitGame() { + ExitProcess(0); } void CConsoleMinecraftApp::FatalLoadError() { diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index b62ada18..6d80256a 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -406,7 +406,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) return FALSE; } - ShowWindow(g_hWnd, nCmdShow); + ShowWindow(g_hWnd, (nCmdShow != SW_HIDE) ? SW_SHOWMAXIMIZED : nCmdShow); UpdateWindow(g_hWnd); return TRUE; @@ -467,10 +467,9 @@ HRESULT InitDevice() { HRESULT hr = S_OK; - RECT rc; - GetClientRect( g_hWnd, &rc ); - g_iScreenWidth = rc.right - rc.left; - g_iScreenHeight = rc.bottom - rc.top; + //str1k3r - use screen size instead of window size + g_iScreenWidth = GetSystemMetrics(SM_CXSCREEN); + g_iScreenHeight = GetSystemMetrics(SM_CYSCREEN); //str1k3r - stop hardcoding size and just use the screens actual size UINT width = g_iScreenWidth; @@ -546,6 +545,7 @@ HRESULT InitDevice() hr = g_pd3dDevice->CreateTexture2D(&descDepth, NULL, &g_pDepthStencilBuffer); D3D11_DEPTH_STENCIL_VIEW_DESC descDSView; + ZeroMemory(&descDSView, sizeof(descDSView)); descDSView.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; descDSView.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D; descDSView.Texture2D.MipSlice = 0; From bd0cc59a546e97039d914c6a2d7469d5373b7edd Mon Sep 17 00:00:00 2001 From: str1k3r <115313679+S1l3ntStr1ke87@users.noreply.github.com> Date: Tue, 11 Aug 2026 21:25:56 -0400 Subject: [PATCH 5/5] chore: update .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 76482abb..92197f16 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,5 @@ *.sdf *.opensdf *.v11.suo -*.vcxproj.user \ No newline at end of file +*.vcxproj.user +*.aps \ No newline at end of file