diff options
Diffstat (limited to 'src/resources/animation.cpp')
-rw-r--r-- | src/resources/animation.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/resources/animation.cpp b/src/resources/animation.cpp index 1be27c2c..b48e8cff 100644 --- a/src/resources/animation.cpp +++ b/src/resources/animation.cpp @@ -23,8 +23,12 @@ void Animation::addFrame(Image *image, int delay, int offsetX, int offsetY) { - Frame frame = { image, delay, offsetX, offsetY }; - mFrames.push_back(frame); + auto &frame = mFrames.emplace_back(); + frame.image = image; + frame.delay = delay; + frame.offsetX = offsetX; + frame.offsetY = offsetY; + mDuration += delay; } |