MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / parseBinaryArray

Function parseBinaryArray

radiantcore/model/import/openfbx/ofbx.cpp:2184–2209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2182
2183
2184template <typename T> static bool parseBinaryArray(const Property& property, std::vector<T>* out)
2185{
2186 assert(out);
2187 if (property.value.is_binary)
2188 {
2189 u32 count = property.getCount();
2190 int elem_size = 1;
2191 switch (property.type)
2192 {
2193 case 'd': elem_size = 8; break;
2194 case 'f': elem_size = 4; break;
2195 case 'i': elem_size = 4; break;
2196 default: return false;
2197 }
2198 int elem_count = sizeof(T) / elem_size;
2199 out->resize(count / elem_count);
2200
2201 if (count == 0) return true;
2202 return parseArrayRaw(property, &(*out)[0], int(sizeof((*out)[0]) * out->size()));
2203 }
2204 else
2205 {
2206 parseTextArray(property, out);
2207 return true;
2208 }
2209}
2210
2211
2212template <typename T> static bool parseDoubleVecData(Property& property, std::vector<T>* out_vec, std::vector<float>* tmp)

Callers 7

postprocessMethod · 0.85
postprocessMethod · 0.85
parseDoubleVecDataFunction · 0.85
parseVertexDataFunction · 0.85
parseGeometryMaterialsFunction · 0.85
parseGeometryFunction · 0.85
postprocessMethod · 0.85

Calls 5

parseArrayRawFunction · 0.85
parseTextArrayFunction · 0.85
getCountMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected