Graphic::Loader::Loader(Graphic &g, Resources &r):
- graph(g),
- res(r)
+ DataFile::CollectionObjectLoader<Graphic, Resources>(g, &r)
{
add("texture", &Loader::texture);
add("slice", &Loader::slice);
void Graphic::Loader::texture(const string &n)
{
- graph.texture = &res.get<GL::Texture2D>(n);
- graph.slice = Geometry(0, 0, graph.texture->get_width(), graph.texture->get_height());
+ obj.texture = &get_collection().get<GL::Texture2D>(n);
+ obj.slice = Geometry(0, 0, obj.texture->get_width(), obj.texture->get_height());
}
void Graphic::Loader::slice(unsigned x, unsigned y, unsigned w, unsigned h)
{
- graph.slice = Geometry(x, y, w, h);
+ obj.slice = Geometry(x, y, w, h);
}
void Graphic::Loader::border()
{
- load_sub(graph.border);
+ load_sub(obj.border);
}
void Graphic::Loader::shadow()
{
- load_sub(graph.shadow);
+ load_sub(obj.shadow);
}
} // namespace GLtk