| 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 | { |
no test coverage detected