mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
Add export dir to Windows
This commit is contained in:
@@ -115,6 +115,7 @@ GpFileSystem_Win32::GpFileSystem_Win32(IGpAllocator *alloc)
|
||||
, m_userHousesDir(alloc)
|
||||
, m_userSavesDir(alloc)
|
||||
, m_resourcesDir(alloc)
|
||||
, m_exportDir(alloc)
|
||||
{
|
||||
m_executablePath[0] = 0;
|
||||
}
|
||||
@@ -155,18 +156,23 @@ bool GpFileSystem_Win32::Init()
|
||||
if (!m_logsDir.Set(m_prefsDir) || !m_logsDir.Append(L"\\Logs"))
|
||||
return false;
|
||||
|
||||
if (!m_exportDir.Set(m_prefsDir) || !m_exportDir.Append(L"\\Export"))
|
||||
return false;
|
||||
|
||||
CreateDirectoryW(m_prefsDir.Buffer(), nullptr);
|
||||
CreateDirectoryW(m_scoresDir.Buffer(), nullptr);
|
||||
CreateDirectoryW(m_userHousesDir.Buffer(), nullptr);
|
||||
CreateDirectoryW(m_userSavesDir.Buffer(), nullptr);
|
||||
CreateDirectoryW(m_logsDir.Buffer(), nullptr);
|
||||
CreateDirectoryW(m_exportDir.Buffer(), nullptr);
|
||||
|
||||
if (!m_prefsDir.Append(L"\\") ||
|
||||
!m_scoresDir.Append(L"\\") ||
|
||||
!m_userHousesDir.Append(L"\\") ||
|
||||
!m_userSavesDir.Append(L"\\") ||
|
||||
!m_logsDir.Append(L"\\") ||
|
||||
!m_resourcesDir.Append(L"\\"))
|
||||
!m_resourcesDir.Append(L"\\") ||
|
||||
!m_exportDir.Append(L"\\"))
|
||||
return false;
|
||||
|
||||
DWORD modulePathSize = GetModuleFileNameW(nullptr, m_executablePath, MAX_PATH);
|
||||
@@ -509,6 +515,9 @@ bool GpFileSystem_Win32::ResolvePath(PortabilityLayer::VirtualDirectory_t virtua
|
||||
case PortabilityLayer::VirtualDirectories::kLogs:
|
||||
baseDir = m_logsDir.Buffer();
|
||||
break;
|
||||
case PortabilityLayer::VirtualDirectories::kSourceExport:
|
||||
baseDir = m_exportDir.Buffer();
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@@ -42,6 +42,7 @@ private:
|
||||
GpWString m_userHousesDir;
|
||||
GpWString m_userSavesDir;
|
||||
GpWString m_resourcesDir;
|
||||
GpWString m_exportDir;
|
||||
wchar_t m_executablePath[MAX_PATH];
|
||||
|
||||
IGpAllocator *m_alloc;
|
||||
|
Reference in New Issue
Block a user