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

Function LoadEnvDescriptionFromXML

Source/Game/EntityDescription.cpp:738–759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

736}
737
738void LoadEnvDescriptionFromXML(EntityDescription& desc, const TiXmlElement* el) {
739 desc.fields.reserve(6);
740 desc.AddEntityType(EDF_ENTITY_TYPE, _env_object);
741 const char* name = el->Attribute("name");
742 if (name) {
743 desc.AddString(EDF_NAME, name);
744 }
745
746 std::string type_file = SanitizePath(el->Attribute("type_file"));
747 desc.AddString(EDF_FILE_PATH, type_file);
748
749 const char* no_navmesh = el->Attribute("no_navmesh");
750 if (no_navmesh) {
751 desc.AddBool(EDF_NO_NAVMESH, saysTrue(no_navmesh) == 1);
752 } else {
753 desc.AddBool(EDF_NO_NAVMESH, false);
754 }
755
756 ColorTintComponent::LoadDescriptionFromXML(desc, el);
757
758 GetTSRIinfo(desc, el);
759}
760
761void LoadDecalDescriptionFromXML(EntityDescription& desc, const TiXmlElement* el) {
762 desc.AddEntityType(EDF_ENTITY_TYPE, _decal_object);

Callers 1

Calls 8

SanitizePathFunction · 0.85
saysTrueFunction · 0.85
GetTSRIinfoFunction · 0.85
AddEntityTypeMethod · 0.80
AddBoolMethod · 0.80
reserveMethod · 0.45
AttributeMethod · 0.45
AddStringMethod · 0.45

Tested by

no test coverage detected