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

Method MapDefault

src/newgrf/newgrf_act3.cpp:326–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324 }
325
326 void MapDefault(uint16_t local_id, const SpriteGroup *group) override
327 {
328 auto found = _cur_gps.grffile->badge_map.find(local_id);
329 if (found == std::end(_cur_gps.grffile->badge_map)) {
330 GrfMsg(1, "BadgeMapSpriteGroup: Badge {} undefined, skipping", local_id);
331 } else {
332 auto &badge = *GetBadge(found->second);
333 badge.grf_prop.SetSpriteGroup(GSF_DEFAULT, group);
334 badge.grf_prop.SetGRFFile(_cur_gps.grffile);
335 badge.grf_prop.local_id = local_id;
336 }
337 }
338};
339
340static void MapSpriteGroup(ByteReader &buf, uint8_t idcount, MapSpriteGroupHandler &&handler)

Callers

nothing calls this directly

Calls 5

GetBadgeFunction · 0.85
SetGRFFileMethod · 0.80
endFunction · 0.50
findMethod · 0.45
SetSpriteGroupMethod · 0.45

Tested by

no test coverage detected