Skip to content

Commit

Permalink
PySFML 1.6 and 2.0: Fixed SetSmooth and implemented IsSmooth
Browse files Browse the repository at this point in the history
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1531 4e206d99-4929-0410-ac5d-dfc041789085
  • Loading branch information
svenstaro committed Jul 18, 2010
1 parent 5c0dfbb commit 9658047
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions python/src/Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ PySfImage_SetSmooth (PySfImage *self, PyObject *args)
Py_RETURN_NONE;
}

static PyObject *
PySfImage_IsSmooth (PySfImage *self)
{
return PyBool_FromLong(self->obj->IsSmooth());
}

static PyObject *
PySfImage_GetWidth(PySfImage *self)
{
Expand All @@ -233,7 +239,7 @@ static PyObject *
PySfImage_GetTexCoords(PySfImage* self, PyObject *args)
{
PySfIntRect *RectArg = NULL;


if (!PyArg_ParseTuple(args, "O!:Image.GetTextCoords", &PySfIntRectType, &RectArg))
return NULL;

Expand Down Expand Up @@ -295,7 +301,8 @@ Create the image from the current contents of the given window. Return True if c
{"GetPixels", (PyCFunction)PySfImage_GetPixels, METH_NOARGS, "GetPixels()\nGet a string representing the array of pixels (8 bits integers RGBA). String length is GetWidth() x GetHeight() x 4. This string becomes invalid if you reload or resize the image."},
{"CreateMaskFromColor", (PyCFunction)PySfImage_CreateMaskFromColor, METH_O, "CreateMaskFromColor(Color)\nCreate transparency mask from a specified colorkey."},
{"Bind", (PyCFunction)PySfImage_Bind, METH_NOARGS, "Bind()\nBind the image for rendering."},
{"SetSmooth", (PyCFunction)PySfImage_SetSmooth, METH_VARARGS, "SetSmooth(Smooth)\nEnable or disable image smooth filter."},
{"SetSmooth", (PyCFunction)PySfImage_SetSmooth, METH_O, "SetSmooth(Smooth)\nEnable or disable image smooth filter."},
{"IsSmooth", (PyCFunction)PySfImage_IsSmooth, METH_NOARGS, "IsOpened(Smooth)\nTells whether the smooth filtering is enabled or not."},
{"GetWidth", (PyCFunction)PySfImage_GetWidth, METH_NOARGS, "GetWidth()\nReturn the width of the image."},
{"GetHeight", (PyCFunction)PySfImage_GetHeight, METH_NOARGS, "GetHeight()\nReturn the height of the image."},
{"GetTexCoords", (PyCFunction)PySfImage_GetTexCoords, METH_VARARGS, "GetTexCoords(Rect)\nConvert a subrect expressed in pixels, into float texture coordinates. Returns texture coordinates corresponding to the sub-rectangle (sf.FloatRect instance)\n\
Expand Down Expand Up @@ -379,7 +386,7 @@ PySfImage_Copy(PySfImage* self, PyObject *args, PyObject *kwds)
unsigned int DestX, DestY;
PyObject *PyApplyAlpha = NULL;
bool ApplyAlpha = false;


if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!II|O!O:Image.Copy", (char **)kwlist, &PySfImageType, &Source, &DestX, &DestY, &PySfIntRectType, &SourceRect, &PyApplyAlpha))
return NULL;

Expand Down

0 comments on commit 9658047

Please sign in to comment.