MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / applyColorChannel

Method applyColorChannel

Source/GameObject.cpp:346–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344
345
346void GameObject::applyColorChannel(ax::Sprite* sprite, int channelType, float opacityMultiplier, SpriteColor* col)
347{
348 if (!sprite || !col) return;
349
350 float op = col->_opacity * opacityMultiplier * _effectOpacityMultipler;
351
352 switch (channelType)
353 {
354 case 0:
355 if(getOpacity() != op)
356 sprite->setOpacity(op);
357 if ((sprite->getBlendFunc() == GameToolbox::getBlending()) != col->_blending)
358 removeFromGameLayer();
359 break;
360 case 1:
361 if (getOpacity() != op)
362 sprite->setOpacity(op);
363 if ((sprite->getBlendFunc() == GameToolbox::getBlending()) != col->_blending)
364 removeFromGameLayer();
365 break;
366 default:
367 if (getOpacity() != op)
368 sprite->setOpacity(op);
369 break;
370 }
371
372 if (col->_blending)
373 sprite->setBlendFunc(GameToolbox::getBlending());
374 else
375 sprite->setBlendFunc(BlendFunc::DISABLE);
376
377 Color3B finalColor = getChannelColor(col);
378
379 _tempColor = finalColor;
380}
381
382void GameObject::update()
383{

Callers

nothing calls this directly

Calls 1

setOpacityMethod · 0.80

Tested by

no test coverage detected