* Find data of a requested resource. * @param name Name of the resource to retrieve. * @param [out] data Address of the resource data, if found. * @param [out] Length of the resource data, if found. * @return Whether the resource could be retrieved. */
| 57 | * @return Whether the resource could be retrieved. |
| 58 | */ |
| 59 | bool loadResource(const std::string &name, unsigned char const**data, size_t *length) |
| 60 | { |
| 61 | bool result = false; |
| 62 | |
| 63 | for(int i = 0; i < resource_descriptors_length; ++i) |
| 64 | { |
| 65 | if(name.compare(resource_descriptors[i].filename) == 0) |
| 66 | { |
| 67 | *data = resource_descriptors[i].data; |
| 68 | *length = resource_descriptors[i].length; |
| 69 | result = true; |
| 70 | break; |
| 71 | } |
| 72 | } |
| 73 | return result; |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Get resource data into a supplied buffer. |
no outgoing calls
no test coverage detected