]> git.tdb.fi Git - libs/gl.git/blobdiff - source/builders/font.cpp
Add inline data items to the collection
[libs/gl.git] / source / builders / font.cpp
index 5990c57d7223771410edadcfb69a9df13ea39fe0..7281bf418aba8118ab479abf79778f542cb0fb4f 100644 (file)
@@ -1,5 +1,6 @@
 #include <msp/core/maputils.h>
 #include <msp/datafile/collection.h>
 #include <msp/core/maputils.h>
 #include <msp/datafile/collection.h>
+#include <msp/fs/utils.h>
 #include "bindable.h"
 #include "gl.h"
 #include "font.h"
 #include "bindable.h"
 #include "gl.h"
 #include "font.h"
@@ -26,7 +27,6 @@ Font::~Font()
 void Font::set_texture(const Texture2D &t)
 {
        texture = &t;
 void Font::set_texture(const Texture2D &t)
 {
        texture = &t;
-       texture.keep();
 }
 
 const Texture2D &Font::get_texture() const
 }
 
 const Texture2D &Font::get_texture() const
@@ -193,13 +193,13 @@ void Font::Loader::texture()
 {
        RefPtr<Texture2D> tex = new Texture2D;
        load_sub(*tex);
 {
        RefPtr<Texture2D> tex = new Texture2D;
        load_sub(*tex);
-       obj.texture = tex;
+       get_collection().add(FS::basename(get_source())+".tex2d", tex.get());
+       obj.texture = tex.release();
 }
 
 void Font::Loader::texture_ref(const string &name)
 {
        obj.texture = &get_collection().get<Texture2D>(name);
 }
 
 void Font::Loader::texture_ref(const string &name)
 {
        obj.texture = &get_collection().get<Texture2D>(name);
-       obj.texture.keep();
 }
 
 
 }