MCPcopy Create free account
hub / github.com/defold/defold / LoadParticlefxPrototype

Function LoadParticlefxPrototype

engine/gui/src/test/test_gui.cpp:4874–4895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4872}
4873
4874bool 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
4897void UnloadParticlefxPrototype(dmParticle::HPrototype prototype)
4898{

Callers 2

TEST_FFunction · 0.85
SetupGuiTestSceneFunction · 0.85

Calls 2

MakeHostPathfFunction · 0.85
NewPrototypeFunction · 0.85

Tested by

no test coverage detected