merge upstream

This commit is contained in:
2026-08-12 04:15:31 +00:00
12 changed files with 138 additions and 54 deletions
+2 -1
View File
@@ -38,4 +38,5 @@
*.sdf
*.opensdf
*.v11.suo
*.vcxproj.user
*.vcxproj.user
*.aps
+25 -6
View File
@@ -13,6 +13,8 @@
#include "UIFontData.h"
#ifdef __PSVITA__
#include <message_dialog.h>
#elif _WINDOWS64
#include "Windows64\Windows64_Minecraft.h"
#endif
// 4J Stu - Enable this to override the Iggy Allocator
@@ -189,10 +191,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__
#if defined _DURANGO || defined __ORBIS__
m_fScreenWidth = 1920.0f;
m_fScreenHeight = 1080.0f;
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;
@@ -340,7 +349,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;
@@ -355,12 +364,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
@@ -628,7 +636,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";
controlTooltipsPath = GetControlTooltipsPath();
@@ -661,7 +669,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");
@@ -1568,6 +1576,17 @@ GDrawTexture * RADLINK UIController::TextureSubstitutionCreateCallback ( void *
#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;
+3 -3
View File
@@ -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;
@@ -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);
@@ -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;
+37
View File
@@ -16163,6 +16163,43 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ORBIS'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|ORBIS'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="Windows64\Windows64_Minecraft.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugContentPackage|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|ORBIS'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|ORBIS'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|ORBIS'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|ORBIS'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ORBIS'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ORBIS'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|ORBIS'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|PS3'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|PS3'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|PS3'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="Windows64\Windows64_UIController.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Durango'">true</ExcludedFromBuild>
@@ -1369,9 +1369,6 @@
<ClInclude Include="Xbox\GameConfig\Minecraft.spa.h">
<Filter>Xbox\GameConfig</Filter>
</ClInclude>
<ClInclude Include="Xbox\Xbox_App.h">
<Filter>Xbox\Source Files</Filter>
</ClInclude>
<ClInclude Include="PlayerConnection.h">
<Filter>net\minecraft\server\network</Filter>
</ClInclude>
@@ -2968,9 +2965,6 @@
<ClInclude Include="Common\UI\UIScene_DebugOverlay.h">
<Filter>Common\Source Files\UI\Scenes\Debug</Filter>
</ClInclude>
<ClInclude Include="Xbox\Xbox_UIController.h">
<Filter>Xbox\Source Files</Filter>
</ClInclude>
<ClInclude Include="Common\Network\SessionInfo.h">
<Filter>Common\Source Files\Network</Filter>
</ClInclude>
@@ -3793,6 +3787,15 @@
<ClInclude Include="PSVita\PSVitaExtras\OldSdk.h">
<Filter>PSVita</Filter>
</ClInclude>
<ClInclude Include="Windows64\Windows64_Minecraft.h">
<Filter>Windows64\Source Files</Filter>
</ClInclude>
<ClInclude Include="Xbox\Xbox_UIController.h">
<Filter>Xbox</Filter>
</ClInclude>
<ClInclude Include="Xbox\Xbox_App.h">
<Filter>Xbox</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
@@ -4236,9 +4239,6 @@
<ClCompile Include="BufferedImage.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Xbox\Xbox_App.cpp">
<Filter>Xbox\Source Files</Filter>
</ClCompile>
<ClCompile Include="Xbox\Xbox_Minecraft.cpp">
<Filter>Xbox\Source Files</Filter>
</ClCompile>
@@ -5202,9 +5202,6 @@
<ClCompile Include="Common\UI\UIScene_DebugOverlay.cpp">
<Filter>Common\Source Files\UI\Scenes\Debug</Filter>
</ClCompile>
<ClCompile Include="Xbox\Xbox_UIController.cpp">
<Filter>Xbox\Source Files</Filter>
</ClCompile>
<ClCompile Include="Common\Network\GameNetworkManager.cpp">
<Filter>Common\Source Files\Network</Filter>
</ClCompile>
@@ -5937,6 +5934,12 @@
<ClCompile Include="PSVita\PSVitaExtras\OldSdk.cpp">
<Filter>PSVita</Filter>
</ClCompile>
<ClCompile Include="Xbox\Xbox_UIController.cpp">
<Filter>Xbox</Filter>
</ClCompile>
<ClCompile Include="Xbox\Xbox_App.cpp">
<Filter>Xbox</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Library Include="Xbox\4JLibs\libs\4J_Render_d.lib">
+3
View File
@@ -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;
@@ -1,6 +1,4 @@
#pragma once
#ifndef _OLD_SDK_H
#define _OLD_SDK_H 1
#include <np.h>
#include <np/np_basic.h>
@@ -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
#define SCE_APPUTIL_APPEVENT_TYPE_NP_BASIC_JOINABLE_PRESENCE (3)
@@ -26,6 +26,7 @@ void CConsoleMinecraftApp::StoreLaunchData()
}
void CConsoleMinecraftApp::ExitGame()
{
ExitProcess(0);
}
void CConsoleMinecraftApp::FatalLoadError()
{
@@ -37,6 +37,7 @@
#include "..\..\Minecraft.World\compression.h"
#include "..\..\Minecraft.World\OldChunkStorage.h"
#include "Windows64_Minecraft.h"
#include "Xbox/resource.h"
HINSTANCE hMyInst;
@@ -405,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;
@@ -466,17 +467,17 @@ HRESULT InitDevice()
{
HRESULT hr = S_OK;
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);
//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;
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
@@ -544,6 +545,7 @@ app.DebugPrintf("width: %d, height: %d\n", width, height);
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;
@@ -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;
}
}
@@ -0,0 +1,4 @@
#pragma once
extern int g_iScreenWidth;
extern int g_iScreenHeight;