Merge remote-tracking branch 'upstream/master'
Conflicts: src/console_gui.cpp src/genworld_gui.cpp src/group_gui.cpp src/misc_gui.cpp src/settings_gui.cpp src/widgets/settings_widget.h
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
#include "currency.h"
|
||||
#include "station_base.h"
|
||||
#include "town.h"
|
||||
#include "screenshot.h"
|
||||
#include "waypoint_base.h"
|
||||
#include "depot_base.h"
|
||||
#include "industry.h"
|
||||
@@ -41,6 +40,8 @@
|
||||
#include "table/strings.h"
|
||||
#include "table/control_codes.h"
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
char _config_language_file[MAX_PATH]; ///< The file (name) stored in the configuration.
|
||||
LanguageList _languages; ///< The actual list of language meta data.
|
||||
const LanguageMetadata *_current_language = NULL; ///< The currently loaded language.
|
||||
@@ -163,7 +164,7 @@ void CopyOutDParam(uint64 *dst, const char **strings, StringID string, int num)
|
||||
MemCpyT(dst, _global_string_params.GetPointerToOffset(0), num);
|
||||
for (int i = 0; i < num; i++) {
|
||||
if (_global_string_params.HasTypeInformation() && _global_string_params.GetTypeAtOffset(i) == SCC_RAW_STRING_POINTER) {
|
||||
strings[i] = strdup((const char *)(size_t)_global_string_params.GetParam(i));
|
||||
strings[i] = stredup((const char *)(size_t)_global_string_params.GetParam(i));
|
||||
dst[i] = (size_t)strings[i];
|
||||
} else {
|
||||
strings[i] = NULL;
|
||||
@@ -431,8 +432,8 @@ static char *FormatTinyOrISODate(char *buff, Date date, StringID str, const char
|
||||
char day[3];
|
||||
char month[3];
|
||||
/* We want to zero-pad the days and months */
|
||||
snprintf(day, lengthof(day), "%02i", ymd.day);
|
||||
snprintf(month, lengthof(month), "%02i", ymd.month + 1);
|
||||
seprintf(day, lastof(day), "%02i", ymd.day);
|
||||
seprintf(month, lastof(month), "%02i", ymd.month + 1);
|
||||
|
||||
int64 args[] = {(int64)(size_t)day, (int64)(size_t)month, ymd.year};
|
||||
StringParameters tmp_params(args);
|
||||
@@ -887,7 +888,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
||||
|
||||
sub_args.SetParam(i++, param);
|
||||
} else {
|
||||
char *g = strdup(s);
|
||||
char *g = stredup(s);
|
||||
g[p - s] = '\0';
|
||||
|
||||
sub_args_need_free[i] = true;
|
||||
@@ -1680,12 +1681,6 @@ static char *GetSpecialNameString(char *buff, int ind, StringParameters *args, c
|
||||
return buff;
|
||||
}
|
||||
|
||||
/* screenshot format name? */
|
||||
if (IsInsideMM(ind, (SPECSTR_SCREENSHOT_START - 0x70E4), (SPECSTR_SCREENSHOT_END - 0x70E4) + 1)) {
|
||||
int i = ind - (SPECSTR_SCREENSHOT_START - 0x70E4);
|
||||
return strecpy(buff, GetScreenshotFormatDesc(i), last);
|
||||
}
|
||||
|
||||
NOT_REACHED();
|
||||
}
|
||||
|
||||
@@ -1952,7 +1947,7 @@ void InitializeLanguagePacks()
|
||||
|
||||
FOR_ALL_SEARCHPATHS(sp) {
|
||||
char path[MAX_PATH];
|
||||
FioAppendDirectory(path, lengthof(path), sp, LANG_DIR);
|
||||
FioAppendDirectory(path, lastof(path), sp, LANG_DIR);
|
||||
GetLanguageList(path);
|
||||
}
|
||||
if (_languages.Length() == 0) usererror("No available language packs (invalid versions?)");
|
||||
@@ -2123,7 +2118,7 @@ void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher)
|
||||
* properly we have to set the colour of the string, otherwise we end up with a lot of artifacts.
|
||||
* The colour 'character' might change in the future, so for safety we just Utf8 Encode it into
|
||||
* the string, which takes exactly three characters, so it replaces the "XXX" with the colour marker. */
|
||||
static char *err_str = strdup("XXXThe current font is missing some of the characters used in the texts for this language. Read the readme to see how to solve this.");
|
||||
static char *err_str = stredup("XXXThe current font is missing some of the characters used in the texts for this language. Read the readme to see how to solve this.");
|
||||
Utf8Encode(err_str, SCC_YELLOW);
|
||||
SetDParamStr(0, err_str);
|
||||
ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, WL_WARNING);
|
||||
@@ -2151,7 +2146,7 @@ void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher)
|
||||
* the colour marker.
|
||||
*/
|
||||
if (_current_text_dir != TD_LTR) {
|
||||
static char *err_str = strdup("XXXThis version of OpenTTD does not support right-to-left languages. Recompile with icu enabled.");
|
||||
static char *err_str = stredup("XXXThis version of OpenTTD does not support right-to-left languages. Recompile with icu enabled.");
|
||||
Utf8Encode(err_str, SCC_YELLOW);
|
||||
SetDParamStr(0, err_str);
|
||||
ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, WL_ERROR);
|
||||
|
||||
Reference in New Issue
Block a user