[SCM] Python bindings for the SFML Library branch, upstream, updated. upstream/1.2-3-g5e2a046

Christoph Egger Christoph.Egger at gmx.de
Sun Jan 25 15:50:14 UTC 2009


The following commit has been merged in the upstream branch:
commit 5e2a0468d90dca37c2b1020affc5cc57d771071b
Author: Christoph Egger <Christoph.Egger at gmx.de>
Date:   Sun Jan 25 15:47:41 2009 +0100

    Imported Upstream version 1.4

diff --git a/python/MANIFEST.in b/python/MANIFEST.in
deleted file mode 100644
index a0c972c..0000000
--- a/python/MANIFEST.in
+++ /dev/null
@@ -1,69 +0,0 @@
-setup.py
-include src/Blend.cpp
-include src/Clock.cpp
-include src/Color.cpp
-include src/Drawable.cpp
-include src/Event.cpp
-include src/Image.cpp
-include src/Input.cpp
-include src/Joy.cpp
-include src/Key.cpp
-include src/Mouse.cpp
-include src/Music.cpp
-include src/PostFX.cpp
-include src/Rect.cpp
-include src/RenderWindow.cpp
-include src/Sleep.cpp
-include src/Sprite.cpp
-include src/String.cpp
-include src/VideoMode.cpp
-include src/View.cpp
-include src/Window.cpp
-include src/WindowStyle.cpp
-include src/main.cpp
-include src/Font.cpp
-include src/Shape.cpp
-include src/WindowSettings.cpp
-
-include src/Listener.cpp
-include src/Sound.cpp
-include src/SoundBuffer.cpp
-include src/SoundBufferRecorder.cpp
-include src/SoundRecorder.cpp
-include src/SoundStream.cpp
-
-
-include src/Blend.hpp
-include src/Clock.hpp
-include src/Color.hpp
-include src/Drawable.hpp
-include src/Event.hpp
-include src/Image.hpp
-include src/Input.hpp
-include src/Joy.hpp
-include src/Key.hpp
-include src/Mouse.hpp
-include src/Music.hpp
-include src/PostFX.hpp
-include src/Rect.hpp
-include src/RenderWindow.hpp
-include src/Sleep.hpp
-include src/Sprite.hpp
-include src/String.hpp
-include src/VideoMode.hpp
-include src/View.hpp
-include src/Window.hpp
-include src/WindowStyle.hpp
-include src/main.hpp
-include src/Font.hpp
-include src/Shape.hpp
-include src/WindowSettings.hpp
-include src/offsetof.hpp
-
-include src/Listener.hpp
-include src/Sound.hpp
-include src/SoundBuffer.hpp
-include src/SoundBufferRecorder.hpp
-include src/SoundRecorder.hpp
-include src/SoundStream.hpp
-
diff --git a/python/PKG-INFO b/python/PKG-INFO
index c786a96..777c7d4 100644
--- a/python/PKG-INFO
+++ b/python/PKG-INFO
@@ -1,8 +1,8 @@
 Metadata-Version: 1.0
 Name: PySFML
-Version: 1.2
+Version: 1.4
 Summary: Python binding for SFML (Simple and Fast Multimedia Library)
-Home-page: http://sfml.sourceforge.net/
+Home-page: http://www.sfml-dev.org/
 Author: Rémi Koenig
 Author-email: remi.k2620 at gmail.com
 License: zlib/png
diff --git a/python/samples/libsndfile-1.dll b/python/samples/libsndfile-1.dll
deleted file mode 100644
index f112de2..0000000
Binary files a/python/samples/libsndfile-1.dll and /dev/null differ
diff --git a/python/samples/sound_stream.py b/python/samples/sound_stream.py
old mode 100755
new mode 100644
diff --git a/python/scripts/gen_doc.py b/python/scripts/gen_doc.py
old mode 100755
new mode 100644
diff --git a/python/src/Font.cpp b/python/src/Font.cpp
index c6c04f1..60dffaa 100644
--- a/python/src/Font.cpp
+++ b/python/src/Font.cpp
@@ -121,7 +121,7 @@ static PyObject *
 PySfFont_GetDefaultFont(PySfFont* self, PyObject *args)
 {
 	PySfFont *Font = GetNewPySfFont();
-	Font->obj = new sf::Font(self->obj->GetDefaultFont());
+	Font->obj = new sf::Font(sf::Font::GetDefaultFont());
 	return (PyObject *)Font;
 }
 
diff --git a/python/src/Clock.cpp b/python/src/RenderTarget.cpp
similarity index 64%
copy from python/src/Clock.cpp
copy to python/src/RenderTarget.cpp
index 7c28c31..d21378d 100644
--- a/python/src/Clock.cpp
+++ b/python/src/RenderTarget.cpp
@@ -22,34 +22,37 @@
 //
 ////////////////////////////////////////////////////////////
 
-#include "Clock.hpp"
-
-
-typedef struct {
-	PyObject_HEAD
-	sf::Clock *obj;
-} PySfClock;
-
+#include "RenderTarget.hpp"
 
+unsigned int CustomRenderTarget::GetWidth() const
+{
+	return 0;
+}
+unsigned int CustomRenderTarget::GetHeight() const
+{
+	return 0;
+}
 
-static PyMemberDef PySfClock_members[] = {
+static PyMemberDef PySfRenderTarget_members[] = {
 	{NULL}  /* Sentinel */
 };
 
 
+
 static void
-PySfClock_dealloc(PySfClock *self)
+PySfRenderTarget_dealloc(PySfRenderTarget *self)
 {
 	delete self->obj;
 	self->ob_type->tp_free((PyObject*)self);
 }
 
 static PyObject *
-PySfClock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+PySfRenderTarget_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
-	PySfClock *self;
+	PySfRenderTarget *self;
+
+	self = (PySfRenderTarget *)type->tp_alloc(type, 0);
 
-	self = (PySfClock *)type->tp_alloc(type, 0);
 	if (self != NULL)
 	{
 	}
@@ -58,40 +61,25 @@ PySfClock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 }
 
 
-static int
-PySfClock_init(PySfClock *self, PyObject *args, PyObject *kwds)
+static int
+PySfRenderTarget_init(PySfRenderTarget *self, PyObject *args, PyObject *kwds)
 {
-	self->obj = new sf::Clock();
-	return 0;
+	self->obj = new CustomRenderTarget();
+	return 0;
 }
 
 
-static PyObject*
-PySfClock_GetElapsedTime(PySfClock *self)
-{
-	return PyFloat_FromDouble(self->obj->GetElapsedTime());
-}
-
-static PyObject*
-PySfClock_Reset(PySfClock *self)
-{
-	self->obj->Reset();
-	Py_RETURN_NONE;
-}
-
-static PyMethodDef PySfClock_methods[] = {
-	{"GetElapsedTime", (PyCFunction)PySfClock_GetElapsedTime, METH_NOARGS, "GetElapsedTime()\nGet the time elapsed since last reset."},
-	{"Reset", (PyCFunction)PySfClock_Reset, METH_NOARGS, "Reset()\nRestart the timer."},
+static PyMethodDef PySfRenderTarget_methods[] = {
 	{NULL}  /* Sentinel */
 };
 
-PyTypeObject PySfClockType = {
+PyTypeObject PySfRenderTargetType = {
 	PyObject_HEAD_INIT(NULL)
 	0,						/*ob_size*/
-	"Clock",				/*tp_name*/
-	sizeof(PySfClock),		/*tp_basicsize*/
+	"RenderTarget",				/*tp_name*/
+	sizeof(PySfRenderTarget),	/*tp_basicsize*/
 	0,						/*tp_itemsize*/
-	(destructor)PySfClock_dealloc, /*tp_dealloc*/
+	(destructor)PySfRenderTarget_dealloc, /*tp_dealloc*/
 	0,						/*tp_print*/
 	0,						/*tp_getattr*/
 	0,						/*tp_setattr*/
@@ -107,24 +95,24 @@ PyTypeObject PySfClockType = {
 	0,						/*tp_setattro*/
 	0,						/*tp_as_buffer*/
 	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
-	"sf.Clock is an utility class for manipulating time.", /* tp_doc */
+	"Base class for all render targets (window, image, ...).", /* tp_doc */
 	0,						/* tp_traverse */
 	0,						/* tp_clear */
 	0,						/* tp_richcompare */
 	0,						/* tp_weaklistoffset */
 	0,						/* tp_iter */
 	0,						/* tp_iternext */
-	PySfClock_methods,		/* tp_methods */
-	PySfClock_members,		/* tp_members */
+	PySfRenderTarget_methods,	/* tp_methods */
+	PySfRenderTarget_members,	/* tp_members */
 	0,						/* tp_getset */
 	0,						/* tp_base */
 	0,						/* tp_dict */
 	0,						/* tp_descr_get */
 	0,						/* tp_descr_set */
 	0,						/* tp_dictoffset */
-	(initproc)PySfClock_init, /* tp_init */
+	(initproc)PySfRenderTarget_init, /* tp_init */
 	0,						/* tp_alloc */
-	PySfClock_new,			/* tp_new */
+	PySfRenderTarget_new,		/* tp_new */
 };
 
 
diff --git a/python/src/Image.hpp b/python/src/RenderTarget.hpp
similarity index 78%
copy from python/src/Image.hpp
copy to python/src/RenderTarget.hpp
index 84713e0..c6d1241 100644
--- a/python/src/Image.hpp
+++ b/python/src/RenderTarget.hpp
@@ -22,28 +22,28 @@
 //
 ////////////////////////////////////////////////////////////
 
-#ifndef __PYIMAGE_HPP
-#define __PYIMAGE_HPP
+#ifndef __PYRENDERTARGET_H
+#define __PYRENDERTARGET_H
 
-#include <SFML/Graphics/Image.hpp>
-#include <iostream>
+#include <SFML/Graphics/RenderTarget.hpp>
 
 #include <Python.h>
 #include <structmember.h>
 
-#include "Color.hpp"
-#include "Rect.hpp"
 
-#include "offsetof.hpp"
+class CustomRenderTarget : public sf::RenderTarget
+{
+public :
+	virtual unsigned int GetHeight() const;
+	virtual unsigned int GetWidth() const;
+	PyObject *PyRenderTarget;
+};
 
 
 typedef struct {
 	PyObject_HEAD
-	sf::Image *obj;
-} PySfImage;
-
-PySfImage *
-GetNewPySfImage();
+	CustomRenderTarget *obj;
+} PySfRenderTarget;
 
 #endif
 

-- 
Python bindings for the SFML Library



More information about the Pkg-games-commits mailing list