]> git.tdb.fi Git - libs/gl.git/blobdiff - source/builders/font.cpp
Change various generated texture names to use the unified extension
[libs/gl.git] / source / builders / font.cpp
index dfa6bf9cf953685c2472c29b29788447e53e6642..aac416ba5b55b4958b45bcfe67319bbbcd99120e 100644 (file)
@@ -1,7 +1,6 @@
 #include <msp/core/maputils.h>
 #include <msp/datafile/collection.h>
 #include <msp/fs/utils.h>
-#include "gl.h"
 #include "font.h"
 #include "primitivebuilder.h"
 #include "texture2d.h"
@@ -11,18 +10,6 @@ using namespace std;
 namespace Msp {
 namespace GL {
 
-Font::Font():
-       native_size(1),
-       ascent(1),
-       descent(0),
-       cap_height(1),
-       x_height(0.5)
-{ }
-
-// Avoid synthesizing ~RefPtr in files including font.h
-Font::~Font()
-{ }
-
 void Font::set_texture(const Texture2D &t)
 {
        texture = &t;
@@ -130,33 +117,8 @@ unsigned Font::get_ligature(unsigned code, unsigned next) const
 }
 
 
-Font::Glyph::Glyph():
-       code(0),
-       x1(0),
-       y1(0),
-       x2(1),
-       y2(1),
-       w(1),
-       h(1),
-       off_x(0),
-       off_y(0),
-       advance(1)
-{ }
-
-
-Font::Loader::Loader(Font &f):
-       DataFile::CollectionObjectLoader<Font>(f, 0)
-{
-       init();
-}
-
 Font::Loader::Loader(Font &f, Collection &c):
        DataFile::CollectionObjectLoader<Font>(f, &c)
-{
-       init();
-}
-
-void Font::Loader::init()
 {
        add("native_size", &Font::native_size);
        add("ascent",      &Font::ascent);
@@ -192,7 +154,7 @@ void Font::Loader::texture()
 {
        RefPtr<Texture2D> tex = new Texture2D;
        load_sub(*tex);
-       get_collection().add(FS::basename(get_source())+".tex2d", tex.get());
+       get_collection().add(FS::basename(get_source())+".tex", tex.get());
        obj.texture = tex.release();
 }