mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-25 21:24:12 +01:00
Codechange: Use vector with unique_ptr instead of linked-list for base set lists. (#14332)
This commit is contained in:
@@ -480,7 +480,7 @@ template <>
|
||||
|
||||
const GraphicsSet *best = nullptr;
|
||||
|
||||
auto IsBetter = [&best] (const auto *current) {
|
||||
auto IsBetter = [&best] (const GraphicsSet *current) {
|
||||
/* Nothing chosen yet. */
|
||||
if (best == nullptr) return true;
|
||||
/* Not being a fallback is better. */
|
||||
@@ -495,11 +495,11 @@ template <>
|
||||
return best->palette != PAL_DOS && current->palette == PAL_DOS;
|
||||
};
|
||||
|
||||
for (const GraphicsSet *c = BaseMedia<GraphicsSet>::available_sets; c != nullptr; c = c->next) {
|
||||
for (const auto &c : BaseMedia<GraphicsSet>::available_sets) {
|
||||
/* Skip unusable sets */
|
||||
if (c->GetNumMissing() != 0) continue;
|
||||
|
||||
if (IsBetter(c)) best = c;
|
||||
if (IsBetter(c.get())) best = c.get();
|
||||
}
|
||||
|
||||
BaseMedia<GraphicsSet>::used_set = best;
|
||||
|
||||
Reference in New Issue
Block a user