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

Method newBlend

tests/cpp-tests/Source/LayerTest/LayerTest.cpp:425–445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423}
424
425void LayerTestBlend::newBlend(float dt)
426{
427 auto layer = (LayerColor*)getChildByTag(kTagLayer);
428
429 backend::BlendFactor src;
430 backend::BlendFactor dst;
431
432 if (layer->getBlendFunc().dst == backend::BlendFactor::ZERO)
433 {
434 src = backend::BlendFactor::SRC_ALPHA;
435 dst = backend::BlendFactor::ONE_MINUS_SRC_ALPHA;
436 }
437 else
438 {
439 src = backend::BlendFactor::ONE_MINUS_DST_COLOR;
440 dst = backend::BlendFactor::ZERO;
441 }
442
443 BlendFunc bf = {src, dst};
444 layer->setBlendFunc(bf);
445}
446
447std::string LayerTestBlend::subtitle() const
448{

Callers

nothing calls this directly

Calls 2

getChildByTagFunction · 0.85
setBlendFuncMethod · 0.45

Tested by

no test coverage detected