mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-12 02:08:14 +08:00
[saco] Implement DXUTSetMediaSearchPath(...)
This commit is contained in:
1 parent
cb0177debc
commit
1e0ce73275
2 files changed
+27
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user