summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/CMakeLists.txt3
-rw-r--r--src/game/inc/game.h15
-rw-r--r--src/game/src/game.c24
3 files changed, 42 insertions, 0 deletions
diff --git a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt
new file mode 100644
index 0000000..89cd1f0
--- /dev/null
+++ b/src/game/CMakeLists.txt
@@ -0,0 +1,3 @@
+add_library(game "src/game.c")
+target_include_directories(game PUBLIC "inc")
+target_link_libraries(game PRIVATE gfx)
diff --git a/src/game/inc/game.h b/src/game/inc/game.h
new file mode 100644
index 0000000..8275d54
--- /dev/null
+++ b/src/game/inc/game.h
@@ -0,0 +1,15 @@
+#ifndef GAME_H
+#define GAME_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+int game(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GAME_H */
diff --git a/src/game/src/game.c b/src/game/src/game.c
new file mode 100644
index 0000000..b17e534
--- /dev/null
+++ b/src/game/src/game.c
@@ -0,0 +1,24 @@
+#include <game.h>
+#include <gfx.h>
+
+static int init(void)
+{
+ struct gfx_sprite s, s2;
+
+ if (gfx_sprite_from_file("cdrom:\\block.TIM;1", &s))
+ return -1;
+
+ gfx_sprite_sort(&s);
+ s2 = s;
+ gfx_sprite_sort(&s2);
+ gfx_draw();
+ return 0;
+}
+
+int game(void)
+{
+ if (init())
+ return -1;
+
+ return 0;
+}