Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-01-02 17:08:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-02 17:08:26 +0300
commit72e2a0cfb6f8e4d21b33982bbd572f10c20e947c (patch)
treee850c2de5b3068be3b0822d27348b632c901ca41 /source/blender/python/gpu/gpu_py_offscreen.c
parentd07bc44a96ce6838cd25edca61127021fbebe4d1 (diff)
Cleanup: py-gpu error checks
Move gpu initialization checks to the start of each function instead of mixing with argument parsing.
Diffstat (limited to 'source/blender/python/gpu/gpu_py_offscreen.c')
-rw-r--r--source/blender/python/gpu/gpu_py_offscreen.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/python/gpu/gpu_py_offscreen.c b/source/blender/python/gpu/gpu_py_offscreen.c
index 3ce90c5d648..5dc6e36ca56 100644
--- a/source/blender/python/gpu/gpu_py_offscreen.c
+++ b/source/blender/python/gpu/gpu_py_offscreen.c
@@ -88,14 +88,15 @@ static int bpygpu_offscreen_valid_check(BPyGPUOffScreen *bpygpu_ofs)
static PyObject *bpygpu_offscreen_new(PyTypeObject *UNUSED(self), PyObject *args, PyObject *kwds)
{
+ BPYGPU_IS_INIT_OR_ERROR_OBJ;
+
GPUOffScreen *ofs;
int width, height, samples = 0;
char err_out[256];
static const char *_keywords[] = {"width", "height", "samples", NULL};
static _PyArg_Parser _parser = {"ii|i:GPUOffScreen.__new__", _keywords, 0};
- if (!bpygpu_is_initialized() ||
- !_PyArg_ParseTupleAndKeywordsFast(
+ if (!_PyArg_ParseTupleAndKeywordsFast(
args, kwds, &_parser,
&width, &height, &samples))
{