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

This commit is contained in:
2026-08-11 18:36:29 -04:00
parent df2a4d85ef
commit 251cd8e304
7 changed files with 122 additions and 45 deletions
+28 -9
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
@@ -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;
+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;
+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">
@@ -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)
@@ -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;
}
}
@@ -0,0 +1,4 @@
#pragma once
extern int g_iScreenWidth;
extern int g_iScreenHeight;