summaryrefslogtreecommitdiff
path: root/src/editor.c
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-01-19 20:42:57 +0500
committerilotterytea <iltsu@alright.party>2025-01-19 20:42:57 +0500
commit3fa74d5844e441f0cccf711791066efaab054b63 (patch)
tree2a3f95088e49deba37963c16928d830373899146 /src/editor.c
parent8bc01fccc138461f3bd58cd9d2707309fe745a43 (diff)
feat: save/load .xd files (wip)
Diffstat (limited to 'src/editor.c')
-rw-r--r--src/editor.c8
1 files changed, 6 insertions, 2 deletions
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;