static PyObject * PySfRenderWindow_SetActive(PySfRenderWindow *self, PyObject *args) { PyObject* Active( 0 ); PyArg_ParseTuple( args, "|O", &Active ); self->obj->SetActive( Active == 0 ? true : PyBool_AsBool( Active ) ); Py_RETURN_NONE; }
bool CustomSoundRecorder::OnProcessSamples(const sf::Int16* Samples, std::size_t SamplesCount) { bool result = false; if (PyObject_HasAttrString(SoundRecorder, "OnGetData")) { PyObject *OnGetData = PyObject_GetAttrString(SoundRecorder, "OnGetData"); PyObject *Result = PyObject_CallFunction(OnGetData, (char *)"#s", (char *)Samples, SamplesCount*2); result = PyBool_AsBool(Result); Py_DECREF(OnGetData); Py_DECREF(Result); } return result; }
bool CustomSoundRecorder::OnStart() { bool result = false; if (PyObject_HasAttrString(SoundRecorder, "OnStart")) { PyObject *OnStart = PyObject_GetAttrString(SoundRecorder, "OnStart"); PyObject *Result = PyObject_CallFunction(OnStart, NULL); result = PyBool_AsBool(Result); Py_DECREF(OnStart); Py_DECREF(Result); } return result; }
static int PySfSound_init(PySfSound *self, PyObject *args, PyObject *kwds) { const char *kwlist[] = {"Buffer", "Loop", "Pitch", "Volume", "X", "Y", "Z", NULL}; PySfSoundBuffer *Buffer=NULL; PyObject *Loop=NULL; float Pitch=1.f, Volume=100.f, X=0.f, Y=0.f, Z=0.f; if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!Offfff:Sound.__new__", (char **)kwlist, &PySfSoundBufferType, &Buffer, &Loop, &Pitch, &Volume, &X, &Y, &Z)) return -1; { if (Loop) self->obj->SetLoop(PyBool_AsBool(Loop)); if (Buffer) self->obj->SetBuffer(*(Buffer->obj)); self->obj->SetPitch(Pitch); self->obj->SetVolume(Volume); self->obj->SetPosition(X, Y, Z); } return 0; }
static PyObject* PySfSound_SetRelativeToListener(PySfSound *self, PyObject *args) { self->obj->SetRelativeToListener(PyBool_AsBool(args)); Py_RETURN_NONE; }
static PyObject* PySfSound_SetLoop(PySfSound *self, PyObject *args) { self->obj->SetLoop(PyBool_AsBool(args)); Py_RETURN_NONE; }
static PyObject * PySfSprite_FlipY(PySfSprite* self, PyObject *args) { self->obj->FlipY(PyBool_AsBool(args)); Py_RETURN_NONE; }
static PyObject * PySfImage_SetSmooth (PySfImage *self, PyObject *args) { self->obj->SetSmooth(PyBool_AsBool(args)); Py_RETURN_NONE; }