summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FrameRender/P_Square.c4
-rw-r--r--FrameRender/P_Square.h3
-rw-r--r--graphics.c4
3 files changed, 5 insertions, 6 deletions
diff --git a/FrameRender/P_Square.c b/FrameRender/P_Square.c
index f5dbef7..f032121 100644
--- a/FrameRender/P_Square.c
+++ b/FrameRender/P_Square.c
@@ -4,8 +4,8 @@
#include <string.h>
void Square_callback(Square* self, struct PixelContext* fc) {
- if (0 <= fc->x && fc->x <= self->width &&
- 0 <= fc->y && fc->y <= self->height)
+ if (0 <= fc->x && fc->x <= self->size &&
+ 0 <= fc->y && fc->y <= self->size)
{
ARGB_merge(&fc->pixel, self->color);
}
diff --git a/FrameRender/P_Square.h b/FrameRender/P_Square.h
index 1cfbc45..bef7b21 100644
--- a/FrameRender/P_Square.h
+++ b/FrameRender/P_Square.h
@@ -4,8 +4,7 @@
#include "PixelCallback.h"
typedef struct Square {
- u32 width;
- u32 height;
+ u32 size;
color color;
} Square;
diff --git a/graphics.c b/graphics.c
index 8fceb1e..72089fc 100644
--- a/graphics.c
+++ b/graphics.c
@@ -34,14 +34,14 @@ main() {
.centerX = width / 2, .centerY = height / 2,
}),
Square_setup((Square){
- .width = 100, .height = 100, .color = 0xFFFFFF00,
+ .size = 100, .color = 0xFFFFFF00,
}),
NULL,
TransformRotate_setup((TransformRotate){
.angle = M_PI / 8,
}),
Square_setup((Square){
- .width = 200, .height = 200, .color = 0xFF00FFFF,
+ .size = 200, .color = 0xFF00FFFF,
}),
NULL,
TransformCenter_setup((TransformCenter){