diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/editor.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/editor.c b/src/editor.c index ce5c5ae..8728564 100644 --- a/src/editor.c +++ b/src/editor.c @@ -22,10 +22,21 @@ void SE_DrawEditor(Editor *editor, Camera2D *camera) { XdLevel *level = editor->data->levels[editor->state.currentLevel]; XdFloor *floor = level->floors[editor->state.currentLayer]; + // rendering placed tiles + for (int i = 0; i < editor->state.cache.tilesCount; i++) { + EditorTile *t = editor->state.cache.tiles[i]; + if (t == NULL) continue; + + Rectangle s = {0, 0, 16, 16}; + Rectangle d = {t->position.x * zoom, t->position.y * zoom, zoom, zoom}; + + DrawTexturePro(t->tile->texture, s, d, (Vector2){0, 0}, 0.0f, WHITE); + } + for (int x = 0; x < floor->width; x++) { for (int y = 0; y < floor->height; y++) { float rx = x * zoom, ry = y * zoom; - DrawRectangleLines(rx, ry, zoom, zoom, LIGHTGRAY); + DrawRectangleLines(rx, ry, zoom, zoom, BLACK); if ((rx < mousePos.x && mousePos.x < rx + zoom) && (ry < mousePos.y && mousePos.y < ry + zoom)) { @@ -65,17 +76,6 @@ void SE_DrawEditor(Editor *editor, Camera2D *camera) { } } } - - // rendering placed tiles - for (int i = 0; i < editor->state.cache.tilesCount; i++) { - EditorTile *t = editor->state.cache.tiles[i]; - if (t == NULL) continue; - - Rectangle s = {0, 0, 16, 16}; - Rectangle d = {t->position.x * zoom, t->position.y * zoom, zoom, zoom}; - - DrawTexturePro(t->tile->texture, s, d, (Vector2){0, 0}, 0.0f, WHITE); - } } void drawBuildTab(Editor *editor, int x, int y, int width, int height) { |
