Some refactoring, moved C++ allocation into the *_Alloc function instead of directly in new, removed new in most of classes too. Cloning should work on all copyable classes now.
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1802 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
0a2abc6933
commit
7d7c4c999f
26 changed files with 235 additions and 301 deletions
|
@ -300,17 +300,10 @@ static VALUE RenderImage_Initialize( int argc, VALUE *args, VALUE self )
|
|||
return self;
|
||||
}
|
||||
|
||||
/* call-seq:
|
||||
* RenderImage.new() -> render_image
|
||||
*
|
||||
* Constructs an empty, invalid render-image. You must call create() to have a valid render-image.
|
||||
*/
|
||||
static VALUE RenderImage_New( int argc, VALUE *args, VALUE aKlass )
|
||||
static VALUE RenderImage_Alloc( VALUE aKlass )
|
||||
{
|
||||
sf::RenderImage *object = new sf::RenderImage();
|
||||
VALUE rbData = Data_Wrap_Struct( aKlass, 0, RenderImage_Free, object );
|
||||
rb_obj_call_init( rbData, argc, args );
|
||||
return rbData;
|
||||
return Data_Wrap_Struct( aKlass, 0, RenderImage_Free, object );
|
||||
}
|
||||
|
||||
/* call-seq:
|
||||
|
@ -396,7 +389,8 @@ void Init_RenderImage( void )
|
|||
rb_include_module( globalRenderImageClass, globalRenderTargetModule );
|
||||
|
||||
// Class methods
|
||||
rb_define_singleton_method( globalRenderImageClass, "new", RenderImage_New, 0 );
|
||||
//rb_define_singleton_method( globalRenderImageClass, "new", RenderImage_New, 0 );
|
||||
rb_define_alloc_func( globalRenderImageClass, RenderImage_Alloc );
|
||||
rb_define_singleton_method( globalRenderImageClass, "isAvailable", RenderImage_IsAvailable, 0 );
|
||||
|
||||
// Instance methods
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue