| 4872 | } |
| 4873 | |
| 4874 | bool LoadParticlefxPrototype(const char* filename, dmParticle::HPrototype* prototype) |
| 4875 | { |
| 4876 | char path[128]; |
| 4877 | dmTestUtil::MakeHostPathf(path, sizeof(path), "build/src/test/%s", filename); |
| 4878 | const uint32_t MAX_FILE_SIZE = 4 * 1024; |
| 4879 | unsigned char buffer[MAX_FILE_SIZE]; |
| 4880 | uint32_t file_size = 0; |
| 4881 | |
| 4882 | FILE* f = fopen(path, "rb"); |
| 4883 | if (f) |
| 4884 | { |
| 4885 | file_size = fread(buffer, 1, MAX_FILE_SIZE, f); |
| 4886 | *prototype = dmParticle::NewPrototype(buffer, file_size); |
| 4887 | fclose(f); |
| 4888 | return *prototype != 0x0; |
| 4889 | } |
| 4890 | else |
| 4891 | { |
| 4892 | dmLogWarning("Particle FX could not be loaded: %s.", path); |
| 4893 | return false; |
| 4894 | } |
| 4895 | } |
| 4896 | |
| 4897 | void UnloadParticlefxPrototype(dmParticle::HPrototype prototype) |
| 4898 | { |
no test coverage detected