| 263 | } |
| 264 | |
| 265 | bool LoadPrototype(const char* filename, dmParticle::HPrototype* prototype) |
| 266 | { |
| 267 | char path[128]; |
| 268 | dmTestUtil::MakeHostPathf(path, sizeof(path), "build/src/test/%s", filename); |
| 269 | |
| 270 | const uint32_t MAX_FILE_SIZE = 4 * 1024; |
| 271 | unsigned char buffer[MAX_FILE_SIZE]; |
| 272 | uint32_t file_size = 0; |
| 273 | |
| 274 | FILE* f = fopen(path, "rb"); |
| 275 | if (f) |
| 276 | { |
| 277 | file_size = fread(buffer, 1, MAX_FILE_SIZE, f); |
| 278 | fclose(f); |
| 279 | *prototype = dmParticle::NewPrototype(buffer, file_size); |
| 280 | return *prototype != 0x0; |
| 281 | } |
| 282 | else |
| 283 | { |
| 284 | dmLogWarning("Particle FX could not be loaded: %s.", path); |
| 285 | return false; |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | bool LoadPrototypeFromDDF(const char* filename, dmParticle::HPrototype* prototype) |
| 290 | { |
no test coverage detected