diff options
Diffstat (limited to 'editor.c')
-rw-r--r-- | editor.c | 29 |
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); +} + |