From 961a417fb6558e32f718e1742795cb02d8556f52 Mon Sep 17 00:00:00 2001 From: groogy Date: Fri, 19 Nov 2010 08:46:00 +0000 Subject: [PATCH] Updated SFML::Rect to use the new helper functions. git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1675 4e206d99-4929-0410-ac5d-dfc041789085 --- bindings/ruby/sfml-graphics/graphics/Rect.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bindings/ruby/sfml-graphics/graphics/Rect.cpp b/bindings/ruby/sfml-graphics/graphics/Rect.cpp index a5b9aae6..56e763ba 100644 --- a/bindings/ruby/sfml-graphics/graphics/Rect.cpp +++ b/bindings/ruby/sfml-graphics/graphics/Rect.cpp @@ -103,8 +103,8 @@ static VALUE Rect_Contains( int argc, VALUE * args, VALUE self ) switch( argc ) { case 1: - pointX = rb_funcall( args[0], rb_intern( "x" ), 0 ); - pointY = rb_funcall( args[0], rb_intern( "y" ), 0 ); + pointX = Vector2_GetX( args[0] ); + pointY = Vector2_GetY( args[0] ); break; case 2: VALIDATE_CLASS( args[0], rb_cNumeric, "x" ); @@ -222,10 +222,10 @@ static VALUE Rect_Initialize( int argc, VALUE *args, VALUE self ) case 2: arg0 = Vector2_ForceType( args[0] ); arg1 = Vector2_ForceType( args[1] ); - rb_iv_set( self, "@left", rb_funcall( arg0, rb_intern( "x" ), 0 ) ); - rb_iv_set( self, "@top", rb_funcall( arg0, rb_intern( "y" ), 0 ) ); - rb_iv_set( self, "@width", rb_funcall( arg1, rb_intern( "x" ), 0 ) ); - rb_iv_set( self, "@height", rb_funcall( arg1, rb_intern( "y" ), 0 ) ); + rb_iv_set( self, "@left", Vector2_GetX( arg0 ) ); + rb_iv_set( self, "@top", Vector2_GetY( arg0 ) ); + rb_iv_set( self, "@width", Vector2_GetX( arg1 ) ); + rb_iv_set( self, "@height", Vector2_GetY( arg1 ) ); break; case 4: Rect_internal_ValidateTypes( args[0], args[1], args[2], args[3] ); @@ -235,7 +235,7 @@ static VALUE Rect_Initialize( int argc, VALUE *args, VALUE self ) rb_iv_set( self, "@height", args[3]); break; default: - rb_raise( rb_eArgError, "Expected 0, 3 or 4 arguments but was given %d", argc ); + rb_raise( rb_eArgError, "Expected 0, 1, 2 or 4 arguments but was given %d", argc ); } rb_iv_set( self, "@dataType", CLASS_OF( rb_iv_get( self, "@left" ) ) );