X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpart.cpp;h=f5e4b79ef5c36a674f329fd9ca3dbc9a575c5e1c;hb=c2635c5a3dca6a6cea5562fd387beb0662b18cf0;hp=45449932618ec8a692b9b7cd5f20e275e0ad285d;hpb=c062ca892fc6e10f74a76991b5d4b4349c046b5f;p=libs%2Fgltk.git diff --git a/source/part.cpp b/source/part.cpp index 4544993..f5e4b79 100644 --- a/source/part.cpp +++ b/source/part.cpp @@ -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(n); } void Part::Loader::align(int x, int y)