* Save BaseGraphics set selection and configuration. */
| 1231 | * Save BaseGraphics set selection and configuration. |
| 1232 | */ |
| 1233 | static void GraphicsSetSaveConfig(IniFile &ini) |
| 1234 | { |
| 1235 | const GraphicsSet *used_set = BaseGraphics::GetUsedSet(); |
| 1236 | if (used_set == nullptr) return; |
| 1237 | |
| 1238 | IniGroup &group = ini.GetOrCreateGroup("graphicsset"); |
| 1239 | group.Clear(); |
| 1240 | |
| 1241 | group.GetOrCreateItem("name").SetValue(used_set->name); |
| 1242 | group.GetOrCreateItem("shortname").SetValue(fmt::format("{:08X}", std::byteswap(used_set->shortname))); |
| 1243 | |
| 1244 | const GRFConfig *extra_cfg = used_set->GetExtraConfig(); |
| 1245 | if (extra_cfg != nullptr && !extra_cfg->param.empty()) { |
| 1246 | group.GetOrCreateItem("extra_version").SetValue(fmt::format("{}", extra_cfg->version)); |
| 1247 | group.GetOrCreateItem("extra_params").SetValue(GRFBuildParamList(*extra_cfg)); |
| 1248 | } |
| 1249 | } |
| 1250 | |
| 1251 | /* Save a GRF configuration to the given group name */ |
| 1252 | static void GRFSaveConfig(IniFile &ini, std::string_view grpname, const GRFConfigList &list) |
no test coverage detected