From 2f6b24b9704c52b8ece50b3c0a54159e1f8a0766 Mon Sep 17 00:00:00 2001 From: tomcw Date: Sun, 1 Sep 2019 11:28:24 +0100 Subject: [PATCH] Fixed up the Debug/Release NoDX configurations --- source/SoundCore.cpp | 8 +++++++- source/Video.cpp | 10 ++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/source/SoundCore.cpp b/source/SoundCore.cpp index 61fc46c7..c1ae5303 100644 --- a/source/SoundCore.cpp +++ b/source/SoundCore.cpp @@ -226,10 +226,15 @@ void DSReleaseSoundBuffer(VOICE* pVoice) bool DSZeroVoiceBuffer(PVOICE Voice, char* pszDevName, DWORD dwBufferSize) { +#ifdef NO_DIRECT_X + + return false; + +#else + DWORD dwDSLockedBufferSize = 0; // Size of the locked DirectSound buffer SHORT* pDSLockedBuffer; - HRESULT hr = Voice->lpDSBvoice->Stop(); if(FAILED(hr)) { @@ -262,6 +267,7 @@ bool DSZeroVoiceBuffer(PVOICE Voice, char* pszDevName, DWORD dwBufferSize) } return true; +#endif // NO_DIRECT_X } //----------------------------------------------------------------------------- diff --git a/source/Video.cpp b/source/Video.cpp index e02a7739..acf617f2 100644 --- a/source/Video.cpp +++ b/source/Video.cpp @@ -599,7 +599,11 @@ void VideoRefreshScreen ( uint32_t uRedrawWholeScreenVideoMode /* =0*/, bool bRe SRCCOPY); } +#ifdef NO_DIRECT_X +#else //if (g_lpDD) g_lpDD->WaitForVerticalBlank(DDWAITVB_BLOCKBEGIN, NULL); +#endif // NO_DIRECT_X + GdiFlush(); } @@ -909,6 +913,11 @@ static BOOL CALLBACK DDEnumProc(LPGUID lpGUID, LPCTSTR lpszDesc, LPCTSTR lpszDrv bool DDInit(void) { +#ifdef NO_DIRECT_X + + return false; + +#else HRESULT hr = DirectDrawEnumerate((LPDDENUMCALLBACK)DDEnumProc, NULL); if (FAILED(hr)) { @@ -939,6 +948,7 @@ bool DDInit(void) } return true; +#endif // NO_DIRECT_X } // From SoundCore.h