diff --git a/kandinsky/Makefile b/kandinsky/Makefile index b671d3b81..9ee170f57 100644 --- a/kandinsky/Makefile +++ b/kandinsky/Makefile @@ -1,5 +1,5 @@ SFLAGS += -Ikandinsky/include -objs += $(addprefix kandinsky/src/, font.o line.o pixel.o rect.o text.o) +objs += $(addprefix kandinsky/src/, font.o line.o pixel.o rect.o text.o types.o) tests += $(addprefix kandinsky/test/, set_pixel.c) FREETYPE_PATH := /usr/local/Cellar/freetype/2.5.5 diff --git a/kandinsky/include/kandinsky/rect.h b/kandinsky/include/kandinsky/rect.h index 9c6ed5d09..442107edf 100644 --- a/kandinsky/include/kandinsky/rect.h +++ b/kandinsky/include/kandinsky/rect.h @@ -21,6 +21,8 @@ typedef struct { }; } KDRect; +extern KDRect KDRectZero; + void KDFillRect(KDRect rect, KDColor color); #endif diff --git a/kandinsky/include/kandinsky/types.h b/kandinsky/include/kandinsky/types.h index f082096d1..6528c8180 100644 --- a/kandinsky/include/kandinsky/types.h +++ b/kandinsky/include/kandinsky/types.h @@ -10,6 +10,8 @@ typedef struct { KDCoordinate y; } KDPoint; +extern KDPoint KDPointZero; + #define KDPOINT(xc,yc) ((KDPoint){.x=(KDCoordinate)(xc),.y=(KDCoordinate)(yc)}) static inline KDPoint KDPointTranslate(KDPoint p1, KDPoint p2) { return (KDPoint){.x = (KDCoordinate)(p1.x + p2.x), .y = (KDCoordinate)(p1.y + p2.y)}; diff --git a/kandinsky/src/rect.c b/kandinsky/src/rect.c index ad943784f..28fdf0c68 100644 --- a/kandinsky/src/rect.c +++ b/kandinsky/src/rect.c @@ -2,6 +2,8 @@ #include #include +KDRect KDRectZero = {.x = 0, .y = 0, .width = 0, .height = 0}; + void KDFillRect(KDRect rect, KDColor color) { //for (KDCoordinate y = rect.y ; y < (rect.y + rect.height); y++) { //memset(KDPixelAddress((KDPoint){.x=rect.x, .y=y}), color, rect.width); diff --git a/kandinsky/src/types.c b/kandinsky/src/types.c new file mode 100644 index 000000000..5518ca27b --- /dev/null +++ b/kandinsky/src/types.c @@ -0,0 +1,3 @@ +#include + +KDPoint KDPointZero = {.x = 0, .y = 0};