mirror of https://github.com/OpenRCT2/OpenRCT2.git
Implement platform-specific changelog path funcs
This commit is contained in:
parent
972120e35a
commit
4132b85c02
|
@ -128,6 +128,7 @@ uint8 platform_get_locale_measurement_format();
|
|||
uint8 platform_get_locale_temperature_format();
|
||||
uint8 platform_get_locale_date_format();
|
||||
bool platform_process_is_elevated();
|
||||
void platform_get_changelog_path(utf8 *outPath, size_t outSize);
|
||||
|
||||
#ifndef NO_TTF
|
||||
bool platform_get_font_path(TTFFontDescriptor *font, utf8 *buffer, size_t size);
|
||||
|
|
|
@ -842,4 +842,11 @@ bool platform_process_is_elevated()
|
|||
return (geteuid() == 0);
|
||||
}
|
||||
|
||||
void platform_get_changelog_path(utf8 *outPath, size_t outSize)
|
||||
{
|
||||
platform_get_openrct_data_path(outPath, outSize);
|
||||
safe_strcat_path(outPath, "changelog.txt", outSize);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -454,6 +454,12 @@ void platform_get_openrct_data_path(utf8 *outPath, size_t outSize)
|
|||
safe_strcpy(outPath, _openrctDataDirectoryPath, outSize);
|
||||
}
|
||||
|
||||
void platform_get_changelog_path(utf8 *outPath, size_t outSize)
|
||||
{
|
||||
safe_strcpy(outPath, gExePath, outSize);
|
||||
safe_strcat_path(outPath, "changelog.txt", outSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* Default directory fallback is:
|
||||
* - (command line argument)
|
||||
|
|
|
@ -204,8 +204,7 @@ static bool window_changelog_read_file()
|
|||
{
|
||||
window_changelog_dispose_file();
|
||||
utf8 path[MAX_PATH];
|
||||
platform_get_openrct_data_path(path, sizeof(path));
|
||||
safe_strcat_path(path, "changelog.txt", MAX_PATH);
|
||||
platform_get_changelog_path(path, sizeof(path));
|
||||
if (!readentirefile(path, (void**)&_changelogText, &_changelogTextSize)) {
|
||||
log_error("Unable to read changelog.txt");
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue