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

Method LoadModelAsMorph

Source/Graphics/models.cpp:151–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151int Models::LoadModelAsMorph(const std::string& rel_path, int base_model_id, const std::string& base_model_name) {
152 MorphIndex index;
153 index.first = rel_path;
154 index.second = base_model_id;
155 MorphMap::iterator iter = morph_map_.find(index);
156 if (iter != morph_map_.end()) {
157 return iter->second;
158 }
159
160 int morph_model_id = AddModel();
161 Model& morph_model = GetModel(morph_model_id);
162 const std::string& name = base_model_name;
163 morph_model.LoadObjMorph(rel_path, name);
164 GetModelData(morph_model_id).name = std::string(rel_path);
165
166 GetModel(morph_model_id).CopyVertCollapse(GetModel(base_model_id));
167
168 morph_map_[index] = morph_model_id;
169
170 return morph_model_id;
171}
172
173void Models::Dispose() {
174 models.clear();

Callers 1

LoadMethod · 0.80

Calls 4

LoadObjMorphMethod · 0.80
CopyVertCollapseMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected