From 3fa74d5844e441f0cccf711791066efaab054b63 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 19 Jan 2025 20:42:57 +0500 Subject: feat: save/load .xd files (wip) --- src/editor.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/editor.c') diff --git a/src/editor.c b/src/editor.c index 64f1673..65f6a32 100644 --- a/src/editor.c +++ b/src/editor.c @@ -1,13 +1,17 @@ #include "editor.h" #include "raylib.h" +#include "xd.h" void SE_DrawEditor(Editor *editor, Camera2D *camera) { Vector2 mousePos = GetScreenToWorld2D(GetMousePosition(), *camera); float zoom = camera->zoom; - for (int x = 0; x < editor->level->width; x++) { - for (int y = 0; y < editor->level->height; y++) { + XdLevel *level = editor->data->levels[editor->state.currentLevel]; + XdFloor *floor = level->floors[editor->state.currentLayer]; + + for (int x = 0; x < floor->width; x++) { + for (int y = 0; y < floor->height; y++) { float rx = x * zoom, ry = y * zoom; Color innerColor = RAYWHITE; Color borderColor = LIGHTGRAY; -- cgit v1.2.3