projects
/
synfig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8534448
)
Use iostream operators for load palette member instead of atof.
author
Carlos Lopez
<genetita@gmail.com>
Mon, 7 Jun 2010 16:14:26 +0000
(18:14 +0200)
committer
Carlos Lopez
<genetita@gmail.com>
Mon, 7 Jun 2010 16:14:26 +0000
(18:14 +0200)
synfig-core/src/synfig/palette.cpp
patch
|
blob
|
history
diff --git
a/synfig-core/src/synfig/palette.cpp
b/synfig-core/src/synfig/palette.cpp
index
427c4b6
..
0ce2717
100644
(file)
--- 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;
while(!file.eof())
{
PaletteItem item;
+ String n;
+ float r, g, b, a;
getline(file,item.name);
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);
}
ret.push_back(item);
}