summaryrefslogtreecommitdiff
path: root/apps/examples/nxlines
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-08-03 21:49:31 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-08-03 21:49:31 +0000
commit2dbf43396ef13cf1f6870631edbe399b12d5d07a (patch)
tree5adc239ba2ea9d6b8cbaa46aedc732c3e95a51a0 /apps/examples/nxlines
parent4a934b34d9f91e136d417551111a2c06b1f5c327 (diff)
downloadnuttx-2dbf43396ef13cf1f6870631edbe399b12d5d07a.tar.gz
nuttx-2dbf43396ef13cf1f6870631edbe399b12d5d07a.tar.bz2
nuttx-2dbf43396ef13cf1f6870631edbe399b12d5d07a.zip
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
Diffstat (limited to 'apps/examples/nxlines')
-rw-r--r--apps/examples/nxlines/nxlines.h2
-rw-r--r--apps/examples/nxlines/nxlines_bkgd.c12
-rw-r--r--apps/examples/nxlines/nxlines_main.c2
3 files changed, 8 insertions, 8 deletions
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 */