diff --git a/game/batch.py b/game/batch.py index 327cf8a..d167fed 100644 --- a/game/batch.py +++ b/game/batch.py @@ -16,7 +16,7 @@ from ctypes import c_ubyte, c_uint, POINTER from engine import ( - INSTANCE_FLAG_SPAWNED, BATCH_MAX_SIZE, create_batch, draw_batch, destroy_batch) + INSTANCE_FLAG_SPAWNED, BATCH_MAX_SIZE, buffer, create_batch, draw_batch, destroy_batch) class Batch: __slots__ = '_batch', '_paramsp', 'size', 'max_size', 'flags', 'meshes', 'params' @@ -27,9 +27,9 @@ class Batch: self._paramsp = POINTER(params_type) self.size = 0 self.max_size = max_size - self.flags = (c_ubyte * max_size)() - self.meshes = (c_uint * max_size)() - self.params = (params_type * max_size)() + self.flags = buffer(c_ubyte, max_size) + self.meshes = buffer(c_uint, max_size) + self.params = buffer(params_type, max_size) def __del__(self): destroy_batch(self._batch)