mirror of
https://github.com/AppleWin/AppleWin.git
synced 2026-04-21 07:17:41 +00:00
A few miscellaneous cleanups. (PR #1355)
Move DSXXX function to a more specific location. . DSAvailable() is not implemented in SoundCore. . DSInit() & DSUninit(); are only meaningful in Windows. SoundBuffer: use plain C++ to clean it up as opposed to COM interfaces. . which are only relevant to the Win32 implementation. Remove 2 obsolete FMT macros. NTSC: load bitmaps by resource id. SoundBuffer: make creation of a SoundBuffer an atomic operation. Fix 2019 solution.
This commit is contained in:
@@ -152,14 +152,10 @@ HRESULT DSGetSoundBuffer(VOICE* pVoice, uint32_t dwFlags, uint32_t dwBufferSize,
|
||||
{
|
||||
pVoice->name = pszDevName;
|
||||
|
||||
std::shared_ptr<SoundBuffer> soundBuffer = GetFrame().CreateSoundBuffer();
|
||||
std::shared_ptr<SoundBuffer> soundBuffer = GetFrame().CreateSoundBuffer(dwFlags, dwBufferSize, nSampleRate, nChannels, pszDevName);
|
||||
if (!soundBuffer)
|
||||
return E_FAIL;
|
||||
|
||||
HRESULT hr = soundBuffer->Init(dwFlags, dwBufferSize, nSampleRate, nChannels, pszDevName);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
pVoice->lpDSBvoice = soundBuffer;
|
||||
|
||||
_ASSERT(g_uNumVoices < uMAX_VOICES);
|
||||
@@ -169,7 +165,7 @@ HRESULT DSGetSoundBuffer(VOICE* pVoice, uint32_t dwFlags, uint32_t dwBufferSize,
|
||||
if(pVoice->bIsSpeaker)
|
||||
g_pSpeakerVoice = pVoice;
|
||||
|
||||
return hr;
|
||||
return DS_OK;
|
||||
}
|
||||
|
||||
void DSReleaseSoundBuffer(VOICE* pVoice)
|
||||
@@ -188,7 +184,7 @@ void DSReleaseSoundBuffer(VOICE* pVoice)
|
||||
}
|
||||
}
|
||||
|
||||
SAFE_RELEASE(pVoice->lpDSBvoice);
|
||||
pVoice->lpDSBvoice.reset();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user