From b90c2efe2f33f5714393bfd0ae85ad879a902316 Mon Sep 17 00:00:00 2001 From: Amy Bowersox Date: Wed, 11 Dec 2019 14:19:51 -0700 Subject: [PATCH] dig into the bitmap creation --- src/ep_bitmap.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ep_bitmap.c b/src/ep_bitmap.c index 5eac856..203e784 100755 --- a/src/ep_bitmap.c +++ b/src/ep_bitmap.c @@ -2,6 +2,7 @@ #define PY_SSIZE_T_CLEAN #include #include "scode.h" +#include "log.h" #include "gfxobj.h" #include "bitmap.h" #include "ep_types.h" @@ -44,11 +45,13 @@ static int bitmap_init(BitmapObject *self, PyObject *args, PyObject *kwds) const char *stock; int width = 0, height = 0; + Log(LDEBUG, "Bitmap init entry"); if (!PyArg_ParseTupleAndKeywords(args, kwds, "|$sii", kwlist, &stock, &width, &height)) return -1; if (stock) { + Log(LDEBUG, "stock bitmap"); self->pbmp = _BMP_GetStock(stock); if (!(self->pbmp)) { @@ -58,6 +61,7 @@ static int bitmap_init(BitmapObject *self, PyObject *args, PyObject *kwds) } else { + Log(LDEBUG, "basic bitmap"); width = MAX(1, width); height = MAX(1, height); self->pbmp = BMP_Create(width, height, NULL); @@ -115,11 +119,15 @@ PyObject *Epython_wrap_bitmap(PBITMAP pbmp) kwargs = PyDict_New(); if (kwargs) { + Log(LDEBUG, "gonna create it"); rc = PyType_GenericNew(&BitmapType, args, kwargs); + Log(LDEBUG, "created it"); if (rc) { pbitmapobj = (BitmapObject *)rc; + Log(LDEBUG, "gonna delete bitmap"); BMP_Delete(pbitmapobj->pbmp); + Log(LDEBUG, "deleted bitmap"); pbitmapobj->pbmp = pbmp; } Py_DECREF(kwargs);