| 22 | void draw(int x, int y) { _drawable.draw(_frameIdx, x, y); } |
| 23 | |
| 24 | void update(const std::chrono::duration<double> deltaTime) { |
| 25 | _frameTime += deltaTime.count(); |
| 26 | const auto framesToAdd = static_cast<uint32_t>(_frameTime / _animationSpeed); |
| 27 | _frameTime -= framesToAdd * _animationSpeed; |
| 28 | _frameIdx += framesToAdd; |
| 29 | _frameIdx %= _drawable.getFrameCount(); |
| 30 | } |
| 31 | |
| 32 | void setPalette(const Abyss::DataTypes::Palette &palette) { _drawable.setPalette(palette); } |
| 33 |
nothing calls this directly
no test coverage detected