From 4b8ae2b81711e84606d851962dea0653a29a4f10 Mon Sep 17 00:00:00 2001 From: groogy Date: Fri, 19 Nov 2010 08:33:30 +0000 Subject: [PATCH] Changed Window so where ever it uses SFML::Vector2 to access it's elements I use the helper functions. git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1674 4e206d99-4929-0410-ac5d-dfc041789085 --- bindings/ruby/sfml-window/window/Window.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bindings/ruby/sfml-window/window/Window.cpp b/bindings/ruby/sfml-window/window/Window.cpp index d0c4ee2fa..58c1d067a 100644 --- a/bindings/ruby/sfml-window/window/Window.cpp +++ b/bindings/ruby/sfml-window/window/Window.cpp @@ -323,8 +323,8 @@ static VALUE Window_SetCursorPosition2( VALUE self, VALUE anArgument ) VALUE argument = Vector2_ForceType( anArgument ); sf::Window *object = NULL; Data_Get_Struct( self, sf::Window, object ); - VALUE argumentX = rb_funcall( argument, rb_intern( "x" ), 0 ); - VALUE argumentY = rb_funcall( argument, rb_intern( "y" ), 0 ); + VALUE argumentX = Vector2_GetX( argument ); + VALUE argumentY = Vector2_GetY( argument ); object->SetCursorPosition( FIX2UINT( argumentX ), FIX2UINT( argumentY ) ); return Qnil; } @@ -431,8 +431,8 @@ static VALUE Window_SetPosition2( VALUE self, VALUE anArgument ) VALUE argument = Vector2_ForceType( anArgument ); sf::Window *object = NULL; Data_Get_Struct( self, sf::Window, object ); - VALUE argumentX = rb_funcall( argument, rb_intern( "x" ), 0 ); - VALUE argumentY = rb_funcall( argument, rb_intern( "y" ), 0 ); + VALUE argumentX = Vector2_GetX( argument ); + VALUE argumentY = Vector2_GetY( argument ); object->SetPosition( FIX2UINT( argumentX ), FIX2INT( argumentY ) ); return Qnil; } @@ -460,8 +460,8 @@ static VALUE Window_SetSize2( VALUE self, VALUE anArgument ) VALUE argument = Vector2_ForceType( anArgument ); sf::Window *object = NULL; Data_Get_Struct( self, sf::Window, object ); - VALUE argumentX = rb_funcall( argument, rb_intern( "x" ), 0 ); - VALUE argumentY = rb_funcall( argument, rb_intern( "y" ), 0 ); + VALUE argumentX = Vector2_GetX( argument ); + VALUE argumentY = Vector2_GetY( argument ); object->SetSize( FIX2UINT( argumentX ), FIX2UINT( argumentY ) ); return Qnil; }