changeset 1984:b00f5bb7d930

Added back window position saving Added Build/ to .hgignore
author zipi
date Sat, 02 Nov 2013 10:14:14 +0000
parents 5cd26f2c6904
children ef4dcee1b4a1
files .hgignore Game.cpp OSWindow.cpp mm7_2.cpp
diffstat 4 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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/
--- 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();
--- 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
--- 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;