Set the description of some parameters
[synfig.git] / synfig-core / src / synfig / palette.cpp
index 16742a4..96c2ceb 100644 (file)
@@ -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);
        }