From ba2887e700594b81ffbb2fdd41cfcbed57fee8b1 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sun, 14 Aug 2011 19:03:24 +0000 Subject: [PATCH] win32: dont stay paused when canceling the save state as filebrowser --- desmume/src/windows/main.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index c5d50de70..ef3ef1a09 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -4902,7 +4902,7 @@ DOKEYDOWN: case IDM_STATE_SAVE: { OPENFILENAME ofn; - NDS_Pause(); + bool unpause = NDS_Pause(); ZeroMemory(&ofn, sizeof(ofn)); ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = hwnd; @@ -4918,14 +4918,13 @@ DOKEYDOWN: path.getpath(path.STATES, buffer); ofn.lpstrInitialDir = buffer; - if(!GetSaveFileName(&ofn)) + if(GetSaveFileName(&ofn)) { - return 0; + savestate_save(SavName); + LoadSaveStateInfo(); } - - savestate_save(SavName); - LoadSaveStateInfo(); - NDS_UnPause(); + if(unpause) NDS_UnPause(); + return 0; } return 0; case IDM_STATE_SAVE_F1: