X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fresources.cpp;h=3e0f851d701e3b961a38b564a1280507861f0d77;hb=3d84860cb25cf05ed36ee6cbd07d9e58cee52422;hp=825fc2517875771874c564989ea9da04c27e144f;hpb=ae991f3bbd83fa0afff5e1fc31be50e1f2d17875;p=libs%2Fgltk.git diff --git a/source/resources.cpp b/source/resources.cpp index 825fc25..3e0f851 100644 --- a/source/resources.cpp +++ b/source/resources.cpp @@ -1,11 +1,3 @@ -/* $Id$ - -This file is part of libmspgltk -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - -#include #include #include "resources.h" @@ -15,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