| 188 | } |
| 189 | |
| 190 | const bgfx::Memory* Utils::loadFileToMemory(const char* _filePath) |
| 191 | { |
| 192 | if (bx::open(fileReader, _filePath)) |
| 193 | { |
| 194 | uint32_t size = (uint32_t)bx::getSize(fileReader); |
| 195 | const bgfx::Memory* mem = bgfx::alloc(size + 1); |
| 196 | bx::read(fileReader, mem->data, size); |
| 197 | bx::close(fileReader); |
| 198 | mem->data[mem->size - 1] = '\0'; |
| 199 | return mem; |
| 200 | } |
| 201 | |
| 202 | LogWarn() << "Failed to load file at: " << _filePath; |
| 203 | return NULL; |
| 204 | } |
| 205 | |
| 206 | std::string Utils::stripExtension(const std::string& fileName) |
| 207 | { |
nothing calls this directly
no outgoing calls
no test coverage detected