summaryrefslogtreecommitdiff
path: root/src/editor.c
diff options
context:
space:
mode:
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;