From 7ffff04e4900ca284519900d12bd1490e218c4f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sun, 6 Sep 2020 16:40:07 +0200 Subject: GPUVertBuf: Make GPUVertBuf private to the GPU module This is just a cleanup to isolate the internals of the vertbuf. This adds some getters to avoid refactor of existing code. --- source/blender/python/gpu/gpu_py_batch.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/python/gpu/gpu_py_batch.c') diff --git a/source/blender/python/gpu/gpu_py_batch.c b/source/blender/python/gpu/gpu_py_batch.c index bb7028c11ab..60b78b51890 100644 --- a/source/blender/python/gpu/gpu_py_batch.c +++ b/source/blender/python/gpu/gpu_py_batch.c @@ -141,11 +141,12 @@ static PyObject *bpygpu_Batch_vertbuf_add(BPyGPUBatch *self, BPyGPUVertBuf *py_b return NULL; } - if (self->batch->verts[0]->vertex_len != py_buf->buf->vertex_len) { + if (GPU_vertbuf_get_vertex_len(self->batch->verts[0]) != + GPU_vertbuf_get_vertex_len(py_buf->buf)) { PyErr_Format(PyExc_TypeError, "Expected %d length, got %d", - self->batch->verts[0]->vertex_len, - py_buf->buf->vertex_len); + GPU_vertbuf_get_vertex_len(self->batch->verts[0]), + GPU_vertbuf_get_vertex_len(py_buf->buf)); return NULL; } -- cgit v1.2.3