fix: fix resolution detection (#133)

* fix: fix UI skin/scene resolution mismatch and readd screen resolution detection

* fix: fix build in vs2022
This commit is contained in:
daoge
2026-03-02 23:52:18 +08:00
committed by GitHub
parent 2145ada7ce
commit afa4efbc85
5 changed files with 11 additions and 18 deletions

View File

@@ -4,6 +4,7 @@
#include "stdafx.h"
#include <assert.h>
#include <ShellScalingApi.h>
#include "GameConfig\Minecraft.spa.h"
#include "..\MinecraftServer.h"
#include "..\LocalPlayer.h"
@@ -716,20 +717,10 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
/*
// Declare DPI awareness so GetSystemMetrics returns physical pixels
SetProcessDPIAware();
SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
g_iScreenWidth = GetSystemMetrics(SM_CXSCREEN);
g_iScreenHeight = GetSystemMetrics(SM_CYSCREEN);
{
char buf[128];
sprintf(buf, "Screen resolution: %dx%d\n", g_iScreenWidth, g_iScreenHeight);
OutputDebugStringA(buf);
}
*/
if(lpCmdLine)
{
if(lpCmdLine[0] == '1')