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

Function getDefaultTexture

core/2d/ParticleExamples.cpp:40–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38//
39
40static Texture2D* getDefaultTexture()
41{
42 Texture2D* texture = nullptr;
43 Image* image = nullptr;
44 do
45 {
46 const std::string key = "/__firePngData";
47 texture = Director::getInstance()->getTextureCache()->getTextureForKey(key);
48 AX_BREAK_IF(texture != nullptr);
49
50 image = new Image();
51 bool ret = image->initWithImageData(__firePngData, sizeof(__firePngData));
52 AX_BREAK_IF(!ret);
53
54 texture = Director::getInstance()->getTextureCache()->addImage(image, key);
55 } while (0);
56
57 AX_SAFE_RELEASE(image);
58
59 return texture;
60}
61
62ParticleFire* ParticleFire::create()
63{

Callers 1

Calls 5

getInstanceFunction · 0.85
getTextureForKeyMethod · 0.80
getTextureCacheMethod · 0.80
initWithImageDataMethod · 0.45
addImageMethod · 0.45

Tested by

no test coverage detected