- init();
-}
-
-Resources::Resources(const FS::Path &fn):
- path(FS::dirname(fn)),
- default_font(0)
-{
- init();
-
- DataFile::load(*this, fn.str());
-}
-
-void Resources::init()
-{
- add_keyword<Graphic>("graphic");
- add_keyword<GL::Texture2D>("texture");
-
- add_creator(&Resources::create_font);
- add_creator(&Resources::create_texture);
-}
-
-void Resources::set_path(const FS::Path &p)
-{
- /* XXX bad, should change Collection API to allow creators to form paths
- relative to the datafile location */
- path = p;
+ add_type<Graphic>().keyword("graphic");
+ add_type<GL::Texture2D>().keyword("texture");
+ add_type<GL::Font>().keyword("font");
+ add_type<Style>().keyword("style");