ADDED more sound skip protection on GUI interaction

REMOVED zutil.h dependency
SMALL code cleanup
This commit is contained in:
spacy51 2008-08-13 14:24:50 +00:00
parent 86a59cdbcf
commit 9146d8d68e
4 changed files with 15 additions and 11 deletions

View File

@ -9,11 +9,7 @@
* Adapted from original gzio.c from zlib library by Forgotten * Adapted from original gzio.c from zlib library by Forgotten
*/ */
#if defined(HAVE_ZUTIL_H) || defined(_MSC_VER)
# include <zutil.h>
#else
#include <zlib.h> #include <zlib.h>
#endif
gzFile ZEXPORT memgzopen(char *memory, int, const char *); gzFile ZEXPORT memgzopen(char *memory, int, const char *);
int ZEXPORT memgzread(gzFile, voidp, unsigned); int ZEXPORT memgzread(gzFile, voidp, unsigned);

View File

@ -440,6 +440,7 @@ BEGIN_MESSAGE_MAP(MainWnd, CWnd)
ON_UPDATE_COMMAND_UI(ID_LOADGAME_DONOTCHANGEBATTERYSAVE, &MainWnd::OnUpdateLoadgameDonotchangebatterysave) ON_UPDATE_COMMAND_UI(ID_LOADGAME_DONOTCHANGEBATTERYSAVE, &MainWnd::OnUpdateLoadgameDonotchangebatterysave)
ON_COMMAND(ID_OUTPUTAPI_XAUDIO2CONFIG, &MainWnd::OnOutputapiXaudio2config) ON_COMMAND(ID_OUTPUTAPI_XAUDIO2CONFIG, &MainWnd::OnOutputapiXaudio2config)
ON_UPDATE_COMMAND_UI(ID_OUTPUTAPI_XAUDIO2CONFIG, &MainWnd::OnUpdateOutputapiXaudio2config) ON_UPDATE_COMMAND_UI(ID_OUTPUTAPI_XAUDIO2CONFIG, &MainWnd::OnUpdateOutputapiXaudio2config)
ON_WM_ENTERSIZEMOVE()
END_MESSAGE_MAP() END_MESSAGE_MAP()
@ -1326,3 +1327,16 @@ void MainWnd::OnNcRButtonDown(UINT nHitTest, CPoint point)
CWnd::OnNcRButtonDown(nHitTest, point); CWnd::OnNcRButtonDown(nHitTest, point);
} }
void MainWnd::OnEnterSizeMove()
{
// The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving or sizing modal loop.
// Causes the emulator to stop when moving or resizing the window.
if( emulating ) {
// pause sound before entering DefWindowProc
soundPause();
}
CWnd::OnEnterSizeMove();
}

View File

@ -405,4 +405,5 @@ public:
afx_msg void OnUpdateLoadgameDonotchangebatterysave(CCmdUI *pCmdUI); afx_msg void OnUpdateLoadgameDonotchangebatterysave(CCmdUI *pCmdUI);
DECLARE_MESSAGE_MAP() DECLARE_MESSAGE_MAP()
afx_msg void OnEnterSizeMove();
}; };

View File

@ -564,13 +564,6 @@ BOOL VBA::InitInstance()
trapPointers[2] = &VBA::updateRenderMethod; trapPointers[2] = &VBA::updateRenderMethod;
trapPointers[5] = &VBA::updateRenderMethod0; trapPointers[5] = &VBA::updateRenderMethod0;
#if _MSC_VER < 1400
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
#endif
securityCheck = doProtection(); securityCheck = doProtection();
securityCheck2 = ((double)securityCheck < -0.987) ? 1 : securityCheck; securityCheck2 = ((double)securityCheck < -0.987) ? 1 : securityCheck;
mainTrapPointer = &trapPointers[(securityCheck2+1)<<1]; mainTrapPointer = &trapPointers[(securityCheck2+1)<<1];