mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
Add verbose logging of base paths
This commit is contained in:
@@ -282,6 +282,13 @@ namespace OpenRCT2
|
||||
basePaths[(size_t)DIRBASE::USER] = std::string(path);
|
||||
|
||||
IPlatformEnvironment * env = CreatePlatformEnvironment(basePaths);
|
||||
|
||||
// Log base paths
|
||||
log_verbose("DIRBASE::RCT1 : %s", env->GetDirectoryPath(DIRBASE::RCT1).c_str());
|
||||
log_verbose("DIRBASE::RCT2 : %s", env->GetDirectoryPath(DIRBASE::RCT2).c_str());
|
||||
log_verbose("DIRBASE::OPENRCT2: %s", env->GetDirectoryPath(DIRBASE::OPENRCT2).c_str());
|
||||
log_verbose("DIRBASE::USER : %s", env->GetDirectoryPath(DIRBASE::USER).c_str());
|
||||
|
||||
return env;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ extern "C"
|
||||
#include "platform/platform.h"
|
||||
}
|
||||
|
||||
class PlatformEnvironment : public IPlatformEnvironment
|
||||
class PlatformEnvironment final : public IPlatformEnvironment
|
||||
{
|
||||
private:
|
||||
std::string _basePath[DIRBASE_COUNT];
|
||||
@@ -39,9 +39,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
std::string GetDirectoryPath(DIRBASE base) const override
|
||||
{
|
||||
return _basePath[(size_t)base];
|
||||
}
|
||||
|
||||
std::string GetDirectoryPath(DIRBASE base, DIRID did) const override
|
||||
{
|
||||
const utf8 * basePath = _basePath[(size_t)base].c_str();
|
||||
auto basePath = GetDirectoryPath(base);
|
||||
const utf8 * directoryName;
|
||||
switch (base) {
|
||||
default:
|
||||
@@ -55,10 +60,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
utf8 path[260];
|
||||
String::Set(path, sizeof(path), basePath);
|
||||
Path::Append(path, sizeof(path), directoryName);
|
||||
return std::string(path);
|
||||
return Path::Combine(basePath, directoryName);
|
||||
}
|
||||
|
||||
std::string GetFilePath(PATHID pathid) const override
|
||||
|
||||
@@ -68,6 +68,7 @@ interface IPlatformEnvironment
|
||||
{
|
||||
virtual ~IPlatformEnvironment() = default;
|
||||
|
||||
virtual std::string GetDirectoryPath(DIRBASE base) const abstract;
|
||||
virtual std::string GetDirectoryPath(DIRBASE base, DIRID did) const abstract;
|
||||
virtual std::string GetFilePath(PATHID pathid) const abstract;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user