Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Apr 15, 2017
1 parent 06c9e59 commit 47c6cbe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
22 changes: 8 additions & 14 deletions src/units/frame.cpp
Expand Up @@ -70,13 +70,10 @@ frame_builder::frame_builder(const config& cfg,const std::string& frame_string)
base::primary_frame = cfg[frame_string + "primary"].to_bool();
}

std::vector<std::string> color = utils::split(cfg[frame_string + "text_color"]);
if(color.size() == 3) {
try {
text_color = color_t(std::stoi(color[0]), std::stoi(color[1]), std::stoi(color[2]));
} catch(std::invalid_argument) {
ERR_NG << "Invalid RGB color value in unit animation: " << color[0] << ", " << color[1] << ", " << color[2] << "\n";
}
try {
text_color = color_t::from_rgb_string(cfg[frame_string + "text_color"]);
} catch(std::invalid_argument) {
ERR_NG << "Invalid RGB color value in unit animation: " << cfg[frame_string + "text_color"] << "\n";
}

if(const config::attribute_value* v = cfg.get(frame_string + "duration")) {
Expand All @@ -93,13 +90,10 @@ frame_builder::frame_builder(const config& cfg,const std::string& frame_string)

base::duration = std::max(base::duration, 1);

color = utils::split(cfg[frame_string + "blend_color"]);
if(color.size() == 3) {
try {
base::blend_with = color_t(std::stoi(color[0]), std::stoi(color[1]), std::stoi(color[2]));
} catch(std::invalid_argument) {
ERR_NG << "Invalid RGB color value in unit animation: " << color[0] << ", " << color[1] << ", " << color[2] << "\n";
}
try {
base::blend_with = color_t::from_rgb_string(cfg[frame_string + "blend_color"]);
} catch(std::invalid_argument) {
ERR_NG << "Invalid RGB color value in unit animation: " << cfg[frame_string + "blend_color"] << "\n";
}
}

Expand Down
1 change: 1 addition & 0 deletions src/units/frame.hpp
Expand Up @@ -102,6 +102,7 @@ struct basic_frame_parameters {

/** All parameters from a frame at a given instant */
using frame_parameters = basic_frame_parameters<int, double, std::string, image::locator>;

using builder_frame_parameters = basic_frame_parameters<std::string, std::string, std::string, std::string>;
using parsed_frame_parameters = basic_frame_parameters<progressive_int, progressive_double, progressive_string, progressive_image>;

Expand Down

0 comments on commit 47c6cbe

Please sign in to comment.