MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / createParticleFromSource

Function createParticleFromSource

test/Particles.cpp:245–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245inline particles::IParticleDef::Ptr createParticleFromSource(const std::string& defName)
246{
247 auto decl = GlobalParticlesManager().findOrInsertParticleDef(defName);
248
249 auto source = createParticleSource();
250
251 decl::DeclarationBlockSyntax syntax;
252 syntax.typeName = "particle";
253 syntax.name = defName;
254 syntax.contents = source;
255 syntax.fileInfo = vfs::FileInfo("particles/", "export_particle_test.prt", vfs::Visibility::NORMAL);
256 decl->setBlockSyntax(syntax);
257 decl->getDepthHack(); // ensure the particle is parsed
258 decl->setFilename(os::getFilename(syntax.fileInfo.fullPath()));
259
260 return decl;
261}
262
263// Filename is the leaf name, relative to the particles/ folder
264inline void setParticleFilename(const particles::IParticleDef::Ptr& decl, const std::string& filename)

Callers 1

TEST_FFunction · 0.85

Calls 8

createParticleSourceFunction · 0.85
getFilenameFunction · 0.85
getDepthHackMethod · 0.80
fullPathMethod · 0.80
FileInfoClass · 0.50
setBlockSyntaxMethod · 0.45
setFilenameMethod · 0.45

Tested by

no test coverage detected