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
@@ -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;
}
}