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