X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fresources.cpp;h=3e0f851d701e3b961a38b564a1280507861f0d77;hb=815194201203afd6fa59e650e1007a355c829544;hp=11fc1fabe8a0a467ba82019337cc2d2851674e42;hpb=2b70e8801c43875ed3f4135bdd0141265cff0312;p=libs%2Fgltk.git diff --git a/source/resources.cpp b/source/resources.cpp index 11fc1fa..3e0f851 100644 --- a/source/resources.cpp +++ b/source/resources.cpp @@ -1,4 +1,3 @@ -#include #include #include "resources.h" @@ -8,62 +7,22 @@ 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