| 319 | } |
| 320 | |
| 321 | void LevelDebugLayer::update(float delta) |
| 322 | { |
| 323 | auto dir = Director::getInstance(); |
| 324 | auto winSize = dir->getWinSize(); |
| 325 | auto cam = Camera::getDefaultCamera(); |
| 326 | cam->setPosition(cam->getPosition() + (_camInput * _camSpeed * delta)); |
| 327 | _BG->setPosition({cam->getPosition().x, cam->getPosition().y - winSize.y / 2}); |
| 328 | |
| 329 | _colorChannels[1007]._color = getLightBG(_colorChannels[1000]._color, Color3B::MAGENTA); |
| 330 | |
| 331 | const double delta60 = delta * 60.0; |
| 332 | const double delta240 = delta60 * 4.0; |
| 333 | const float newStepCount = delta240 < 0.0 ? ceil(delta240 - 0.5) : floor(delta240 + 0.5); |
| 334 | int subStepCount = 4; |
| 335 | if (newStepCount >= 4.0) |
| 336 | { |
| 337 | subStepCount = static_cast<int>(newStepCount); |
| 338 | } |
| 339 | |
| 340 | const float stepDelta60 = delta60 / (float)subStepCount; |
| 341 | const double stepDelta = delta / (float)subStepCount; |
| 342 | |
| 343 | if (this->_colorChannels.contains(1000)) |
| 344 | { |
| 345 | this->_BG->setColor(this->_colorChannels.at(1000)._color); |
| 346 | } |
| 347 | |
| 348 | for (int curStep = 0; curStep < subStepCount; curStep++) |
| 349 | { |
| 350 | const bool isLastSubStep = curStep == (subStepCount - 1); |
| 351 | _effectManager->prepareMoveActions(stepDelta, !isLastSubStep); |
| 352 | this->processMoveActionsStep(stepDelta); |
| 353 | } |
| 354 | |
| 355 | updateVisibility(); |
| 356 | updateTriggers(delta); |
| 357 | } |
| 358 | |
| 359 | void LevelDebugLayer::updateTriggers(float dt) |
| 360 | { |
no test coverage detected