summaryrefslogtreecommitdiff
path: root/editor.c
blob: b59ce32d0bdd9ee00c8ac4837fe350d7e1f24888 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#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
) {
	Rect re = { 0, 0, 500, 500 };
	re.x = rect->x - ss->x;
	re.y = rect->y - ss->y;
	(void)g;
	(void)ss;
	ren_texture(r, &re, 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);
	int mcs[] = { 500, 500 };
	(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, mcs, &map_ss, draw_map_scrollable);
}