MCPcopy Create free account
hub / github.com/crownengine/crown / parse_indices

Function parse_indices

src/resource/mesh_resource.cpp:253–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251 }
252
253 s32 parse_indices(Geometry &g, const char *json, CompileOptions &opts)
254 {
255 CE_UNUSED(opts);
256
257 TempAllocator4096 ta;
258 JsonObject obj(ta);
259 RETURN_IF_ERROR(sjson::parse(obj, json));
260
261 JsonArray data_json(ta);
262 RETURN_IF_ERROR(sjson::parse_array(data_json, obj["data"]));
263
264 parse_index_array(g._position_indices, data_json[0]);
265
266 u32 idx = 1;
267
268 if (has_normals(g))
269 parse_index_array(g._normal_indices, data_json[idx++]);
270
271 if (has_uvs(g))
272 parse_index_array(g._uv_indices, data_json[idx++]);
273
274 if (has_tangents(g))
275 parse_index_array(g._tangent_indices, data_json[idx++]);
276
277 if (has_bitangents(g))
278 parse_index_array(g._bitangent_indices, data_json[idx++]);
279
280 return 0;
281 }
282
283 s32 parse_geometry(Geometry &g, const char *sjson, CompileOptions &opts)
284 {

Callers 1

parse_geometryFunction · 0.85

Calls 7

parse_index_arrayFunction · 0.85
has_normalsFunction · 0.85
has_uvsFunction · 0.85
has_tangentsFunction · 0.85
has_bitangentsFunction · 0.85
parseFunction · 0.70
parse_arrayFunction · 0.50

Tested by

no test coverage detected