X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fresources.cpp;h=3e0f851d701e3b961a38b564a1280507861f0d77;hb=3d84860cb25cf05ed36ee6cbd07d9e58cee52422;hp=869885fecd97e77ae3719399c8fd53d6690baef7;hpb=c1faa54a3218b53757b8b55de0ff8aa64412253b;p=libs%2Fgltk.git diff --git a/source/resources.cpp b/source/resources.cpp index 869885f..3e0f851 100644 --- a/source/resources.cpp +++ b/source/resources.cpp @@ -7,35 +7,12 @@ namespace Msp { namespace GLtk { Resources::Resources(): - path("."), default_font(0) { - 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"); - add_keyword("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().keyword("graphic"); + add_type().keyword("texture"); + add_type().keyword("font"); + add_type