MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / FillSetDetails

Method FillSetDetails

src/gfxinit.cpp:355–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353GraphicsSet::~GraphicsSet() = default;
354
355bool GraphicsSet::FillSetDetails(const IniFile &ini, const std::string &path, const std::string &full_filename)
356{
357 if (!this->BaseSet<GraphicsSet>::FillSetDetails(ini, path, full_filename, false)) return false;
358
359 const IniGroup *metadata = ini.GetGroup("metadata");
360 assert(metadata != nullptr); /* already checked by the inherited FillSetDetails. */
361 const IniItem *item;
362
363 item = this->GetMandatoryItem(full_filename, *metadata, "palette");
364 if (item == nullptr) return false;
365 this->palette = ((*item->value)[0] == 'D' || (*item->value)[0] == 'd') ? PAL_DOS : PAL_WINDOWS;
366
367 /* Get optional blitter information. */
368 item = metadata->GetItem("blitter");
369 this->blitter = (item != nullptr && (*item->value)[0] == '3') ? BLT_32BPP : BLT_8BPP;
370
371 return true;
372}
373
374/**
375 * Return configuration for the extra GRF, or lazily create it.

Callers

nothing calls this directly

Calls 3

GetGroupMethod · 0.80
GetMandatoryItemMethod · 0.80
GetItemMethod · 0.80

Tested by

no test coverage detected