merge upstream

This commit is contained in:
2026-08-13 03:56:02 +00:00
3 changed files with 24 additions and 16 deletions
+1 -1
View File
@@ -200,7 +200,7 @@ UIController::UIController()
m_fScreenHeight = g_iScreenHeight;
m_bScreenWidthSetup = true;
#ifdef _DEBUG
app.DebugPrintf("[UIController] Width: %d, Height: %d\n", m_fScreenWidth, m_fScreenHeight);
app.DebugPrintf("[UIController] Width: %d, Height: %d\n", static_cast<int>(m_fScreenWidth), static_cast<int>(m_fScreenHeight));
#endif
#else
m_fScreenWidth = 1280.0f;
@@ -489,22 +489,22 @@ HRESULT InitDevice()
HRESULT hr = S_OK;
//str1k3r - use screen size instead of window size & detect if its widescreen or not
#ifndef _DEBUG
HMONITOR hMonitor = MonitorFromWindow(g_hWnd, MONITOR_DEFAULTTONEAREST);
MONITORINFO monitorInfo = { sizeof(MONITORINFO) };
if (GetMonitorInfo(hMonitor, &monitorInfo))
if (!g_bResolutionSetByCMD)
{
g_iScreenWidth = monitorInfo.rcMonitor.right - monitorInfo.rcMonitor.left;
g_iScreenHeight = monitorInfo.rcMonitor.bottom - monitorInfo.rcMonitor.top;
}
else
{
g_iScreenWidth = GetSystemMetrics(SM_CXSCREEN);
g_iScreenHeight = GetSystemMetrics(SM_CYSCREEN);
}
g_bWidescreen = (g_iScreenHeight > 0 && ((double)g_iScreenWidth / g_iScreenHeight) >= 1.59) ? TRUE : FALSE;
#endif
HMONITOR hMonitor = MonitorFromWindow(g_hWnd, MONITOR_DEFAULTTONEAREST);
MONITORINFO monitorInfo = { sizeof(MONITORINFO) };
if (GetMonitorInfo(hMonitor, &monitorInfo))
{
g_iScreenWidth = monitorInfo.rcMonitor.right - monitorInfo.rcMonitor.left;
g_iScreenHeight = monitorInfo.rcMonitor.bottom - monitorInfo.rcMonitor.top;
}
else
{
g_iScreenWidth = GetSystemMetrics(SM_CXSCREEN);
g_iScreenHeight = GetSystemMetrics(SM_CYSCREEN);
}
g_bWidescreen = (g_iScreenHeight > 0 && ((double)g_iScreenWidth / g_iScreenHeight) >= 1.59) ? TRUE : FALSE;
}
//str1k3r - stop hardcoding size and just use the screens actual size
UINT width = g_iScreenWidth;
@@ -651,36 +651,42 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
// 2160p
g_iScreenWidth = 3840;
g_iScreenHeight = 2160;
g_bResolutionSetByCMD = TRUE;
}
else if(lpCmdLine[0] == '2')
{
// 1440p
g_iScreenWidth = 2560;
g_iScreenHeight = 1440;
g_bResolutionSetByCMD = TRUE;
}
else if (lpCmdLine[0] == '3')
{
// 1080p
g_iScreenWidth = 1920;
g_iScreenHeight = 1080;
g_bResolutionSetByCMD = TRUE;
}
else if(lpCmdLine[0] == '4')
{
// 720p
g_iScreenWidth = 1280;
g_iScreenHeight = 720;
g_bResolutionSetByCMD = TRUE;
}
else if(lpCmdLine[0] == '5')
{
// 480p
g_iScreenWidth = 640;
g_iScreenHeight = 480;
g_bResolutionSetByCMD = TRUE;
}
else if(lpCmdLine[0] == '6')
{
// Vita Native, 544p
g_iScreenWidth = 960;
g_iScreenHeight = 544;
g_bResolutionSetByCMD = TRUE;
}
}
@@ -7,6 +7,8 @@ extern BOOL g_bWidescreen;
extern int g_iScreenWidth;
extern int g_iScreenHeight;
BOOL g_bResolutionSetByCMD = FALSE;
extern ID3D11Device* g_pd3dDevice;
void CleanupDevice();