summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Make.config4
-rw-r--r--glcddrivers/ax206dpf.c2
-rw-r--r--glcddrivers/picoLCD_256x64.h2
-rw-r--r--glcdgraphics/bitmap.c30
-rw-r--r--glcdgraphics/font.c2
-rw-r--r--glcdgraphics/glcd.c2
6 files changed, 23 insertions, 19 deletions
diff --git a/Make.config b/Make.config
index 47ac372..4ea4af6 100644
--- a/Make.config
+++ b/Make.config
@@ -50,6 +50,10 @@ MANDIR = $(DESTDIR)/man
#INCLUDES += -I
DEFINES += -D_GNU_SOURCE
+# define HAVE_DEBUG when invoking "make" if you want to use debugging
+ifdef HAVE_DEBUG
+DEFINES += -DHAVE_DEBUG
+endif
#
diff --git a/glcddrivers/ax206dpf.c b/glcddrivers/ax206dpf.c
index 7c9935a..f715585 100644
--- a/glcddrivers/ax206dpf.c
+++ b/glcddrivers/ax206dpf.c
@@ -878,7 +878,7 @@ static struct usb_device *find_dev(int index)
else enumeration++;
}
-#ifdef DEBUG
+#ifdef HAVE_DEBUG
printf("%04x %04x\n",
d->descriptor.idVendor,
d->descriptor.idProduct);
diff --git a/glcddrivers/picoLCD_256x64.h b/glcddrivers/picoLCD_256x64.h
index 223d748..4f8ce75 100644
--- a/glcddrivers/picoLCD_256x64.h
+++ b/glcddrivers/picoLCD_256x64.h
@@ -37,7 +37,7 @@
#define SCREEN_H 64
#define SCREEN_W 256
-#if 0
+#ifdef HAVE_DEBUG
#define DEBUG(x) fprintf(stderr,"picoLCD_256x64: %s(): " #x "\n", __FUNCTION__);
#define DEBUG1(x,...) fprintf(stderr,"picoLCD_256x64: %s(): " #x "\n", __FUNCTION__, __VA_ARGS__);
#else
diff --git a/glcdgraphics/bitmap.c b/glcdgraphics/bitmap.c
index adfe551..227e140 100644
--- a/glcdgraphics/bitmap.c
+++ b/glcdgraphics/bitmap.c
@@ -93,7 +93,7 @@ cBitmap::cBitmap(int width, int height, uint32_t * data)
ismonochrome(false),
processAlpha(true)
{
-#ifdef DEBUG
+#ifdef HAVE_DEBUG
printf("%s:%s(%d) cBitmap Size %03d * %03d\n", __FILE__, __FUNCTION__, __LINE__, width, height);
#endif
if (width > 0 && height > 0) {
@@ -113,7 +113,7 @@ cBitmap::cBitmap(int width, int height, uint32_t initcol)
ismonochrome(false),
processAlpha(true)
{
-#ifdef DEBUG
+#ifdef HAVE_DEBUG
printf("%s:%s(%d) cBitmap Size %03d * %03d\n", __FILE__, __FUNCTION__, __LINE__, width, height);
#endif
@@ -146,7 +146,7 @@ cBitmap::~cBitmap()
void cBitmap::Clear(uint32_t color)
{
-#ifdef DEBUG
+#ifdef HAVE_DEBUG
printf("%s:%s(%d) %03d * %03d (color %08x)\n", __FILE__, __FUNCTION__, __LINE__, width, height, color);
#endif
//uint32_t col = initcol; //(initcol == cColor::Transparent) ? backgroundColor : initcol;
@@ -262,7 +262,7 @@ void cBitmap::DrawLine(int x1, int y1, int x2, int y2, uint32_t color)
void cBitmap::DrawHLine(int x1, int y, int x2, uint32_t color)
{
-#ifdef DEBUG
+#ifdef HAVE_DEBUG
printf("%s:%s(%d) %03d -> %03d, %03d (color %08x)\n", __FILE__, __FUNCTION__, __LINE__, x1, x2, y, color);
#endif
color = cColor::AlignAlpha(color);
@@ -276,7 +276,7 @@ void cBitmap::DrawHLine(int x1, int y, int x2, uint32_t color)
void cBitmap::DrawVLine(int x, int y1, int y2, uint32_t color)
{
-#ifdef DEBUG
+#ifdef HAVE_DEBUG
printf("%s:%s(%d) %03d, %03d -> %03d (color %08x)\n", __FILE__, __FUNCTION__, __LINE__, x, y1, y2, color);
#endif
color = cColor::AlignAlpha(color);
@@ -290,7 +290,7 @@ void cBitmap::DrawVLine(int x, int y1, int y2, uint32_t color)
void cBitmap::DrawRectangle(int x1, int y1, int x2, int y2, uint32_t color, bool filled)
{
-#ifdef DEBUG
+#ifdef HAVE_DEBUG
printf("%s:%s(%d) %03d * %03d -> %03d * %03d (color %08x)\n", __FILE__, __FUNCTION__, __LINE__, x1, y1, x2, y2, color);
#endif
int y;
@@ -318,7 +318,7 @@ void cBitmap::DrawRectangle(int x1, int y1, int x2, int y2, uint32_t color, bool
void cBitmap::DrawRoundRectangle(int x1, int y1, int x2, int y2, uint32_t color, bool filled, int type)
{
-#ifdef DEBUG
+#ifdef HAVE_DEBUG
printf("%s:%s(%d) %03d * %03d -> %03d * %03d (color %08x)\n", __FILE__, __FUNCTION__, __LINE__, x1, y1, x2, y2, color);
#endif
color = cColor::AlignAlpha(color);
@@ -376,7 +376,7 @@ void cBitmap::DrawRoundRectangle(int x1, int y1, int x2, int y2, uint32_t color,
void cBitmap::DrawEllipse(int x1, int y1, int x2, int y2, uint32_t color, bool filled, int quadrants)
{
-#ifdef DEBUG
+#ifdef HAVE_DEBUG
printf("%s:%s(%d) %03d * %03d -> %03d * %03d (color %08x)\n", __FILE__, __FUNCTION__, __LINE__, x1, y1, x2, y2, color);
#endif
color = cColor::AlignAlpha(color);
@@ -522,7 +522,7 @@ void cBitmap::DrawEllipse(int x1, int y1, int x2, int y2, uint32_t color, bool f
void cBitmap::DrawSlope(int x1, int y1, int x2, int y2, uint32_t color, int type)
{
-#ifdef DEBUG
+#ifdef HAVE_DEBUG
printf("%s:%s(%d) %03d * %03d -> %03d * %03d\n", __FILE__, __FUNCTION__, __LINE__, x1, y1, x2, y2);
#endif
color = cColor::AlignAlpha(color);
@@ -562,7 +562,7 @@ void cBitmap::DrawSlope(int x1, int y1, int x2, int y2, uint32_t color, int type
void cBitmap::DrawBitmap(int x, int y, const cBitmap & bitmap, uint32_t color, uint32_t bgcolor, int opacity)
{
-#ifdef DEBUG
+#ifdef HAVE_DEBUG
printf("%s:%s(%d) '%03d' x '%03d' \n", __FILE__, __FUNCTION__, __LINE__, x, y);
#endif
color = cColor::AlignAlpha(color);
@@ -602,7 +602,7 @@ void cBitmap::DrawBitmap(int x, int y, const cBitmap & bitmap, uint32_t color, u
int cBitmap::DrawText(int x, int y, int xmax, const std::string & text, const cFont * font,
uint32_t color, uint32_t bgcolor, bool proportional, int skipPixels)
{
-#ifdef DEBUG
+#ifdef HAVE_DEBUG
printf("%s:%s(%d) text '%s', color '%08x'/'%08x'\n", __FILE__, __FUNCTION__, __LINE__, text.c_str(), color, bgcolor);
#endif
int xt;
@@ -704,7 +704,7 @@ int cBitmap::DrawText(int x, int y, int xmax, const std::string & text, const cF
int cBitmap::DrawCharacter(int x, int y, int xmax, uint32_t c, const cFont * font,
uint32_t color, uint32_t bgcolor, int skipPixels)
{
-#ifdef DEBUG
+#ifdef HAVE_DEBUG
printf("%s:%s(%d) %03d * %03d char '%c' color '%08x' bgcolor '%08x'\n", __FILE__, __FUNCTION__, __LINE__, x, y, c, color, bgcolor);
#endif
const cBitmap * charBitmap;
@@ -763,7 +763,7 @@ uint32_t cBitmap::GetPixel(int x, int y) const
cBitmap * cBitmap::SubBitmap(int x1, int y1, int x2, int y2) const
{
-#ifdef DEBUG
+#ifdef HAVE_DEBUG
printf("%s:%s(%d) %03d * %03d / %03d * %03d\n", __FILE__, __FUNCTION__, __LINE__, x1, y1, x2, y2);
#endif
int w, h;
@@ -857,7 +857,7 @@ const cBitmap* cBitmap::ConvertFrom1BPP(const unsigned char* monobmp, int w, int
#if 0
bool cBitmap::LoadPBM(const std::string & fileName)
{
-#ifdef DEBUG
+#ifdef HAVE_DEBUG
printf("%s:%s(%d)\n", __FILE__, __FUNCTION__, __LINE__);
#endif
FILE * pbmFile;
@@ -948,7 +948,7 @@ bool cBitmap::LoadPBM(const std::string & fileName)
void cBitmap::SavePBM(const std::string & fileName)
{
-#ifdef DEBUG
+#ifdef HAVE_DEBUG
printf("%s:%s(%d)\n", __FILE__, __FUNCTION__, __LINE__);
#endif
int i;
diff --git a/glcdgraphics/font.c b/glcdgraphics/font.c
index 9bbc1af..7e82cee 100644
--- a/glcdgraphics/font.c
+++ b/glcdgraphics/font.c
@@ -170,7 +170,7 @@ bool cFont::LoadFNT(const std::string & fileName, const std::string & encoding)
character = chdr[0] | (chdr[1] << 8);
charWidth = chdr[2] | (chdr[3] << 8);
fread(buffer, fontHeight * ((charWidth + 7) / 8), 1, fontFile);
-#ifdef DEBUG
+#ifdef HAVE_DEBUG
printf ("fontHeight %0d - charWidth %0d - character %0d - bytes %0d\n", fontHeight, charWidth, character,fontHeight * ((charWidth + 7) / 8));
#endif
diff --git a/glcdgraphics/glcd.c b/glcdgraphics/glcd.c
index 30449b9..3b2c3f3 100644
--- a/glcdgraphics/glcd.c
+++ b/glcdgraphics/glcd.c
@@ -188,7 +188,7 @@ bool cGLCDFile::Load(cImage & image, const string & fileName)
}
}
}
-#ifdef DEBUG
+#ifdef HAVE_DEBUG
printf("%s:%s(%d) - filename: '%s', count %d\n", __FILE__, __FUNCTION__, __LINE__, fileName.c_str(), n);
#endif
cBitmap * b = new cBitmap(width, height, bmpdata);