MCPcopy Create free account
hub / github.com/AbyssEngine/AbyssEngineOld / update

Method update

src/Abyss/Common/Animation.h:24–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

getFrameCountMethod · 0.80

Tested by

no test coverage detected