From 30c1cb3d5039578fda0453bc52076172ca5187cf Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Sat, 19 Nov 2016 12:23:31 +0100 Subject: [PATCH] fix(animation): Use defined base values --- src/drawtypes/animation.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/drawtypes/animation.cpp b/src/drawtypes/animation.cpp index 8580b17b..66900bc4 100644 --- a/src/drawtypes/animation.cpp +++ b/src/drawtypes/animation.cpp @@ -44,14 +44,17 @@ namespace drawtypes { name = string_util::ltrim(string_util::rtrim(name, '>'), '<'); + auto anim_defaults = load_optional_icon(conf, section, name); + if (required) frames = conf.get_list(section, name); else frames = conf.get_list(section, name, {}); - for (size_t i = 0; i < frames.size(); i++) - vec.emplace_back( - forward(load_optional_icon(conf, section, name + "-" + to_string(i), frames[i]))); + for (size_t i = 0; i < frames.size(); i++) { + vec.emplace_back(forward(load_optional_icon(conf, section, name + "-" + to_string(i), frames[i]))); + vec.back()->copy_undefined(anim_defaults); + } auto framerate = conf.get(section, name + "-framerate", 1000);