*/
#include <msp/core/except.h>
+#include <msp/fs/utils.h>
#include "resources.h"
using namespace std;
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>("graphic");
add_keyword<GL::Texture2D>("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;
}
};
Resources();
+ Resources(const FS::Path &);
+private:
+ void init();
+public:
void set_path(const FS::Path &);
const GL::Font &get_default_font() const;
private: