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

Method createParticleNode

radiantcore/particles/ParticlesManager.cpp:47–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47IParticleNodePtr ParticlesManager::createParticleNode(const std::string& name)
48{
49 std::string nameCleaned = name;
50
51 // Cut off the ".prt" from the end of the particle name
52 if (string::ends_with(nameCleaned, ".prt"))
53 {
54 nameCleaned = nameCleaned.substr(0, nameCleaned.length() - 4);
55 }
56
57 auto def = getDefByName(nameCleaned);
58
59 if (!def)
60 {
61 return IParticleNodePtr();
62 }
63
64 return std::make_shared<ParticleNode>(std::make_shared<RenderableParticle>(def));
65}
66
67IRenderableParticlePtr ParticlesManager::getRenderableParticle(const std::string& name)
68{

Callers 3

TEST_FFunction · 0.80
SetPreviewDeclNameMethod · 0.80
getModelNodeMethod · 0.80

Calls 2

ends_withFunction · 0.85
lengthMethod · 0.80

Tested by

no test coverage detected