]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/part.cpp
Simplify constructors with C++11
[libs/gltk.git] / source / part.cpp
index 72c8921b1c03663181645623ac8485386afe83e8..21dacc64da547123209388128b0f246b4d6f8014 100644 (file)
@@ -11,9 +11,7 @@ namespace GLtk {
 
 Part::Part(const string &n):
        name(n)
-{
-       fill(graphic, graphic+N_STATES_, static_cast<Graphic *>(0));
-}
+{ }
 
 const Graphic *Part::get_graphic(State state) const
 {
@@ -31,7 +29,7 @@ void Part::build(const Geometry &parent, State state, PartCache &cache) const
        Geometry rgeom = geom;
        align.apply(rgeom, parent, margin);
        GL::MeshBuilder bld(cache.create_mesh(*this, *graphic[state]->get_texture()));
-       bld.matrix() *= GL::Matrix::translation(rgeom.x, rgeom.y, 0);
+       bld.transform(GL::Matrix::translation(rgeom.x, rgeom.y, 0));
        graphic[state]->build(rgeom.w, rgeom.h, bld);
 }