]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/part.cpp
Add a missing colon to button.h
[libs/gltk.git] / source / part.cpp
index 45449932618ec8a692b9b7cd5f20e275e0ad285d..f5e4b79ef5c36a674f329fd9ca3dbc9a575c5e1c 100644 (file)
@@ -1,3 +1,10 @@
+/* $Id$
+
+This file is part of libmspgltk
+Copyright © 2007  Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
 #include "geometry.h"
 #include "part.h"
 #include "resources.h"
@@ -7,8 +14,7 @@ using namespace std;
 namespace Msp {
 namespace GLtk {
 
-Part::Part(const Resources &r, const string &n):
-       res(r),
+Part::Part(const string &n):
        name(n),
        width(1),
        height(1),
@@ -36,8 +42,9 @@ void Part::render(const Geometry &geom, State state) const
 }
 
 
-Part::Loader::Loader(Part &p):
-       part(p)
+Part::Loader::Loader(Part &p, Resources &r):
+       part(p),
+       res(r)
 {
        add("graphic", &Loader::graphic);
        add("align",   &Loader::align);
@@ -61,7 +68,7 @@ Part::Loader::~Loader()
 
 void Part::Loader::graphic(State s, const string &n)
 {
-       part.graphic[s]=&part.res.get_graphic(n);
+       part.graphic[s]=res.get<Graphic>(n);
 }
 
 void Part::Loader::align(int x, int y)