[saco] Implement DXUTSetMediaSearchPath(...)

This commit is contained in:
RD42 2024-05-12 22:48:50 +08:00
parent cb0177debc
commit 1e0ce73275
2 changed files with 27 additions and 0 deletions

View File

@ -190,3 +190,26 @@ LPCTSTR DXUTGetMediaSearchPath()
}
//--------------------------------------------------------------------------------------
HRESULT DXUTSetMediaSearchPath( LPCTSTR strPath )
{
HRESULT hr;
TCHAR* s_strSearchPath = DXUTMediaSearchPath();
hr = StringCchCopy( s_strSearchPath, MAX_PATH, strPath );
if( SUCCEEDED(hr) )
{
// append slash if needed
size_t ch;
hr = StringCchLength( s_strSearchPath, MAX_PATH, &ch );
if( SUCCEEDED(hr) && s_strSearchPath[ch-1] != L'\\')
{
hr = StringCchCat( s_strSearchPath, MAX_PATH, "\\" );
}
}
return hr;
}

View File

@ -21,6 +21,10 @@
#include <stdio.h>
#include <multimon.h>
#define STRSAFE_NO_DEPRECATE
#include <strsafe.h>
#include "DXUTmisc.h"
#endif // !defined(DXSDK_STDAFX_H)