forked from cafeberry/cafeberry
feat(Windows64): use screen size instead of window size, fix exit game, fix oprhaned saves on exit without saving
This commit is contained in:
@@ -359,7 +359,7 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId)
|
||||
m_eAction=eAction_RunUnlockOrDLC;
|
||||
signInReturnedFunc = &UIScene_MainMenu::UnlockFullGame_SignInReturned;
|
||||
break;
|
||||
#if defined _XBOX
|
||||
#if defined(_XBOX) || defined(_WINDOWS64)
|
||||
case eControl_Exit:
|
||||
if( ProfileManager.IsFullVersion() )
|
||||
{
|
||||
@@ -370,9 +370,6 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef _XBOX_ONE
|
||||
ui.ShowPlayerDisplayname(true);
|
||||
#endif
|
||||
ui.NavigateToScene(primaryPad,eUIScene_TrialExitUpsell);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -753,10 +753,13 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
||||
|
||||
if( s_bServerHalted || !g_NetworkManager.IsInSession() ) return false;
|
||||
|
||||
//str1k3r - if used on windows64 a orphaned save gets left behind if you exit without saving
|
||||
#ifndef _WINDOWS64
|
||||
if( levels[0]->isNew || levels[1]->isNew || levels[2]->isNew )
|
||||
{
|
||||
levels[0]->saveToDisc(mcprogress, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
if( s_bServerHalted || !g_NetworkManager.IsInSession() ) return false;
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ void CConsoleMinecraftApp::StoreLaunchData()
|
||||
}
|
||||
void CConsoleMinecraftApp::ExitGame()
|
||||
{
|
||||
ExitProcess(0);
|
||||
}
|
||||
void CConsoleMinecraftApp::FatalLoadError()
|
||||
{
|
||||
|
||||
@@ -406,7 +406,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ShowWindow(g_hWnd, nCmdShow);
|
||||
ShowWindow(g_hWnd, (nCmdShow != SW_HIDE) ? SW_SHOWMAXIMIZED : nCmdShow);
|
||||
UpdateWindow(g_hWnd);
|
||||
|
||||
return TRUE;
|
||||
@@ -467,10 +467,9 @@ HRESULT InitDevice()
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
RECT rc;
|
||||
GetClientRect( g_hWnd, &rc );
|
||||
g_iScreenWidth = rc.right - rc.left;
|
||||
g_iScreenHeight = rc.bottom - rc.top;
|
||||
//str1k3r - use screen size instead of window size
|
||||
g_iScreenWidth = GetSystemMetrics(SM_CXSCREEN);
|
||||
g_iScreenHeight = GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
//str1k3r - stop hardcoding size and just use the screens actual size
|
||||
UINT width = g_iScreenWidth;
|
||||
@@ -546,6 +545,7 @@ HRESULT InitDevice()
|
||||
hr = g_pd3dDevice->CreateTexture2D(&descDepth, NULL, &g_pDepthStencilBuffer);
|
||||
|
||||
D3D11_DEPTH_STENCIL_VIEW_DESC descDSView;
|
||||
ZeroMemory(&descDSView, sizeof(descDSView));
|
||||
descDSView.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
|
||||
descDSView.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D;
|
||||
descDSView.Texture2D.MipSlice = 0;
|
||||
|
||||
Reference in New Issue
Block a user