]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/part.cpp
Adapt to Collection API changes
[libs/gltk.git] / source / part.cpp
index 7eb19c7755f3a006bc7a81bc31d5c6841ce66361..127397924f19cf5039b2fe8f1b34df780be8ed8f 100644 (file)
@@ -18,7 +18,7 @@ Part::Part(const string &n):
 const Graphic *Part::get_graphic(State state) const
 {
        if(state>N_STATES_)
-               throw InvalidParameterValue("Invalid state");
+               throw invalid_argument("Part::get_graphic");
 
        return graphic[state];
 }
@@ -59,7 +59,7 @@ Part::Loader::~Loader()
 
 void Part::Loader::graphic(State s, const string &n)
 {
-       Graphic *grph = get_collection().get<Graphic>(n);
+       Graphic *grph = &get_collection().get<Graphic>(n);
        for(int i=0; i<N_STATES_; ++i)
                if((i&s)==s)
                        obj.graphic[i] = grph;