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