forked from cafeberry/cafeberry
feat: durango ui parity & setting name
This commit is contained in:
@@ -60,6 +60,8 @@ extern "C"
|
||||
__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001;
|
||||
}
|
||||
|
||||
char g_Username[32];
|
||||
|
||||
BOOL g_isFullscreen = FALSE;
|
||||
BOOL g_bWidescreen = TRUE;
|
||||
BOOL g_bResolutionSetByCMD = FALSE;
|
||||
@@ -95,6 +97,14 @@ static Windows64LaunchArgs ParseLaunchArgs()
|
||||
{
|
||||
args.resolution = argv[++i][0] - L'0';
|
||||
}
|
||||
}
|
||||
else if (_wcsicmp(argv[i], L"-name") == 0)
|
||||
{
|
||||
if (i + 1 < argc)
|
||||
{
|
||||
app.CopyWideArgToAnsi(argv[i + 1], g_Username, sizeof(g_Username));
|
||||
app.SetFakeGamertag(g_Username);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,9 +296,11 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_ENTERMENULOOP:
|
||||
case WM_ENTERSIZEMOVE:
|
||||
SetTimer(hWnd, 1, USER_TIMER_MINIMUM, NULL);
|
||||
break;
|
||||
case WM_EXITMENULOOP:
|
||||
case WM_EXITSIZEMOVE:
|
||||
KillTimer(hWnd, 1);
|
||||
break;
|
||||
@@ -324,7 +336,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -348,7 +360,7 @@ ATOM MyRegisterClass(HINSTANCE hInstance)
|
||||
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
|
||||
wcex.lpszMenuName = "Minecraft";
|
||||
wcex.lpszClassName = "MinecraftClass";
|
||||
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
|
||||
wcex.hIconSm = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MINECRAFTWINDOWS));
|
||||
|
||||
return RegisterClassEx(&wcex);
|
||||
}
|
||||
@@ -489,6 +501,7 @@ HRESULT InitDevice()
|
||||
|
||||
D3D_FEATURE_LEVEL featureLevels[] =
|
||||
{
|
||||
D3D_FEATURE_LEVEL_11_1,
|
||||
D3D_FEATURE_LEVEL_11_0,
|
||||
D3D_FEATURE_LEVEL_10_1,
|
||||
D3D_FEATURE_LEVEL_10_0,
|
||||
@@ -512,9 +525,17 @@ HRESULT InitDevice()
|
||||
for( UINT driverTypeIndex = 0; driverTypeIndex < numDriverTypes; driverTypeIndex++ )
|
||||
{
|
||||
g_driverType = driverTypes[driverTypeIndex];
|
||||
|
||||
hr = D3D11CreateDeviceAndSwapChain( NULL, g_driverType, NULL, createDeviceFlags, featureLevels, numFeatureLevels,
|
||||
D3D11_SDK_VERSION, &sd, &g_pSwapChain, &g_pd3dDevice, &g_featureLevel, &g_pImmediateContext );
|
||||
if( HRESULT_SUCCEEDED( hr ) )
|
||||
|
||||
if (hr == E_INVALIDARG && numFeatureLevels > 1 && featureLevels[0] == D3D_FEATURE_LEVEL_11_1)
|
||||
{
|
||||
hr = D3D11CreateDeviceAndSwapChain( NULL, g_driverType, NULL, createDeviceFlags, &featureLevels[1], numFeatureLevels - 1,
|
||||
D3D11_SDK_VERSION, &sd, &g_pSwapChain, &g_pd3dDevice, &g_featureLevel, &g_pImmediateContext );
|
||||
}
|
||||
|
||||
if( SUCCEEDED( hr ) )
|
||||
break;
|
||||
}
|
||||
if( FAILED( hr ) )
|
||||
|
||||
Reference in New Issue
Block a user