mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[kandinsky] KDPointZero and KDRectZero
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -21,6 +21,8 @@ typedef struct {
|
||||
};
|
||||
} KDRect;
|
||||
|
||||
extern KDRect KDRectZero;
|
||||
|
||||
void KDFillRect(KDRect rect, KDColor color);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -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)};
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include <kandinsky/pixel.h>
|
||||
#include <string.h>
|
||||
|
||||
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);
|
||||
|
||||
3
kandinsky/src/types.c
Normal file
3
kandinsky/src/types.c
Normal file
@@ -0,0 +1,3 @@
|
||||
#include <kandinsky/types.h>
|
||||
|
||||
KDPoint KDPointZero = {.x = 0, .y = 0};
|
||||
Reference in New Issue
Block a user