X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Fsrc%2Fsynfig%2Fpalette.cpp;h=96c2cebec1a77b99fc43b5d16efb0bf305540abf;hb=ccde400e7d43c5cab4c49f4455bc90415c912bea;hp=16742a41817129cb4256540946c4128f791b2171;hpb=adfc80c126f482d7ea2bac38001a2c4a7c7df88c;p=synfig.git diff --git a/synfig-core/src/synfig/palette.cpp b/synfig-core/src/synfig/palette.cpp index 16742a4..96c2ceb 100644 --- a/synfig-core/src/synfig/palette.cpp +++ b/synfig-core/src/synfig/palette.cpp @@ -6,6 +6,8 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2010 Nikita Kitaev +** Copyright (c) 2010 Carlos López ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -333,25 +335,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); }