# HG changeset patch # User zipi # Date 1383387254 0 # Node ID b00f5bb7d9304497fdd32c1eff7708aae7dc6d72 # Parent 5cd26f2c69048a33bb5c0afb4241763e08a1b241 Added back window position saving Added Build/ to .hgignore diff -r 5cd26f2c6904 -r b00f5bb7d930 .hgignore --- a/.hgignore Fri Nov 01 17:29:49 2013 +0600 +++ b/.hgignore Sat Nov 02 10:14:14 2013 +0000 @@ -3,3 +3,4 @@ Release/ *.orig .git/* +Build/ diff -r 5cd26f2c6904 -r b00f5bb7d930 Game.cpp --- a/Game.cpp Fri Nov 01 17:29:49 2013 +0600 +++ b/Game.cpp Sat Nov 02 10:14:14 2013 +0000 @@ -752,11 +752,11 @@ WriteWindowsRegistryInt("startinwindow", pRenderer->bWindowMode); - /*if ( GetWindowRect(hWnd, &Rect) && pRenderer->bWindowMode ) + if ( GetWindowRect(window->GetApiHandle(), &Rect) && pRenderer->bWindowMode ) { WriteWindowsRegistryInt("window X", Rect.left); WriteWindowsRegistryInt("window Y", Rect.top); - }*/ + } WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun); pItemsTable->Release(); pNPCStats->Release(); diff -r 5cd26f2c6904 -r b00f5bb7d930 OSWindow.cpp --- a/OSWindow.cpp Fri Nov 01 17:29:49 2013 +0600 +++ b/OSWindow.cpp Sat Nov 02 10:14:14 2013 +0000 @@ -517,8 +517,8 @@ if (!GetMenu(api_handle)) window_total_height += GetSystemMetrics(SM_CYMENU); #endif - MoveWindow(api_handle, (GetSystemMetrics(SM_CXSCREEN) - window_total_width) / 2, - (GetSystemMetrics(SM_CYSCREEN) - window_total_height) / 2, + MoveWindow(api_handle, ReadWindowsRegistryInt("window X", (GetSystemMetrics(SM_CXSCREEN) - window_total_width) / 2), + ReadWindowsRegistryInt("window X", (GetSystemMetrics(SM_CYSCREEN) - window_total_height) / 2), window_total_width, window_total_height, 0); #ifdef _DEBUG diff -r 5cd26f2c6904 -r b00f5bb7d930 mm7_2.cpp --- a/mm7_2.cpp Fri Nov 01 17:29:49 2013 +0600 +++ b/mm7_2.cpp Sat Nov 02 10:14:14 2013 +0000 @@ -3045,8 +3045,8 @@ pTexture_PCX.Release(); pTexture_PCX.Load("title.pcx", 0); SetCurrentMenuID(MENU_MAIN); - //SetForegroundWindow(hWnd); - //SendMessageW(hWnd, WM_ACTIVATEAPP, 1, 0); + SetForegroundWindow(window->GetApiHandle()); + SendMessageW(window->GetApiHandle(), WM_ACTIVATEAPP, 1, 0); while (GetCurrentMenuID() == MENU_MAIN || GetCurrentMenuID() == MENU_SAVELOAD) { POINT pt;