feat(Windows64): fetch screen size instead of hardcoding & cleanup project filter

This commit is contained in:
str1k3r committed 2026-08-11 18:36:29 -04:00
1 parent df2a4d85ef
commit 251cd8e304
7 files changed
+122 -45

No files matched your search

+28 -9
View File
@@ -13,6 +13,8 @@
#include "UIFontData.h" #include "UIFontData.h"
#ifdef __PSVITA__ #ifdef __PSVITA__
#include <message_dialog.h> #include <message_dialog.h>
#elif _WINDOWS64
#include "Windows64\Windows64_Minecraft.h"
#endif #endif
// 4J Stu - Enable this to override the Iggy Allocator // 4J Stu - Enable this to override the Iggy Allocator
@@ -179,10 +181,17 @@ UIController::UIController()
#endif #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 // 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_fScreenWidth = 1920;
m_fScreenHeight = 1080.0f; m_fScreenHeight = 1080;
m_bScreenWidthSetup = true; 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 #else
m_fScreenWidth = 1280.0f; m_fScreenWidth = 1280.0f;
m_fScreenHeight = 720.0f; m_fScreenHeight = 720.0f;
@@ -316,7 +325,7 @@ UIController::EFont UIController::getFontForLanguage(int language)
switch(language) switch(language)
{ {
case XC_LANGUAGE_JAPANESE: return eFont_Japanese; case XC_LANGUAGE_JAPANESE: return eFont_Japanese;
#ifdef _DURANGO #if defined(_DURANGO) || defined(_WINDOWS64)
case XC_LANGUAGE_SCHINESE: return eFont_SimpChinese; case XC_LANGUAGE_SCHINESE: return eFont_SimpChinese;
#endif #endif
case XC_LANGUAGE_TCHINESE: return eFont_TradChinese; case XC_LANGUAGE_TCHINESE: return eFont_TradChinese;
@@ -331,12 +340,11 @@ UITTFFont *UIController::createFont(EFont fontLanguage)
{ {
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) #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_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_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 case eFont_Korean: return new UITTFFont("Mojangles_TTF_koKR", "Common/Media/font/KOR/candadite2.ttf", 0x203B); // KOR
#else #else
case eFont_Japanese: return new UITTFFont("Mojangles_TTF_jaJP", "Common/Media/font/JPN/DFGMaruGothic-Md.ttf", 0x2022); // JPN 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 case eFont_SimpChinese: return new UITTFFont("Mojangled_TTF_cnCN", "Common/Media/font/CHS/MSYH.ttf", 0x2022); // CHS
#endif #endif
case eFont_TradChinese: return new UITTFFont("Mojangles_TTF_cnTD", "Common/Media/font/CHT/DFHeiMedium-B5.ttf", 0x2022); // CHT 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__ #elif defined __PSVITA__
platformSkinPath = L"skinVita.swf"; platformSkinPath = L"skinVita.swf";
#elif defined _WINDOWS64 #elif defined _WINDOWS64
if(m_fScreenHeight >= 1080.0f) if(m_fScreenWidth >= 1920.0f)
{ {
platformSkinPath = L"skinHDWin.swf"; 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 // 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. // 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_Platform] = loadSkin(platformSkinPath, L"platformskinHD.swf");
m_iggyLibraries[eLibrary_GraphicsDefault] = loadSkin(L"skinHDGraphics.swf", L"skinHDGraphics.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 // 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 // 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; *width = 96;
*height = 96; *height = 96;
#elif _WINDOWS64
if(ui.getScreenWidth() >= 1920)
{
*width = 96;
*height = 96;
}
else
{
*width = 64;
*height = 64;
}
#else #else
*width = 64; *width = 64;
*height = 64; *height = 64;
+3 -3
View File
@@ -285,17 +285,17 @@ void UIScene::loadMovie()
moviePath.append(L"Vita.swf"); moviePath.append(L"Vita.swf");
m_loadedResolution = eSceneResolution_Vita; m_loadedResolution = eSceneResolution_Vita;
#elif defined _WINDOWS64 #elif defined _WINDOWS64
if(ui.getScreenHeight() >= 1080) if(ui.getScreenWidth() >= 1920)
{ {
moviePath.append(L"1080.swf"); moviePath.append(L"1080.swf");
m_loadedResolution = eSceneResolution_1080; m_loadedResolution = eSceneResolution_1080;
} }
else if(ui.getScreenHeight() >= 720) else if(ui.getScreenWidth() >= 1280)
{ {
moviePath.append(L"720.swf"); moviePath.append(L"720.swf");
m_loadedResolution = eSceneResolution_720; m_loadedResolution = eSceneResolution_720;
} }
else if(ui.getScreenHeight() >= 544) else if(ui.getScreenWidth() >= 960)
{ {
moviePath.append(L"Vita.swf"); moviePath.append(L"Vita.swf");
m_loadedResolution = eSceneResolution_Vita; m_loadedResolution = eSceneResolution_Vita;
+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)'=='Release|ORBIS'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|ORBIS'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|ORBIS'">true</ExcludedFromBuild>
</ClInclude> </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"> <ClInclude Include="Windows64\Windows64_UIController.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Durango'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Durango'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Durango'">true</ExcludedFromBuild>
@@ -1369,9 +1369,6 @@
<ClInclude Include="Xbox\GameConfig\Minecraft.spa.h"> <ClInclude Include="Xbox\GameConfig\Minecraft.spa.h">
<Filter>Xbox\GameConfig</Filter> <Filter>Xbox\GameConfig</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Xbox\Xbox_App.h">
<Filter>Xbox\Source Files</Filter>
</ClInclude>
<ClInclude Include="PlayerConnection.h"> <ClInclude Include="PlayerConnection.h">
<Filter>net\minecraft\server\network</Filter> <Filter>net\minecraft\server\network</Filter>
</ClInclude> </ClInclude>
@@ -2968,9 +2965,6 @@
<ClInclude Include="Common\UI\UIScene_DebugOverlay.h"> <ClInclude Include="Common\UI\UIScene_DebugOverlay.h">
<Filter>Common\Source Files\UI\Scenes\Debug</Filter> <Filter>Common\Source Files\UI\Scenes\Debug</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Xbox\Xbox_UIController.h">
<Filter>Xbox\Source Files</Filter>
</ClInclude>
<ClInclude Include="Common\Network\SessionInfo.h"> <ClInclude Include="Common\Network\SessionInfo.h">
<Filter>Common\Source Files\Network</Filter> <Filter>Common\Source Files\Network</Filter>
</ClInclude> </ClInclude>
@@ -3793,6 +3787,15 @@
<ClInclude Include="PSVita\PSVitaExtras\OldSdk.h"> <ClInclude Include="PSVita\PSVitaExtras\OldSdk.h">
<Filter>PSVita</Filter> <Filter>PSVita</Filter>
</ClInclude> </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>
<ItemGroup> <ItemGroup>
<ClCompile Include="stdafx.cpp"> <ClCompile Include="stdafx.cpp">
@@ -4236,9 +4239,6 @@
<ClCompile Include="BufferedImage.cpp"> <ClCompile Include="BufferedImage.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Xbox\Xbox_App.cpp">
<Filter>Xbox\Source Files</Filter>
</ClCompile>
<ClCompile Include="Xbox\Xbox_Minecraft.cpp"> <ClCompile Include="Xbox\Xbox_Minecraft.cpp">
<Filter>Xbox\Source Files</Filter> <Filter>Xbox\Source Files</Filter>
</ClCompile> </ClCompile>
@@ -5202,9 +5202,6 @@
<ClCompile Include="Common\UI\UIScene_DebugOverlay.cpp"> <ClCompile Include="Common\UI\UIScene_DebugOverlay.cpp">
<Filter>Common\Source Files\UI\Scenes\Debug</Filter> <Filter>Common\Source Files\UI\Scenes\Debug</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Xbox\Xbox_UIController.cpp">
<Filter>Xbox\Source Files</Filter>
</ClCompile>
<ClCompile Include="Common\Network\GameNetworkManager.cpp"> <ClCompile Include="Common\Network\GameNetworkManager.cpp">
<Filter>Common\Source Files\Network</Filter> <Filter>Common\Source Files\Network</Filter>
</ClCompile> </ClCompile>
@@ -5937,6 +5934,12 @@
<ClCompile Include="PSVita\PSVitaExtras\OldSdk.cpp"> <ClCompile Include="PSVita\PSVitaExtras\OldSdk.cpp">
<Filter>PSVita</Filter> <Filter>PSVita</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Xbox\Xbox_UIController.cpp">
<Filter>Xbox</Filter>
</ClCompile>
<ClCompile Include="Xbox\Xbox_App.cpp">
<Filter>Xbox</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Library Include="Xbox\4JLibs\libs\4J_Render_d.lib"> <Library Include="Xbox\4JLibs\libs\4J_Render_d.lib">
@@ -1,6 +1,4 @@
#pragma once #pragma once
#ifndef _OLD_SDK_H
#define _OLD_SDK_H 1
#include <np.h> #include <np.h>
#include <np/np_basic.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); int sceNpBasicGetRequestedFriendRequestEntries(unsigned int startIndex, SceNpId *entries, SceSize numEntries, SceSize *retrieved);
SceInt32 sceAppUtilAppEventParseNpBasicJoinablePresence(const SceAppUtilAppEventParam *eventParam, SceAppUtilNpBasicJoinablePresenceParam *param); SceInt32 sceAppUtilAppEventParseNpBasicJoinablePresence(const SceAppUtilAppEventParam *eventParam, SceAppUtilNpBasicJoinablePresenceParam *param);
#define SCE_APPUTIL_APPEVENT_TYPE_NP_BASIC_JOINABLE_PRESENCE (3) #define SCE_APPUTIL_APPEVENT_TYPE_NP_BASIC_JOINABLE_PRESENCE (3)
#endif
@@ -37,6 +37,7 @@
#include "..\..\Minecraft.World\compression.h" #include "..\..\Minecraft.World\compression.h"
#include "..\..\Minecraft.World\OldChunkStorage.h" #include "..\..\Minecraft.World\OldChunkStorage.h"
#include "Windows64_Minecraft.h"
#include "Xbox/resource.h" #include "Xbox/resource.h"
HINSTANCE hMyInst; HINSTANCE hMyInst;
@@ -468,15 +469,16 @@ HRESULT InitDevice()
RECT rc; RECT rc;
GetClientRect( g_hWnd, &rc ); GetClientRect( g_hWnd, &rc );
UINT width = rc.right - rc.left; g_iScreenWidth = rc.right - rc.left;
UINT height = rc.bottom - rc.top; g_iScreenHeight = rc.bottom - rc.top;
//app.DebugPrintf("width: %d, height: %d\n", width, height);
width = g_iScreenWidth; //str1k3r - stop hardcoding size and just use the screens actual size
height = g_iScreenHeight; UINT width = g_iScreenWidth;
app.DebugPrintf("width: %d, height: %d\n", width, height); UINT height = g_iScreenHeight;
UINT createDeviceFlags = 0; UINT createDeviceFlags = 0;
#ifdef _DEBUG #ifdef _DEBUG
app.DebugPrintf("Screen Width: %d, Screen Height: %d\n", width, height);
createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG; createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG;
#endif #endif
@@ -611,23 +613,39 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
{ {
if(lpCmdLine[0] == '1') if(lpCmdLine[0] == '1')
{ {
g_iScreenWidth = 1280; // 2160p
g_iScreenHeight = 720; g_iScreenWidth = 3840;
g_iScreenHeight = 2160;
} }
else if(lpCmdLine[0] == '2') 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_iScreenWidth = 640;
g_iScreenHeight = 480; g_iScreenHeight = 480;
} }
else if(lpCmdLine[0] == '3') else if(lpCmdLine[0] == '6')
{ {
// Vita // Vita Native, 544p
g_iScreenWidth = 720; g_iScreenWidth = 960;
g_iScreenHeight = 408; g_iScreenHeight = 544;
// Vita native
//g_iScreenWidth = 960;
//g_iScreenHeight = 544;
} }
} }
@@ -0,0 +1,4 @@
#pragma once
extern int g_iScreenWidth;
extern int g_iScreenHeight;