-/* $Id$
-
-This file is part of libmspgltk
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
-#include <msp/gl/transform.h>
+#include <msp/gl/meshbuilder.h>
- GL::translate(rgeom.x, rgeom.y, 0);
- graphic[state]->render(rgeom.w, rgeom.h);
+ GL::MeshBuilder bld(cache.create_mesh(*this, *graphic[state]->get_texture()));
+ bld.matrix() *= GL::Matrix::translation(rgeom.x, rgeom.y, 0);
+ graphic[state]->build(rgeom.w, rgeom.h, bld);
{
add("graphic", &Loader::graphic);
add("align", &Loader::align);
add("fill", &Loader::fill);
add("margin", &Loader::margin);
{
add("graphic", &Loader::graphic);
add("align", &Loader::align);
add("fill", &Loader::fill);
add("margin", &Loader::margin);
- const Sides &shadow=part.graphic[i]->get_shadow();
- part.geom.w=max(part.geom.w, part.graphic[i]->get_width()-shadow.left-shadow.right);
- part.geom.h=max(part.geom.h, part.graphic[i]->get_height()-shadow.bottom-shadow.top);
+ const Graphic &grph = *obj.graphic[i];
+ const Sides &shadow = grph.get_shadow();
+ obj.geom.w = max(obj.geom.w, grph.get_width()-shadow.left-shadow.right);
+ obj.geom.h = max(obj.geom.h, grph.get_height()-shadow.bottom-shadow.top);