diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index c888acfe9d..fcc80d58a9 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -511,20 +511,20 @@ namespace Config if (reader->ReadSection("font")) { auto model = &gConfigFonts; - model->file_name = reader->GetCString("file_name", nullptr); - model->font_name = reader->GetCString("font_name", nullptr); - model->x_offset = reader->GetInt32("x_offset", false); - model->y_offset = reader->GetInt32("y_offset", true); - model->size_tiny = reader->GetInt32("size_tiny", true); - model->size_small = reader->GetInt32("size_small", false); - model->size_medium = reader->GetInt32("size_medium", false); - model->size_big = reader->GetInt32("size_big", false); - model->height_tiny = reader->GetInt32("height_tiny", false); - model->height_small = reader->GetInt32("height_small", false); - model->height_medium = reader->GetInt32("height_medium", false); - model->height_big = reader->GetInt32("height_big", false); - model->enable_hinting = reader->GetBoolean("enable_hinting", true); - model->hinting_threshold = reader->GetInt32("hinting_threshold", false); + model->FileName = reader->GetCString("file_name", nullptr); + model->FontName = reader->GetCString("font_name", nullptr); + model->OffsetX = reader->GetInt32("x_offset", false); + model->OffsetY = reader->GetInt32("y_offset", true); + model->SizeTiny = reader->GetInt32("size_tiny", true); + model->SizeSmall = reader->GetInt32("size_small", false); + model->SizeMedium = reader->GetInt32("size_medium", false); + model->SizeBig = reader->GetInt32("size_big", false); + model->HeightTiny = reader->GetInt32("height_tiny", false); + model->HeightSmall = reader->GetInt32("height_small", false); + model->HeightMedium = reader->GetInt32("height_medium", false); + model->HeightBig = reader->GetInt32("height_big", false); + model->EnableHinting = reader->GetBoolean("enable_hinting", true); + model->HintingThreshold = reader->GetInt32("hinting_threshold", false); } } @@ -532,20 +532,20 @@ namespace Config { auto model = &gConfigFonts; writer->WriteSection("font"); - writer->WriteString("file_name", model->file_name); - writer->WriteString("font_name", model->font_name); - writer->WriteInt32("x_offset", model->x_offset); - writer->WriteInt32("y_offset", model->y_offset); - writer->WriteInt32("size_tiny", model->size_tiny); - writer->WriteInt32("size_small", model->size_small); - writer->WriteInt32("size_medium", model->size_medium); - writer->WriteInt32("size_big", model->size_big); - writer->WriteInt32("height_tiny", model->height_tiny); - writer->WriteInt32("height_small", model->height_small); - writer->WriteInt32("height_medium", model->height_medium); - writer->WriteInt32("height_big", model->height_big); - writer->WriteBoolean("enable_hinting", model->enable_hinting); - writer->WriteInt32("hinting_threshold", model->hinting_threshold); + writer->WriteString("file_name", model->FileName); + writer->WriteString("font_name", model->FontName); + writer->WriteInt32("x_offset", model->OffsetX); + writer->WriteInt32("y_offset", model->OffsetY); + writer->WriteInt32("size_tiny", model->SizeTiny); + writer->WriteInt32("size_small", model->SizeSmall); + writer->WriteInt32("size_medium", model->SizeMedium); + writer->WriteInt32("size_big", model->SizeBig); + writer->WriteInt32("height_tiny", model->HeightTiny); + writer->WriteInt32("height_small", model->HeightSmall); + writer->WriteInt32("height_medium", model->HeightMedium); + writer->WriteInt32("height_big", model->HeightBig); + writer->WriteBoolean("enable_hinting", model->EnableHinting); + writer->WriteInt32("hinting_threshold", model->HintingThreshold); } static void ReadPlugin(IIniReader* reader) @@ -805,8 +805,8 @@ void config_release() SafeFree(gConfigGeneral.CustomCurrencySymbol); SafeFree(gConfigInterface.CurrentThemePreset); SafeFree(gConfigInterface.CurrentTitleSequencePreset); - SafeFree(gConfigFonts.file_name); - SafeFree(gConfigFonts.font_name); + SafeFree(gConfigFonts.FileName); + SafeFree(gConfigFonts.FontName); } u8string config_get_default_path() diff --git a/src/openrct2/config/Config.h b/src/openrct2/config/Config.h index a03c32d79a..d6a1513eb8 100644 --- a/src/openrct2/config/Config.h +++ b/src/openrct2/config/Config.h @@ -198,20 +198,20 @@ struct NotificationConfiguration struct FontConfiguration { - utf8* file_name; - utf8* font_name; - int32_t x_offset; - int32_t y_offset; - int32_t size_tiny; - int32_t size_small; - int32_t size_medium; - int32_t size_big; - int32_t height_tiny; - int32_t height_small; - int32_t height_medium; - int32_t height_big; - bool enable_hinting; - int32_t hinting_threshold; + utf8* FileName; + utf8* FontName; + int32_t OffsetX; + int32_t OffsetY; + int32_t SizeTiny; + int32_t SizeSmall; + int32_t SizeMedium; + int32_t SizeBig; + int32_t HeightTiny; + int32_t HeightSmall; + int32_t HeightMedium; + int32_t HeightBig; + bool EnableHinting; + int32_t HintingThreshold; }; struct PluginConfiguration diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index 417c23be1c..fd0bc9a4c1 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -666,7 +666,7 @@ static void ttf_draw_string_raw_ttf(rct_drawpixelinfo* dpi, std::string_view tex dst = dst_orig; src = src_orig; - bool use_hinting = gConfigFonts.enable_hinting && fontDesc->hinting_threshold > 0; + bool use_hinting = gConfigFonts.EnableHinting && fontDesc->hinting_threshold > 0; for (int32_t yy = 0; yy < height; yy++) { for (int32_t xx = 0; xx < width; xx++) diff --git a/src/openrct2/drawing/ScrollingText.cpp b/src/openrct2/drawing/ScrollingText.cpp index 30d12a139d..2f81a00104 100644 --- a/src/openrct2/drawing/ScrollingText.cpp +++ b/src/openrct2/drawing/ScrollingText.cpp @@ -1601,7 +1601,7 @@ static void scrolling_text_set_bitmap_for_ttf( int32_t min_vpos = -fontDesc->offset_y; int32_t max_vpos = std::min(surface->h - 2, min_vpos + 7); - bool use_hinting = gConfigFonts.enable_hinting && fontDesc->hinting_threshold > 0; + bool use_hinting = gConfigFonts.EnableHinting && fontDesc->hinting_threshold > 0; for (int32_t x = 0;; x++) { diff --git a/src/openrct2/drawing/TTF.cpp b/src/openrct2/drawing/TTF.cpp index aa52ba3698..5f923e8924 100644 --- a/src/openrct2/drawing/TTF.cpp +++ b/src/openrct2/drawing/TTF.cpp @@ -98,7 +98,7 @@ static void ttf_toggle_hinting(bool) for (int32_t i = 0; i < FONT_SIZE_COUNT; i++) { TTFFontDescriptor* fontDesc = &(gCurrentTTFFontSet->size[i]); - bool use_hinting = gConfigFonts.enable_hinting && fontDesc->hinting_threshold; + bool use_hinting = gConfigFonts.EnableHinting && fontDesc->hinting_threshold; TTF_SetFontHinting(fontDesc->font, use_hinting ? 1 : 0); } diff --git a/src/openrct2/interface/Fonts.cpp b/src/openrct2/interface/Fonts.cpp index ff027d46c2..9d3ac4dabf 100644 --- a/src/openrct2/interface/Fonts.cpp +++ b/src/openrct2/interface/Fonts.cpp @@ -127,12 +127,12 @@ static bool LoadFont(LocalisationService& localisationService, TTFFontSetDescrip static bool LoadCustomConfigFont(LocalisationService& localisationService) { static TTFFontSetDescriptor TTFFontCustom = { { - { gConfigFonts.file_name, gConfigFonts.font_name, gConfigFonts.size_tiny, gConfigFonts.x_offset, gConfigFonts.y_offset, - gConfigFonts.height_tiny, gConfigFonts.hinting_threshold, nullptr }, - { gConfigFonts.file_name, gConfigFonts.font_name, gConfigFonts.size_small, gConfigFonts.x_offset, gConfigFonts.y_offset, - gConfigFonts.height_small, gConfigFonts.hinting_threshold, nullptr }, - { gConfigFonts.file_name, gConfigFonts.font_name, gConfigFonts.size_medium, gConfigFonts.x_offset, - gConfigFonts.y_offset, gConfigFonts.height_medium, gConfigFonts.hinting_threshold, nullptr }, + { gConfigFonts.FileName, gConfigFonts.FontName, gConfigFonts.SizeTiny, gConfigFonts.OffsetX, gConfigFonts.OffsetY, + gConfigFonts.HeightTiny, gConfigFonts.HintingThreshold, nullptr }, + { gConfigFonts.FileName, gConfigFonts.FontName, gConfigFonts.SizeSmall, gConfigFonts.OffsetX, gConfigFonts.OffsetY, + gConfigFonts.HeightSmall, gConfigFonts.HintingThreshold, nullptr }, + { gConfigFonts.FileName, gConfigFonts.FontName, gConfigFonts.SizeMedium, gConfigFonts.OffsetX, gConfigFonts.OffsetY, + gConfigFonts.HeightMedium, gConfigFonts.HintingThreshold, nullptr }, } }; ttf_dispose(); @@ -152,7 +152,7 @@ void TryLoadFonts(LocalisationService& localisationService) if (fontFamily != FAMILY_OPENRCT2_SPRITE) { - if (!String::IsNullOrEmpty(gConfigFonts.file_name)) + if (!String::IsNullOrEmpty(gConfigFonts.FileName)) { if (LoadCustomConfigFont(localisationService)) { diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 7ff95ca342..f5f6baffa3 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -723,7 +723,7 @@ static int32_t cc_get(InteractiveConsole& console, const arguments_t& argv) #ifndef NO_TTF else if (argv[0] == "enable_hinting") { - console.WriteFormatLine("enable_hinting %d", gConfigFonts.enable_hinting); + console.WriteFormatLine("enable_hinting %d", gConfigFonts.EnableHinting); } #endif else @@ -1171,7 +1171,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv) #ifndef NO_TTF else if (argv[0] == "enable_hinting" && invalidArguments(&invalidArgs, int_valid[0])) { - gConfigFonts.enable_hinting = (int_val[0] != 0); + gConfigFonts.EnableHinting = (int_val[0] != 0); config_save_default(); console.Execute("get enable_hinting"); ttf_toggle_hinting();