From: Carlos Lopez Date: Mon, 7 Jun 2010 16:14:26 +0000 (+0200) Subject: Use iostream operators for load palette member instead of atof. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=1060f208f853d1996f796a94e0f9fc0a6504943e;p=synfig.git Use iostream operators for load palette member instead of atof. --- diff --git a/synfig-core/src/synfig/palette.cpp b/synfig-core/src/synfig/palette.cpp index 427c4b6..0ce2717 100644 --- a/synfig-core/src/synfig/palette.cpp +++ b/synfig-core/src/synfig/palette.cpp @@ -333,25 +333,15 @@ Palette::load_from_file(const synfig::String& filename) while(!file.eof()) { PaletteItem item; + String n; + float r, g, b, a; getline(file,item.name); - if(file.eof())break; - - getline(file,line); - if(file.eof())break; - item.color.set_r(atof(line.c_str())); - - getline(file,line); - if(file.eof())break; - item.color.set_g(atof(line.c_str())); - - getline(file,line); - if(file.eof())break; - item.color.set_b(atof(line.c_str())); - - getline(file,line); - if(file.eof())break; - item.color.set_a(atof(line.c_str())); - + file>>r>>g>>b>>a; + item.color.set_r(r); + item.color.set_g(g); + item.color.set_b(b); + item.color.set_a(a); + if(file.eof()) break; ret.push_back(item); }