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:
Andrea
2025-01-02 21:08:55 +00:00
committed by GitHub
parent 80af06db77
commit d7918d9ac9
17 changed files with 81 additions and 59 deletions
+3 -7
View File
@@ -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();
}
//-----------------------------------------------------------------------------