mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-19 21:13:05 +01:00
add a CLI command for converting saved games <-> scenarios
This commit is contained in:
@@ -79,6 +79,28 @@ namespace Path
|
||||
return buffer;
|
||||
}
|
||||
|
||||
const utf8 * GetExtension(const utf8 * path)
|
||||
{
|
||||
const utf8 * lastDot = nullptr;
|
||||
const utf8 * ch = path;
|
||||
for (; *ch != '\0'; ch++)
|
||||
{
|
||||
if (*ch == '.')
|
||||
{
|
||||
lastDot = ch;
|
||||
}
|
||||
}
|
||||
|
||||
if (lastDot == nullptr)
|
||||
{
|
||||
// Return the null terminator, i.e. a blank extension
|
||||
return ch;
|
||||
}
|
||||
|
||||
// Return the extension including the dot
|
||||
return lastDot;
|
||||
}
|
||||
|
||||
utf8 * GetAbsolute(utf8 *buffer, size_t bufferSize, const utf8 * relativePath)
|
||||
{
|
||||
#if __WINDOWS__
|
||||
|
||||
Reference in New Issue
Block a user