worm.py sample rewritten;
Minor fix in sf.SoundStream; Updated sf.Image. git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1019 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
e580c8cd63
commit
49c7769273
4 changed files with 258 additions and 216 deletions
python/src
|
@ -293,7 +293,8 @@ Copy pixels from another image onto this one. This function does a slow pixel co
|
|||
Source : Source image to copy\n\
|
||||
DestX : X coordinate of the destination position\n\
|
||||
DestY : Y coordinate of the destination position\n\
|
||||
SourceRect : Sub-rectangle of the source image to copy (empty by default - entire image)"},
|
||||
SourceRect : Sub-rectangle of the source image to copy (empty by default - entire image)\n\
|
||||
ApplyAlpha : Should the copy take in account the source transparency? (false by default)"},
|
||||
{"Create", (PyCFunction)PySfImage_Create, METH_VARARGS, "Create(Width=0, Height=0, Color=sf.Color.Black)\n\
|
||||
Create an empty image.\n\
|
||||
Width : Image width\n\
|
||||
|
@ -396,17 +397,22 @@ PySfImage_Copy(PySfImage* self, PyObject *args)
|
|||
{
|
||||
PySfIntRect *SourceRect = NULL;
|
||||
PySfImage *Source = NULL;
|
||||
unsigned int DestX, DestY;
|
||||
if (! PyArg_ParseTuple(args, "O!II|O!", &PySfImageType, &Source, &DestX, &DestY, &PySfIntRectType, &SourceRect))
|
||||
unsigned int DestX, DestY;
|
||||
PyObject *PyApplyAlpha;
|
||||
bool ApplyAlpha = false;
|
||||
if (! PyArg_ParseTuple(args, "O!II|O!O", &PySfImageType, &Source, &DestX, &DestY, &PySfIntRectType, &SourceRect, &PyApplyAlpha))
|
||||
return NULL;
|
||||
|
||||
if (PyObject_IsTrue(PyApplyAlpha))
|
||||
ApplyAlpha = true;
|
||||
|
||||
if (SourceRect)
|
||||
{
|
||||
PySfIntRectUpdateObj(SourceRect);
|
||||
self->obj->Copy(*(Source->obj), DestX, DestY, *(SourceRect->obj));
|
||||
self->obj->Copy(*(Source->obj), DestX, DestY, *(SourceRect->obj), ApplyAlpha);
|
||||
}
|
||||
else
|
||||
self->obj->Copy(*(Source->obj), DestX, DestY);
|
||||
self->obj->Copy(*(Source->obj), DestX, DestY, sf::IntRect(0, 0, 0, 0), ApplyAlpha);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue