Add ability to save/read files based on XDG specification

Fix some \\ in paths to be /
This commit is contained in:
Andrew Udvare 2022-08-30 11:48:47 -04:00
parent 15b71c57dd
commit 730a3791a1
No known key found for this signature in database
GPG key ID: 1AFD9AFC120C26DD
30 changed files with 254 additions and 135 deletions

View file

@ -289,7 +289,7 @@ uint32 loadSharedData()
for (sint32 i = 0; i < sizeof(shareddataDef) / sizeof(shareddataDef[0]); i++)
{
bool existsInMLC = fs::exists(ActiveSettings::GetMlcPath(shareddataDef[i].mlcPath));
bool existsInResources = fs::exists(ActiveSettings::GetPath(shareddataDef[i].resourcePath));
bool existsInResources = fs::exists(ActiveSettings::GetSystemDataPath(shareddataDef[i].resourcePath));
if (!existsInMLC && !existsInResources)
{
@ -314,7 +314,7 @@ uint32 loadSharedData()
// alternatively fall back to our shared fonts
if (!fontFile)
{
path = ActiveSettings::GetPath(shareddataDef[i].resourcePath);
path = ActiveSettings::GetSystemDataPath(shareddataDef[i].resourcePath);
fontFile = FileStream::openFile2(path);
}
if (!fontFile)
@ -340,7 +340,7 @@ uint32 loadSharedData()
return memory_getVirtualOffsetFromPointer(dataWritePtr);
}
// alternative method: load RAM dump
const auto path = ActiveSettings::GetPath("shareddata.bin");
const auto path = ActiveSettings::GetSystemDataPath("shareddata.bin");
FileStream* ramDumpFile = FileStream::openFile2(path);
if (ramDumpFile)
{