aboutsummaryrefslogtreecommitdiff
path: root/src/graphics
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2021-12-23 13:37:10 -0800
committerChristian Cunningham <cc@localhost>2021-12-23 13:37:10 -0800
commit96f5bdd43e12c1c26e65e3a8e8d9ab0b95cd506e (patch)
treee30d2b254d6c09d03759e938b5c39e14a9df4447 /src/graphics
parent9130122609599f14f30fd6d2b32d15865cc8dfe3 (diff)
Fixed Global Drawer Initialization
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/drawer.c3
-rw-r--r--src/graphics/drawer.h4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/graphics/drawer.c b/src/graphics/drawer.c
index 742712a..542c04c 100644
--- a/src/graphics/drawer.c
+++ b/src/graphics/drawer.c
@@ -1,7 +1,8 @@
#include "../graphics/lfb.h"
#include "../graphics/drawer.h"
-static struct Drawer g_Drawer = {x: 0, y: 0};
+#define GRAPHICS_DRAWER_C
+struct Drawer g_Drawer = {.x = 0, .y = 0};
void write_cchar(struct Drawer* d, char s, unsigned int c) {
d->x %= GG_MAX_X;
diff --git a/src/graphics/drawer.h b/src/graphics/drawer.h
index 04f8f23..1ad89c5 100644
--- a/src/graphics/drawer.h
+++ b/src/graphics/drawer.h
@@ -6,7 +6,9 @@ struct Drawer {
unsigned int y;
};
-static struct Drawer g_Drawer;
+#ifndef GRAPHICS_DRAWER_C
+extern struct Drawer g_Drawer;
+#endif
void write_cchar(struct Drawer* d, char s, unsigned int c);
void write_char(struct Drawer* d, char s);