| 5 | namespace Piccolo |
| 6 | { |
| 7 | Bone* find_by_index(Bone* bones, int key, int size, bool is_flat) |
| 8 | { |
| 9 | if (key == std::numeric_limits<int>::max()) |
| 10 | return nullptr; |
| 11 | if (is_flat) |
| 12 | { |
| 13 | if (key >= size) |
| 14 | return nullptr; |
| 15 | else |
| 16 | return &bones[key]; |
| 17 | } |
| 18 | else |
| 19 | { |
| 20 | for (int i = 0; i < size; i++) |
| 21 | { |
| 22 | if (bones[i].getID() == key) |
| 23 | return &bones[i]; |
| 24 | } |
| 25 | } |
| 26 | return nullptr; |
| 27 | } |
| 28 | |
| 29 | std::shared_ptr<RawBone> find_by_index(std::vector<std::shared_ptr<RawBone>>& bones, int key, bool is_flat) |
| 30 | { |
no test coverage detected