From 757fd492839bbe9ed2f6d94d56ddbc8883a213f9 Mon Sep 17 00:00:00 2001 From: Fredrik Ljungdahl Date: Mon, 27 Jan 2020 02:15:49 +0100 Subject: [PATCH] Draw editor entities according to ingame order Ingame entities are drawn backwards, probably to draw the player on top, being entity 0 (usually, at least). Make the level editor draw entities in the same order. --- desktop_version/src/editor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index f5794c3e..aa844db3 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -2432,7 +2432,9 @@ void editorrender( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map, ent obj.customplatformtile=game.customcol*12; ed.temp=edentat(ed.tilex+ (ed.levx*40),ed.tiley+ (ed.levy*30)); - for(int i=0; i< EditorData::GetInstance().numedentities; i++) + + // Draw entities backward to remain accurate with ingame + for (int i = EditorData::GetInstance().numedentities - 1; i >= 0; i--) { //if() on screen int tx=(edentity[i].x-(edentity[i].x%40))/40;