win32.c
changeset 643 6f04156241bd
parent 543 e3b43338096b
child 646 2e8a3763ebe5
equal deleted inserted replaced
642:56266c1b0e70 643:6f04156241bd
   179 			UpdateWindows();
   179 			UpdateWindows();
   180 		}
   180 		}
   181 	}
   181 	}
   182 }
   182 }
   183 
   183 
       
   184 void DoExitSave();
       
   185 
   184 static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
   186 static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
   185 {
   187 {
   186 	switch(msg) {
   188 	switch(msg) {
   187 	case WM_PAINT: {
   189 	case WM_PAINT: {
   188 		PAINTSTRUCT ps;
   190 		PAINTSTRUCT ps;
   222 			InvalidateRect(hwnd, NULL, FALSE);
   224 			InvalidateRect(hwnd, NULL, FALSE);
   223 		return 0;
   225 		return 0;
   224 	}
   226 	}
   225 
   227 
   226 	case WM_CLOSE:
   228 	case WM_CLOSE:
   227 		AskExitGame();
   229 		// do not ask to quit on the main screen
       
   230 		if (_game_mode != GM_MENU) {
       
   231 			if(_patches.autosave_on_exit) {
       
   232 				DoExitSave();
       
   233 				_exit_game = true;
       
   234 			} else
       
   235 				AskExitGame();
       
   236 		} else
       
   237 			return ML_QUIT;
   228 		return 0;
   238 		return 0;
   229 
   239 
   230 	case WM_LBUTTONDOWN:
   240 	case WM_LBUTTONDOWN:
   231 		SetCapture(hwnd);
   241 		SetCapture(hwnd);
   232 		_left_button_down = true;
   242 		_left_button_down = true;