--- np2/win9x/soundmng.cpp 2006/12/30 23:26:35 1.12.2.2 +++ np2/win9x/soundmng.cpp 2007/11/11 07:11:27 1.16 @@ -61,14 +61,16 @@ static void (PARTSCALL *fnmix)(SINT16 // ---- directsound -static BRESULT dsoundcreate(void) { - +static BRESULT dsoundcreate(HWND hWnd) +{ // DirectSound¤Î½é´ü²½ if (FAILED(DirectSoundCreate(0, &pDSound, 0))) { goto dscre_err; } - if (FAILED(pDSound->SetCooperativeLevel(hWndMain, DSSCL_PRIORITY))) { - if (FAILED(pDSound->SetCooperativeLevel(hWndMain, DSSCL_NORMAL))) { + if (FAILED(pDSound->SetCooperativeLevel(hWnd, DSSCL_PRIORITY))) + { + if (FAILED(pDSound->SetCooperativeLevel(hWnd, DSSCL_NORMAL))) + { goto dscre_err; } } @@ -92,6 +94,7 @@ UINT soundmng_create(UINT rate, UINT ms) (rate != 11025) && (rate != 22050) && (rate != 44100)) { goto stcre_err1; } + if (ms < 40) { ms = 40; } @@ -135,9 +138,11 @@ UINT soundmng_create(UINT rate, UINT ms) vermouth_module = midimod_create(rate); midimod_loadall(vermouth_module); #endif + #if defined(MT32SOUND_DLL) mt32sound_setrate(rate); #endif + dsstreamevent = (UINT8)-1; return(samples); @@ -466,7 +471,7 @@ void soundmng_pcmstop(UINT num) { BRESULT soundmng_initialize(void) { - if (dsoundcreate() != SUCCESS) { + if (dsoundcreate(g_hWndMain) != SUCCESS) { goto smcre_err; } pcmcreate();