From 2dbf43396ef13cf1f6870631edbe399b12d5d07a Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 3 Aug 2011 21:49:31 +0000 Subject: Fix numerous errors in trapezoid rendering and wide line drawing algorithms git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3841 42af7a65-404d-4744-a932-0658087f49c3 --- apps/examples/nxlines/nxlines.h | 2 +- apps/examples/nxlines/nxlines_bkgd.c | 12 ++++++------ apps/examples/nxlines/nxlines_main.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'apps') diff --git a/apps/examples/nxlines/nxlines.h b/apps/examples/nxlines/nxlines.h index d4b255485..59ca282d0 100644 --- a/apps/examples/nxlines/nxlines.h +++ b/apps/examples/nxlines/nxlines.h @@ -168,6 +168,6 @@ extern FAR NX_DRIVERTYPE *up_nxdrvinit(unsigned int devno); /* Background window interfaces */ -extern void nxlinex_test(NXWINDOW hwnd); +extern void nxlines_test(NXWINDOW hwnd); #endif /* __APPS_EXAMPLES_NXLINES_NXLINES_H */ diff --git a/apps/examples/nxlines/nxlines_bkgd.c b/apps/examples/nxlines/nxlines_bkgd.c index d7666ee48..164521156 100644 --- a/apps/examples/nxlines/nxlines_bkgd.c +++ b/apps/examples/nxlines/nxlines_bkgd.c @@ -192,14 +192,14 @@ static void nxlines_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch, ****************************************************************************/ /**************************************************************************** - * Name: nxlinex_test + * Name: nxlines_test * * Description: * Print "Hello, World!" in the center of the display. * ****************************************************************************/ -void nxlinex_test(NXWINDOW hwnd) +void nxlines_test(NXWINDOW hwnd) { struct nxgl_vector_s vector; struct nxgl_vector_s previous; @@ -236,7 +236,7 @@ void nxlinex_test(NXWINDOW hwnd) vector.pt2.x = xcenter - halfx; vector.pt2.y = ycenter - halfy; - message("Angle: %04x vector: (%d,%d)->(%d,%d)\n", + message("Angle: %08x vector: (%d,%d)->(%d,%d)\n", angle, vector.pt1.x, vector.pt1.y, vector.pt2.x, vector.pt2.y); /* Clear the previous line */ @@ -245,7 +245,7 @@ void nxlinex_test(NXWINDOW hwnd) ret = nx_drawline((NXWINDOW)hwnd, &previous, CONFIG_EXAMPLES_NXLINES_LINEWIDTH, color); if (ret < 0) { - message("nxlinex_test: nx_drawline failed clearing: %d\n", ret); + message("nxlines_test: nx_drawline failed clearing: %d\n", ret); } /* Draw the new line */ @@ -254,13 +254,13 @@ void nxlinex_test(NXWINDOW hwnd) ret = nx_drawline((NXWINDOW)hwnd, &vector, CONFIG_EXAMPLES_NXLINES_LINEWIDTH, color); if (ret < 0) { - message("nxlinex_test: nx_drawline failed clearing: %d\n", ret); + message("nxlines_test: nx_drawline failed clearing: %d\n", ret); } /* Set up for the next time throught the loop then sleep for a bit. */ angle += b16PI / 16; /* 32 angular positions in full circle */ - if (angle > (31 * (2 * b16PI) / 16)) /* Wrap back to zero.. allowing for slop */ + if (angle > (31 * (2 * b16PI) / 32)) /* Wrap back to zero.. allowing for slop */ { angle = 0; } diff --git a/apps/examples/nxlines/nxlines_main.c b/apps/examples/nxlines/nxlines_main.c index 551642a24..c1485e0ef 100644 --- a/apps/examples/nxlines/nxlines_main.c +++ b/apps/examples/nxlines/nxlines_main.c @@ -264,7 +264,7 @@ int MAIN_NAME(int argc, char *argv[]) * logic is cosmetic). */ - nxlinex_test(g_nxlines.hbkgd); + nxlines_test(g_nxlines.hbkgd); /* Release background */ -- cgit v1.2.3