From 4a3d6b171c579c610458741f4d450e88a08982d1 Mon Sep 17 00:00:00 2001 From: remi-k Date: Sat, 14 Feb 2009 19:43:12 +0000 Subject: [PATCH] git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1017 4e206d99-4929-0410-ac5d-dfc041789085 --- python/PKG-INFO | 2 +- python/setup.py | 2 +- python/src/Color.cpp | 2 +- python/src/Drawable.cpp | 6 ++++++ python/src/Drawable.hpp | 3 +++ python/src/Image.cpp | 2 +- python/src/Input.cpp | 2 +- python/src/Rect.cpp | 4 ++-- python/src/Shape.cpp | 2 +- python/src/SoundBuffer.cpp | 2 +- python/src/WindowSettings.cpp | 2 +- python/src/main.cpp | 2 +- 12 files changed, 20 insertions(+), 11 deletions(-) diff --git a/python/PKG-INFO b/python/PKG-INFO index 7d48fe13b..354c67c19 100644 --- a/python/PKG-INFO +++ b/python/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: PySFML -Version: 1.4 +Version: 1.5 Summary: Python binding for SFML (Simple and Fast Multimedia Library) Home-page: http://sfml.sourceforge.net/ Author: Rémi Koenig diff --git a/python/setup.py b/python/setup.py index 125ed275a..bb05523f3 100644 --- a/python/setup.py +++ b/python/setup.py @@ -4,7 +4,7 @@ from distutils.core import setup, Extension setup(name='PySFML', - version='1.4', + version='1.5', description='Python binding for SFML (Simple and Fast Multimedia Library)', author='Rémi Koenig', author_email='remi.k2620@gmail.com', diff --git a/python/src/Color.cpp b/python/src/Color.cpp index 30e428ee0..1b3043299 100644 --- a/python/src/Color.cpp +++ b/python/src/Color.cpp @@ -145,7 +145,7 @@ PyTypeObject PySfColorType = { PySfColor * GetNewPySfColor() { - return PyObject_New(PySfColor, &PySfColorType); + return (PySfColor *)PySfColor_new(&PySfColorType, NULL, NULL); } void diff --git a/python/src/Drawable.cpp b/python/src/Drawable.cpp index 347e7f730..008e469a9 100644 --- a/python/src/Drawable.cpp +++ b/python/src/Drawable.cpp @@ -302,4 +302,10 @@ PyTypeObject PySfDrawableType = { PySfDrawable_new, /* tp_new */ }; +PySfDrawable * +GetNewPySfDrawable() +{ + return (PySfDrawable *)PySfDrawable_new(&PySfDrawableType, NULL, NULL); +} + diff --git a/python/src/Drawable.hpp b/python/src/Drawable.hpp index 8676d9dd8..2553b640a 100644 --- a/python/src/Drawable.hpp +++ b/python/src/Drawable.hpp @@ -50,5 +50,8 @@ typedef struct { CustomDrawable *obj; } PySfDrawable; +PySfDrawable * +GetNewPySfDrawable(); + #endif diff --git a/python/src/Image.cpp b/python/src/Image.cpp index 9991135f2..bd1f57d67 100644 --- a/python/src/Image.cpp +++ b/python/src/Image.cpp @@ -414,6 +414,6 @@ PySfImage_Copy(PySfImage* self, PyObject *args) PySfImage * GetNewPySfImage() { - return PyObject_New(PySfImage, &PySfImageType); + return (PySfImage *)PySfImage_new(&PySfImageType, NULL, NULL); } diff --git a/python/src/Input.cpp b/python/src/Input.cpp index e0162fb2b..7116731e4 100644 --- a/python/src/Input.cpp +++ b/python/src/Input.cpp @@ -162,6 +162,6 @@ PyTypeObject PySfInputType = { PySfInput * GetNewPySfInput() { - return PyObject_New(PySfInput, &PySfInputType); + return (PySfInput *)PySfInput_new(&PySfInputType, NULL, NULL); } diff --git a/python/src/Rect.cpp b/python/src/Rect.cpp index abd938ab1..46d03722b 100644 --- a/python/src/Rect.cpp +++ b/python/src/Rect.cpp @@ -425,13 +425,13 @@ PySfFloatRectUpdateSelf(PySfFloatRect *self) PySfIntRect * GetNewPySfIntRect() { - return PyObject_New(PySfIntRect, &PySfIntRectType); + return (PySfIntRect *)PySfIntRect_new(&PySfIntRectType, NULL, NULL); } PySfFloatRect * GetNewPySfFloatRect() { - return PyObject_New(PySfFloatRect, &PySfFloatRectType); + return (PySfFloatRect *)PySfFloatRect_new(&PySfFloatRectType, NULL, NULL); } diff --git a/python/src/Shape.cpp b/python/src/Shape.cpp index ad2bd5260..622e0f90e 100644 --- a/python/src/Shape.cpp +++ b/python/src/Shape.cpp @@ -391,6 +391,6 @@ PyTypeObject PySfShapeType = { PySfShape * GetNewPySfShape() { - return PyObject_New(PySfShape, &PySfShapeType); + return (PySfShape *)PySfShape_new(&PySfShapeType, NULL, NULL); } diff --git a/python/src/SoundBuffer.cpp b/python/src/SoundBuffer.cpp index cf651bde0..2d0fd5522 100644 --- a/python/src/SoundBuffer.cpp +++ b/python/src/SoundBuffer.cpp @@ -213,6 +213,6 @@ PySfSoundBuffer_init(PySfSoundBuffer *self, PyObject *args, PyObject *kwds) PySfSoundBuffer * GetNewPySfSoundBuffer() { - return PyObject_New(PySfSoundBuffer, &PySfSoundBufferType); + return (PySfSoundBuffer *)PySfSoundBuffer_new(&PySfSoundBufferType, NULL, NULL); } diff --git a/python/src/WindowSettings.cpp b/python/src/WindowSettings.cpp index f6e5be476..807e7d847 100644 --- a/python/src/WindowSettings.cpp +++ b/python/src/WindowSettings.cpp @@ -126,6 +126,6 @@ PyTypeObject PySfWindowSettingsType = { PySfWindowSettings * GetNewPySfWindowSettings() { - return PyObject_New(PySfWindowSettings, &PySfWindowSettingsType); + return (PySfWindowSettings *)PySfWindowSettings_new(&PySfWindowSettingsType, NULL, NULL); } diff --git a/python/src/main.cpp b/python/src/main.cpp index d879f4a76..86f3fae89 100644 --- a/python/src/main.cpp +++ b/python/src/main.cpp @@ -260,7 +260,7 @@ initsf(void) Py_INCREF(&PySfListenerType); PyModule_AddObject(m, "Listener", (PyObject *)&PySfListenerType); - PyModule_AddStringConstant(m, "Version", "1.4"); + PyModule_AddStringConstant(m, "Version", "1.5"); PySfColor_InitConst(); PySfKey_InitConst();