Split __init__ into __init__ and __new__, code clean up
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1056 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
15ba8f9b3c
commit
d4e7e7724f
30 changed files with 305 additions and 542 deletions
|
@ -50,7 +50,9 @@ static PyObject *
|
|||
PySfWindow_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
PySfWindow *self;
|
||||
self = (PySfWindow *)type->tp_alloc(type, 0);
|
||||
self = (PySfWindow *)type->tp_alloc(type, 0);
|
||||
if (self != NULL)
|
||||
self->obj = new sf::Window();
|
||||
return (PyObject *)self;
|
||||
}
|
||||
|
||||
|
@ -128,9 +130,8 @@ PySfWindow_Create(PySfWindow* self, PyObject *args, PyObject *kwds)
|
|||
|
||||
static int
|
||||
PySfWindow_init(PySfWindow *self, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
self->obj = new sf::Window();
|
||||
if (PyTuple_Size(args) > 0)
|
||||
{
|
||||
if (args != NULL)
|
||||
if (PySfWindow_Create(self, args, kwds) == NULL)
|
||||
return -1;
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue