]> git.tdb.fi Git - r2c2.git/commitdiff
Mscellaneous adaptations to mspgl API changes
authorMikko Rasa <tdb@tdb.fi>
Thu, 17 Jan 2013 13:42:59 +0000 (15:42 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 17 Jan 2013 13:42:59 +0000 (15:42 +0200)
source/3d/overlay.cpp
source/engineer/engineer.cpp

index c10a8db59121c31e35cf75d887a9172cf9f3ff90..bab469ca4cf0cb14bc3994d705498f01adf1e927 100644 (file)
@@ -84,7 +84,7 @@ void Overlay3D::render(GL::Renderer &renderer, const GL::Tag &) const
 
        glLineWidth(1);
 
-       int size = int(font.get_default_size()+0.5);
+       int size = int(font.get_native_size()+0.5);
        float spacing = round(size*1.1)/size;
        float baseline = round((0.5-font.get_ascent()*0.5-font.get_descent()*0.5)*size)/size;
 
@@ -183,7 +183,7 @@ void Overlay3D::update_icon(Icon &icon)
        {
                GL::MeshBuilder bld(icon.text);
                bld.color(0.0f, 1.0f, 0.0f);
-               font.draw_string(icon.label, bld);
+               font.build_string(icon.label, bld);
        }
 }
 
index 133aa2cc815174bf76211459af064d986803c2a6..bc32dfb848a52d92c4069aeb076760fc90d05182 100644 (file)
@@ -13,7 +13,6 @@
 #include <msp/gl/misc.h>
 #include <msp/gl/projection.h>
 #include <msp/gl/tests.h>
-#include <msp/gl/transform.h>
 #include <msp/io/print.h>
 #include <msp/strings/format.h>
 #include <msp/time/units.h>
@@ -225,13 +224,13 @@ void Engineer::tick()
 
        if(picking && picking_track && picking_entry>=0)
        {
-               GL::PushMatrix push_mat;
+               GL::MatrixStack::Push push_mat(GL::MatrixStack::modelview());
 
                float rot = picking_track->get_endpoint_direction(picking_entry);
                Vector pos = picking_track->get_endpoint_position(picking_entry);
 
-               GL::translate(pos.x, pos.y, pos.z+0.03);
-               GL::rotate(rot*180/M_PI+180, 0, 0, 1);
+               GL::MatrixStack::modelview() *= GL::Matrix::translation(pos.x, pos.y, pos.z+0.03);
+               GL::MatrixStack::modelview() *= GL::Matrix::rotation(rot+M_PI, 0, 0, 1);
 
                arrow_mesh.draw();
        }