MCPcopy Create free account
hub / github.com/axmolengine/axmol / create

Method create

core/3d/Animation3D.cpp:35–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33{
34
35Animation3D* Animation3D::create(std::string_view fileName, std::string_view animationName)
36{
37 std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName);
38 fullPath.append("#").append(animationName);
39 auto animation = Animation3DCache::getInstance()->getAnimation(fullPath);
40 if (animation != nullptr)
41 return animation;
42
43 animation = new Animation3D();
44 if (animation->initWithFile(fileName, animationName))
45 {
46 animation->autorelease();
47 }
48 else
49 {
50 AX_SAFE_DELETE(animation);
51 }
52
53 return animation;
54}
55
56bool Animation3D::initWithFile(std::string_view filename, std::string_view animationName)
57{

Callers

nothing calls this directly

Calls 6

getInstanceFunction · 0.85
fullPathForFilenameMethod · 0.80
autoreleaseMethod · 0.80
appendMethod · 0.45
getAnimationMethod · 0.45
initWithFileMethod · 0.45

Tested by

no test coverage detected