Module: synfig
Branch: nikitakit_restructure
Commit: 1060f208f853d1996f796a94e0f9fc0a6504943e
URL:    
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig;a=commit;h=1060f208f853d1996f796a94e0f9fc0a6504943e

Author: Carlos Lopez <[email protected]>
Date:   Mon Jun  7 18:14:26 2010 +0200

Use iostream operators for load palette member instead of atof.

---

 synfig-core/src/synfig/palette.cpp |   26 ++++++++------------------
 1 files changed, 8 insertions(+), 18 deletions(-)

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);
        }
 


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to