.doc/ext/rays/font.cpp in rays-0.1.7 vs .doc/ext/rays/font.cpp in rays-0.1.8

- old
+ new

@@ -8,17 +8,15 @@ using namespace Rucy; using Rays::coord; -static Class cFont; +RUCY_DEFINE_VALUE_FROM_TO(Rays::Font) -RUCY_DEFINE_VALUE_FROM_TO(Rays::Font, cFont) - #define THIS to<Rays::Font*>(self) -#define CHECK RUCY_CHECK_OBJECT(Rays::Font, cFont, self) +#define CHECK RUCY_CHECK_OBJECT(Rays::Font, self) static VALUE alloc(VALUE klass) { @@ -26,11 +24,11 @@ } static VALUE initialize(VALUE self) { - RUCY_CHECK_OBJ(Rays::Font, cFont, self); + RUCY_CHECK_OBJ(Rays::Font, self); check_arg_count(__FILE__, __LINE__, "Font#initialize", argc, 0, 1, 2); const char* name = (argc >= 1) ? argv[0].c_str() : NULL; float size = (argc >= 2) ? to<float>(argv[1]) : 0; *THIS = Rays::Font(name, size); @@ -39,11 +37,11 @@ } static VALUE initialize_copy(VALUE self, VALUE obj) { - RUCY_CHECK_OBJ(Rays::Font, cFont, self); + RUCY_CHECK_OBJ(Rays::Font, self); *THIS = to<Rays::Font&>(obj).copy(); return self; } @@ -73,9 +71,11 @@ { CHECK; return value(THIS->get_height()); } + +static Class cFont; void Init_font () { Module mRays = rb_define_module("Rays");