summaryrefslogtreecommitdiff
path: root/editor.c
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-07-31 22:12:48 +1000
committerquou <quou@disroot.org>2024-07-31 22:12:48 +1000
commit205f7d49530e6c32ec0a09045d9cb45dcf9b1752 (patch)
treee1d3432a677ff3511ed191aabfde6cf240f784b7 /editor.c
parent8d729883b3e134df8b9fc10f094df9fc3618bdb4 (diff)
GUI + map editor beginnings
Diffstat (limited to 'editor.c')
-rw-r--r--editor.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/editor.c b/editor.c
new file mode 100644
index 0000000..0aae694
--- /dev/null
+++ b/editor.c
@@ -0,0 +1,29 @@
+#include "editor.h"
+#include "asset.h"
+#include "gui.h"
+#include "map.h"
+#include "render.h"
+
+static GUI_Scroll_State map_ss = { 0 };
+
+void draw_map_scrollable(
+ GUI* g,
+ Renderer* r,
+ const Rect* rect,
+ const GUI_Scroll_State* ss
+) {
+ (void)g;
+ (void)ss;
+ ren_texture(r, rect, get_texture(asset_id_floorboards_texture));
+}
+
+void edit_map(Editor* e, GUI* g, Map* m) {
+ Rect b = gui_viewport(g);
+ Rect t = gui_cut_up(&b, gui_text_height() + 4);
+ (void)e;
+ (void)m;
+ gui_btn(g, gui_cut_left(&t, gui_text_width("Load", 4) + 4), "Save");
+ gui_btn(g, gui_cut_left(&t, gui_text_width("Save", 4) + 4), "Load");
+ gui_scrollable(g, b, &map_ss, draw_map_scrollable);
+}
+