| 344 | |
| 345 | |
| 346 | void 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 | |
| 382 | void GameObject::update() |
| 383 | { |
nothing calls this directly
no test coverage detected