]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/style.cpp
Style update: add spaces around assignments
[libs/gltk.git] / source / style.cpp
index b4ee82d10eff5d1e454ebf767430d0edd941ed17..0bc931188e7e93ee9356cae9e90bf79112d27ecd 100644 (file)
@@ -1,3 +1,10 @@
+/* $Id$
+
+This file is part of libmspgltk
+Copyright © 2007  Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
 #include "resources.h"
 #include "style.h"
 
@@ -6,8 +13,8 @@ using namespace std;
 namespace Msp {
 namespace GLtk {
 
-Style::Style():
-       font(0)
+Style::Style(Resources &r):
+       font(&r.get_default_font())
 { }
 
 
@@ -18,14 +25,22 @@ Style::Loader::Loader(Style &s, Resources &r):
        add("font",       &Style::font);
        add("font_color", &Loader::font_color);
        add("part",       &Loader::part);
+       add("special",    &Loader::special);
 }
 
 void Style::Loader::font_color(float r, float g, float b)
 {
-       style.font_color=GL::Color(r, g, b);
+       style.font_color = GL::Color(r, g, b);
+}
+
+void Style::Loader::part()
+{
+       Part p((string()));
+       load_sub(p, res);
+       style.parts.push_back(p);
 }
 
-void Style::Loader::part(const string &n)
+void Style::Loader::special(const string &n)
 {
        Part p(n);
        load_sub(p, res);