aboutsummaryrefslogtreecommitdiffstats
path: root/src/gmisc
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2018-06-23 13:02:07 +1000
committerinmarket <andrewh@inmarket.com.au>2018-06-23 13:02:07 +1000
commit41271d632b74f5cf47c30d3b699eb6b2786f2136 (patch)
tree78bcb729c6d6177ca598f28908fefd186c50e9b6 /src/gmisc
parent3b97fb798e96514057bcf17263c1e5dbdcd7da26 (diff)
downloaduGFX-41271d632b74f5cf47c30d3b699eb6b2786f2136.tar.gz
uGFX-41271d632b74f5cf47c30d3b699eb6b2786f2136.tar.bz2
uGFX-41271d632b74f5cf47c30d3b699eb6b2786f2136.zip
Added new type definitions - moving towards V3.0
Diffstat (limited to 'src/gmisc')
-rw-r--r--src/gmisc/gmisc.h12
-rw-r--r--src/gmisc/gmisc_hittest.c10
2 files changed, 7 insertions, 15 deletions
diff --git a/src/gmisc/gmisc.h b/src/gmisc/gmisc.h
index 21178774..8d767270 100644
--- a/src/gmisc/gmisc.h
+++ b/src/gmisc/gmisc.h
@@ -90,10 +90,6 @@ typedef int32_t fixed;
#if GFX_USE_GMISC || defined(__DOXYGEN__)
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#if GMISC_NEED_ARRAYOPS || defined(__DOXYGEN__)
/**
* @brief Convert from one array format to another array format.
@@ -476,17 +472,13 @@ extern "C" {
* @param[in] cnt The number of points in the point array @p pntarray
* @param[in] p The point to test
*
- * @return @p TRUE if the point @p p is inside or on the edge of the polygon @p pntarray, @p FALSE otherwise.
+ * @return @p gTrue if the point @p p is inside or on the edge of the polygon @p pntarray, @p gFalse otherwise.
*
* @api
*/
- bool_t gmiscHittestPoly(const point *pntarray, unsigned cnt, const point *p);
+ gBool gmiscHittestPoly(const point *pntarray, unsigned cnt, const point *p);
#endif // GMISC_NEED_HITTEST_POLY
-#ifdef __cplusplus
-}
-#endif
-
#endif /* GFX_USE_MISC */
#endif /* _GMISC_H */
diff --git a/src/gmisc/gmisc_hittest.c b/src/gmisc/gmisc_hittest.c
index f84a66cf..6e977cb2 100644
--- a/src/gmisc/gmisc_hittest.c
+++ b/src/gmisc/gmisc_hittest.c
@@ -64,7 +64,7 @@ static char _pointCrossingSegment(const point *a, const point *b, const point *c
return -1;
}
-bool_t gmiscHittestPoly(const point *pntarray, unsigned cnt, const point *p) {
+gBool gmiscHittestPoly(const point *pntarray, unsigned cnt, const point *p) {
unsigned i = 0;
uint8_t nbrIntersection = 0;
int8_t crossResult;
@@ -80,7 +80,7 @@ bool_t gmiscHittestPoly(const point *pntarray, unsigned cnt, const point *p) {
/* Point on the edge of the polygon */
if (crossResult == 0) {
- return TRUE;
+ return gTrue;
}
/* Point crossing the polygon */
else if(crossResult == 1) {
@@ -98,18 +98,18 @@ bool_t gmiscHittestPoly(const point *pntarray, unsigned cnt, const point *p) {
}
if (crossResult == 0) {
- return TRUE;
+ return gTrue;
} else if(crossResult == 1) {
nbrIntersection++;
}
/* If we cross an even pair of segments, we are outside */
if (nbrIntersection % 2 == 0) {
- return FALSE;
+ return gFalse;
}
/* Else we are inside the polygon */
- return TRUE;
+ return gTrue;
}
#endif // GMISC_NEED_HITTEST_POLY