MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / SetFromDesc

Method SetFromDesc

Source/Objects/prefab.cpp:43–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43bool Prefab::SetFromDesc(const EntityDescription& desc) {
44 bool ret = Group::SetFromDesc(desc);
45 if (ret) {
46 const EntityDescriptionField* l_prefab_locked = desc.GetField(EDF_PREFAB_LOCKED);
47 if (l_prefab_locked) {
48 l_prefab_locked->ReadBool(&prefab_locked);
49 }
50
51 const EntityDescriptionField* l_prefab_path = desc.GetField(EDF_PREFAB_PATH);
52 if (l_prefab_path) {
53 l_prefab_path->ReadPath(&prefab_path);
54 }
55
56 const EntityDescriptionField* l_original_scale = desc.GetField(EDF_ORIGINAL_SCALE);
57 if (l_original_scale) {
58 memread(original_scale_.entries, sizeof(float), 3, l_original_scale->data);
59 }
60
61 InitRelMats();
62 }
63 return ret;
64}
65
66void Prefab::GetDesc(EntityDescription& desc) const {
67 Group::GetDesc(desc);

Callers

nothing calls this directly

Calls 4

memreadFunction · 0.85
GetFieldMethod · 0.80
ReadBoolMethod · 0.80
ReadPathMethod · 0.80

Tested by

no test coverage detected