]> git.tdb.fi Git - libs/gltk.git/commitdiff
Adapt to Collection API changes
authorMikko Rasa <tdb@tdb.fi>
Wed, 21 Nov 2012 15:57:44 +0000 (17:57 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 21 Nov 2012 15:57:44 +0000 (17:57 +0200)
source/graphic.cpp
source/part.cpp
source/resources.cpp
source/widget.cpp

index 7b8128c5b61e22e05772a7cc1bef6467a706d040..005d30fb4ef8f7929326093766d49ae62332dcbe 100644 (file)
@@ -88,7 +88,7 @@ Graphic::Loader::Loader(Graphic &g, Resources &r):
 
 void Graphic::Loader::texture(const string &n)
 {
-       graph.texture = res.get<GL::Texture2D>(n);
+       graph.texture = &res.get<GL::Texture2D>(n);
        graph.slice = Geometry(0, 0, graph.texture->get_width(), graph.texture->get_height());
 }
 
index 0ba03a3d3e1d027e2e50021212db4b1cfabd8862..127397924f19cf5039b2fe8f1b34df780be8ed8f 100644 (file)
@@ -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;
index 869885fecd97e77ae3719399c8fd53d6690baef7..e83c1bb178e5adea2acc6525acfdc01c0b8b87f1 100644 (file)
@@ -24,11 +24,9 @@ Resources::Resources(const FS::Path &fn):
 
 void Resources::init()
 {
-       add_keyword<Graphic>("graphic");
-       add_keyword<GL::Texture2D>("texture");
-
-       add_creator(&Resources::create_font);
-       add_creator(&Resources::create_texture);
+       add_type<Graphic>().keyword("graphic");
+       add_type<GL::Texture2D>().keyword("texture").creator(&Resources::create_texture);
+       add_type<GL::Font>().creator(&Resources::create_font);
 }
 
 void Resources::set_path(const FS::Path &p)
@@ -75,7 +73,7 @@ Resources::Loader::Loader(Resources &r):
 
 void Resources::Loader::default_font(const string &name)
 {
-       res.default_font = res.get<GL::Font>(name);
+       res.default_font = &res.get<GL::Font>(name);
 }
 
 void Resources::Loader::font(const string &name)
index 1cb42e5cae15598cdd82ea25809913e59a8359e7..e929940f46655d97e98af351bece30151b0e7317 100644 (file)
@@ -97,7 +97,7 @@ void Widget::update_style()
                        sname += style_name;
                }
 
-               style = root->get_resources().get<Style>(sname);
+               style = &root->get_resources().get<Style>(sname);
        }
 
        on_style_change();