]> git.tdb.fi Git - libs/gl.git/blobdiff - source/text.cpp
Fix various issues with constant condition elimination
[libs/gl.git] / source / text.cpp
index 85647a83980b9fbc0bdf45514460859a8c98a6f2..dfb88e3fcc1e8553721eeaf100735cf616fe4f6f 100644 (file)
@@ -11,7 +11,8 @@ Text::Text(const Font &f, const Technique *tech):
        font(f),
        mesh((TEXCOORD2, VERTEX2)),
        horz_align(0.0f),
-       vert_offset(0.0f)
+       vert_offset(0.0f),
+       width(0.0f)
 {
        object.set_mesh(&mesh);
        if(tech)
@@ -23,7 +24,7 @@ void Text::set_technique(const Technique *tech)
        if(tech)
        {
                technique = *tech;
-               technique.replace_texture("diffusemap", font.get_texture());
+               technique.replace_texture("diffuse_map", font.get_texture());
                object.set_technique(&technique);
        }
        else
@@ -34,7 +35,7 @@ void Text::set_text(const string &text, StringCodec::Decoder &dec)
 {
        clear();
        width = font.get_string_width(text, dec);
-       GL::MeshBuilder bld(mesh);
+       MeshBuilder bld(mesh);
        bld.matrix() *= Matrix::translation(Vector3(-horz_align*width, vert_offset, 0.0f));
        font.build_string(text, dec, bld);
 }