merge upstream

This commit is contained in:
str1k3r committed 2026-08-13 03:56:02 +00:00
commit 9dcfd96a1b
3 files changed
+24 -16

No files matched your search

+1 -1
View File
@@ -200,7 +200,7 @@ UIController::UIController()
m_fScreenHeight = g_iScreenHeight; m_fScreenHeight = g_iScreenHeight;
m_bScreenWidthSetup = true; m_bScreenWidthSetup = true;
#ifdef _DEBUG #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 #endif
#else #else
m_fScreenWidth = 1280.0f; m_fScreenWidth = 1280.0f;
@@ -489,22 +489,22 @@ HRESULT InitDevice()
HRESULT hr = S_OK; HRESULT hr = S_OK;
//str1k3r - use screen size instead of window size & detect if its widescreen or not //str1k3r - use screen size instead of window size & detect if its widescreen or not
#ifndef _DEBUG if (!g_bResolutionSetByCMD)
HMONITOR hMonitor = MonitorFromWindow(g_hWnd, MONITOR_DEFAULTTONEAREST);
MONITORINFO monitorInfo = { sizeof(MONITORINFO) };
if (GetMonitorInfo(hMonitor, &monitorInfo))
{ {
g_iScreenWidth = monitorInfo.rcMonitor.right - monitorInfo.rcMonitor.left; HMONITOR hMonitor = MonitorFromWindow(g_hWnd, MONITOR_DEFAULTTONEAREST);
g_iScreenHeight = monitorInfo.rcMonitor.bottom - monitorInfo.rcMonitor.top; MONITORINFO monitorInfo = { sizeof(MONITORINFO) };
} if (GetMonitorInfo(hMonitor, &monitorInfo))
else {
{ g_iScreenWidth = monitorInfo.rcMonitor.right - monitorInfo.rcMonitor.left;
g_iScreenWidth = GetSystemMetrics(SM_CXSCREEN); g_iScreenHeight = monitorInfo.rcMonitor.bottom - monitorInfo.rcMonitor.top;
g_iScreenHeight = GetSystemMetrics(SM_CYSCREEN); }
} else
{
g_bWidescreen = (g_iScreenHeight > 0 && ((double)g_iScreenWidth / g_iScreenHeight) >= 1.59) ? TRUE : FALSE; g_iScreenWidth = GetSystemMetrics(SM_CXSCREEN);
#endif 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 //str1k3r - stop hardcoding size and just use the screens actual size
UINT width = g_iScreenWidth; UINT width = g_iScreenWidth;
@@ -651,36 +651,42 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
// 2160p // 2160p
g_iScreenWidth = 3840; g_iScreenWidth = 3840;
g_iScreenHeight = 2160; g_iScreenHeight = 2160;
g_bResolutionSetByCMD = TRUE;
} }
else if(lpCmdLine[0] == '2') else if(lpCmdLine[0] == '2')
{ {
// 1440p // 1440p
g_iScreenWidth = 2560; g_iScreenWidth = 2560;
g_iScreenHeight = 1440; g_iScreenHeight = 1440;
g_bResolutionSetByCMD = TRUE;
} }
else if (lpCmdLine[0] == '3') else if (lpCmdLine[0] == '3')
{ {
// 1080p // 1080p
g_iScreenWidth = 1920; g_iScreenWidth = 1920;
g_iScreenHeight = 1080; g_iScreenHeight = 1080;
g_bResolutionSetByCMD = TRUE;
} }
else if(lpCmdLine[0] == '4') else if(lpCmdLine[0] == '4')
{ {
// 720p // 720p
g_iScreenWidth = 1280; g_iScreenWidth = 1280;
g_iScreenHeight = 720; g_iScreenHeight = 720;
g_bResolutionSetByCMD = TRUE;
} }
else if(lpCmdLine[0] == '5') else if(lpCmdLine[0] == '5')
{ {
// 480p // 480p
g_iScreenWidth = 640; g_iScreenWidth = 640;
g_iScreenHeight = 480; g_iScreenHeight = 480;
g_bResolutionSetByCMD = TRUE;
} }
else if(lpCmdLine[0] == '6') else if(lpCmdLine[0] == '6')
{ {
// Vita Native, 544p // Vita Native, 544p
g_iScreenWidth = 960; g_iScreenWidth = 960;
g_iScreenHeight = 544; g_iScreenHeight = 544;
g_bResolutionSetByCMD = TRUE;
} }
} }
@@ -7,6 +7,8 @@ extern BOOL g_bWidescreen;
extern int g_iScreenWidth; extern int g_iScreenWidth;
extern int g_iScreenHeight; extern int g_iScreenHeight;
BOOL g_bResolutionSetByCMD = FALSE;
extern ID3D11Device* g_pd3dDevice; extern ID3D11Device* g_pd3dDevice;
void CleanupDevice(); void CleanupDevice();