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:
authorGermano Cavalcante <germano.costa@ig.com.br>2020-12-11 22:05:58 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2020-12-11 22:06:22 +0300
commitbbd7f94d8a51e4a6c57dbcc49cea1fb2afcb8ff3 (patch)
treeea01aec4563947cdd7009e77f7d041fda5bf0c82 /source/blender/python/gpu/gpu_py_batch.c
parentcada56b1f72f537f9ab007cfafd430ac10c292fb (diff)
Cleanup: Python GPU: change prefix 'bpygpu_' to 'py_' in static functions
Diffstat (limited to 'source/blender/python/gpu/gpu_py_batch.c')
-rw-r--r--source/blender/python/gpu/gpu_py_batch.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/source/blender/python/gpu/gpu_py_batch.c b/source/blender/python/gpu/gpu_py_batch.c
index 81d1cb7055d..9fb7aea162a 100644
--- a/source/blender/python/gpu/gpu_py_batch.c
+++ b/source/blender/python/gpu/gpu_py_batch.c
@@ -48,7 +48,7 @@
/** \name Utility Functions
* \{ */
-static bool bpygpu_batch_is_program_or_error(BPyGPUBatch *self)
+static bool py_batch_is_program_or_error(BPyGPUBatch *self)
{
if (!self->batch->shader) {
PyErr_SetString(PyExc_RuntimeError, "batch does not have any program assigned to it");
@@ -63,7 +63,7 @@ static bool bpygpu_batch_is_program_or_error(BPyGPUBatch *self)
/** \name GPUBatch Type
* \{ */
-static PyObject *bpygpu_Batch_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds)
+static PyObject *py_Batch_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds)
{
BPYGPU_IS_INIT_OR_ERROR_OBJ;
@@ -121,7 +121,7 @@ static PyObject *bpygpu_Batch_new(PyTypeObject *UNUSED(type), PyObject *args, Py
return (PyObject *)ret;
}
-PyDoc_STRVAR(bpygpu_Batch_vertbuf_add_doc,
+PyDoc_STRVAR(py_Batch_vertbuf_add_doc,
".. method:: vertbuf_add(buf)\n"
"\n"
" Add another vertex buffer to the Batch.\n"
@@ -134,7 +134,7 @@ PyDoc_STRVAR(bpygpu_Batch_vertbuf_add_doc,
" :param buf: The vertex buffer that will be added to the batch.\n"
" :type buf: :class:`gpu.types.GPUVertBuf`\n"
);
-static PyObject *bpygpu_Batch_vertbuf_add(BPyGPUBatch *self, BPyGPUVertBuf *py_buf)
+static PyObject *py_Batch_vertbuf_add(BPyGPUBatch *self, BPyGPUVertBuf *py_buf)
{
if (!BPyGPUVertBuf_Check(py_buf)) {
PyErr_Format(PyExc_TypeError, "Expected a GPUVertBuf, got %s", Py_TYPE(py_buf)->tp_name);
@@ -167,7 +167,7 @@ static PyObject *bpygpu_Batch_vertbuf_add(BPyGPUBatch *self, BPyGPUVertBuf *py_b
}
PyDoc_STRVAR(
- bpygpu_Batch_program_set_doc,
+ py_Batch_program_set_doc,
".. method:: program_set(program)\n"
"\n"
" Assign a shader to this batch that will be used for drawing when not overwritten later.\n"
@@ -177,7 +177,7 @@ PyDoc_STRVAR(
"\n"
" :param program: The program/shader the batch will use in future draw calls.\n"
" :type program: :class:`gpu.types.GPUShader`\n");
-static PyObject *bpygpu_Batch_program_set(BPyGPUBatch *self, BPyGPUShader *py_shader)
+static PyObject *py_Batch_program_set(BPyGPUBatch *self, BPyGPUShader *py_shader)
{
if (!BPyGPUShader_Check(py_shader)) {
PyErr_Format(PyExc_TypeError, "Expected a GPUShader, got %s", Py_TYPE(py_shader)->tp_name);
@@ -208,7 +208,7 @@ static PyObject *bpygpu_Batch_program_set(BPyGPUBatch *self, BPyGPUShader *py_sh
Py_RETURN_NONE;
}
-PyDoc_STRVAR(bpygpu_Batch_draw_doc,
+PyDoc_STRVAR(py_Batch_draw_doc,
".. method:: draw(program=None)\n"
"\n"
" Run the drawing program with the parameters assigned to the batch.\n"
@@ -216,7 +216,7 @@ PyDoc_STRVAR(bpygpu_Batch_draw_doc,
" :param program: Program that performs the drawing operations.\n"
" If ``None`` is passed, the last program set to this batch will run.\n"
" :type program: :class:`gpu.types.GPUShader`\n");
-static PyObject *bpygpu_Batch_draw(BPyGPUBatch *self, PyObject *args)
+static PyObject *py_Batch_draw(BPyGPUBatch *self, PyObject *args)
{
BPyGPUShader *py_program = NULL;
@@ -224,7 +224,7 @@ static PyObject *bpygpu_Batch_draw(BPyGPUBatch *self, PyObject *args)
return NULL;
}
if (py_program == NULL) {
- if (!bpygpu_batch_is_program_or_error(self)) {
+ if (!py_batch_is_program_or_error(self)) {
return NULL;
}
}
@@ -236,42 +236,42 @@ static PyObject *bpygpu_Batch_draw(BPyGPUBatch *self, PyObject *args)
Py_RETURN_NONE;
}
-static PyObject *bpygpu_Batch_program_use_begin(BPyGPUBatch *self)
+static PyObject *py_Batch_program_use_begin(BPyGPUBatch *self)
{
- if (!bpygpu_batch_is_program_or_error(self)) {
+ if (!py_batch_is_program_or_error(self)) {
return NULL;
}
GPU_shader_bind(self->batch->shader);
Py_RETURN_NONE;
}
-static PyObject *bpygpu_Batch_program_use_end(BPyGPUBatch *self)
+static PyObject *py_Batch_program_use_end(BPyGPUBatch *self)
{
- if (!bpygpu_batch_is_program_or_error(self)) {
+ if (!py_batch_is_program_or_error(self)) {
return NULL;
}
GPU_shader_unbind();
Py_RETURN_NONE;
}
-static struct PyMethodDef bpygpu_Batch_methods[] = {
- {"vertbuf_add", (PyCFunction)bpygpu_Batch_vertbuf_add, METH_O, bpygpu_Batch_vertbuf_add_doc},
- {"program_set", (PyCFunction)bpygpu_Batch_program_set, METH_O, bpygpu_Batch_program_set_doc},
- {"draw", (PyCFunction)bpygpu_Batch_draw, METH_VARARGS, bpygpu_Batch_draw_doc},
- {"_program_use_begin", (PyCFunction)bpygpu_Batch_program_use_begin, METH_NOARGS, ""},
- {"_program_use_end", (PyCFunction)bpygpu_Batch_program_use_end, METH_NOARGS, ""},
+static struct PyMethodDef py_Batch_methods[] = {
+ {"vertbuf_add", (PyCFunction)py_Batch_vertbuf_add, METH_O, py_Batch_vertbuf_add_doc},
+ {"program_set", (PyCFunction)py_Batch_program_set, METH_O, py_Batch_program_set_doc},
+ {"draw", (PyCFunction)py_Batch_draw, METH_VARARGS, py_Batch_draw_doc},
+ {"_program_use_begin", (PyCFunction)py_Batch_program_use_begin, METH_NOARGS, ""},
+ {"_program_use_end", (PyCFunction)py_Batch_program_use_end, METH_NOARGS, ""},
{NULL, NULL, 0, NULL},
};
#ifdef USE_GPU_PY_REFERENCES
-static int bpygpu_Batch_traverse(BPyGPUBatch *self, visitproc visit, void *arg)
+static int py_Batch_traverse(BPyGPUBatch *self, visitproc visit, void *arg)
{
Py_VISIT(self->references);
return 0;
}
-static int bpygpu_Batch_clear(BPyGPUBatch *self)
+static int py_Batch_clear(BPyGPUBatch *self)
{
Py_CLEAR(self->references);
return 0;
@@ -279,14 +279,14 @@ static int bpygpu_Batch_clear(BPyGPUBatch *self)
#endif
-static void bpygpu_Batch_dealloc(BPyGPUBatch *self)
+static void py_Batch_dealloc(BPyGPUBatch *self)
{
GPU_batch_discard(self->batch);
#ifdef USE_GPU_PY_REFERENCES
if (self->references) {
PyObject_GC_UnTrack(self);
- bpygpu_Batch_clear(self);
+ py_Batch_clear(self);
Py_XDECREF(self->references);
}
#endif
@@ -319,17 +319,17 @@ PyDoc_STRVAR(
PyTypeObject BPyGPUBatch_Type = {
PyVarObject_HEAD_INIT(NULL, 0).tp_name = "GPUBatch",
.tp_basicsize = sizeof(BPyGPUBatch),
- .tp_dealloc = (destructor)bpygpu_Batch_dealloc,
+ .tp_dealloc = (destructor)py_Batch_dealloc,
#ifdef USE_GPU_PY_REFERENCES
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
.tp_doc = py_gpu_batch_doc,
- .tp_traverse = (traverseproc)bpygpu_Batch_traverse,
- .tp_clear = (inquiry)bpygpu_Batch_clear,
+ .tp_traverse = (traverseproc)py_Batch_traverse,
+ .tp_clear = (inquiry)py_Batch_clear,
#else
.tp_flags = Py_TPFLAGS_DEFAULT,
#endif
- .tp_methods = bpygpu_Batch_methods,
- .tp_new = bpygpu_Batch_new,
+ .tp_methods = py_Batch_methods,
+ .tp_new = py_Batch_new,
};
/** \} */