From ab70fb52d4bcdebc99e3a5b94266086458c4ef59 Mon Sep 17 00:00:00 2001 From: AllyTally Date: Mon, 16 Jan 2023 17:33:07 -0400 Subject: [PATCH] Modify rendering --- desktop_version/src/Editor.cpp | 51 +++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/desktop_version/src/Editor.cpp b/desktop_version/src/Editor.cpp index d1d4a6a298..c2e5f62ae7 100644 --- a/desktop_version/src/Editor.cpp +++ b/desktop_version/src/Editor.cpp @@ -825,32 +825,37 @@ void editorrender(void) fillboxabs((customentities[i].x * 8) - (ed.levx * 40 * 8), (customentities[i].y * 8) - (ed.levy * 30 * 8), 8, 8, graphics.getRGB(255, 255, 255)); break; case 23: // Directional Boxes - fillboxabs((customentities[i].x * 8) - (ed.levx * 40 * 8), (customentities[i].y * 8) - (ed.levy * 30 * 8), customentities[i].p1 * 8, customentities[i].p2 * 8, graphics.getRGB(255, 255, 164)); - fillboxabs((customentities[i].x * 8) - (ed.levx * 40 * 8), (customentities[i].y * 8) - (ed.levy * 30 * 8), 8, 8, graphics.getRGB(255, 255, 255)); - // Loop and draw the arrows - for (int j = 0; j < customentities[i].p1; j++) + { + int x = (customentities[i].x * 8) - (ed.levx * 40 * 8); + int y = (customentities[i].y * 8) - (ed.levy * 30 * 8); + + // Move x and y to the center of the box + x += (customentities[i].p1 - 1) * 4; + y += (customentities[i].p2 - 1) * 4; + + if (customentities[i].p3 == 0) { - for (int k = 0; k < customentities[i].p2; k++) - { - if (customentities[i].p3 == 0) - { - graphics.drawsprite((customentities[i].x * 8) - (ed.levx * 40 * 8) + (j * 8), (customentities[i].y * 8) - (ed.levy * 30 * 8) + (k * 8), 0, 255, 255, 255); - } - else if (customentities[i].p3 == 1) - { - graphics.drawsprite((customentities[i].x * 8) - (ed.levx * 40 * 8) + (j * 8), (customentities[i].y * 8) - (ed.levy * 30 * 8) + (k * 8), 1, 255, 255, 255); - } - else if (customentities[i].p3 == 2) - { - graphics.drawsprite((customentities[i].x * 8) - (ed.levx * 40 * 8) + (j * 8), (customentities[i].y * 8) - (ed.levy * 30 * 8) + (k * 8), 2, 255, 255, 255); - } - else if (customentities[i].p3 == 3) - { - graphics.drawsprite((customentities[i].x * 8) - (ed.levx * 40 * 8) + (j * 8), (customentities[i].y * 8) - (ed.levy * 30 * 8) + (k * 8), 3, 255, 255, 255); - } - } + // UP ARROW + graphics.bprint(x, y, "\xE2\x86\x91", 255, 255, 255); } + else if (customentities[i].p3 == 1) + { + // DOWN ARROW + graphics.bprint(x, y, "\xE2\x86\x93", 255, 255, 255); + } + else if (customentities[i].p3 == 2) + { + // LEFT ARROW + graphics.bprint(x, y, "\xE2\x86\x90", 255, 255, 255); + } + else if (customentities[i].p3 == 3) + { + // RIGHT ARROW + graphics.bprint(x, y, "\xE2\x86\x92", 255, 255, 255); + } + fillboxabs((customentities[i].x * 8) - (ed.levx * 40 * 8), (customentities[i].y * 8) - (ed.levy * 30 * 8), customentities[i].p1 * 8, customentities[i].p2 * 8, graphics.getRGB(255, 255, 164)); break; + } case 24: // Safe Boxes fillboxabs((customentities[i].x * 8) - (ed.levx * 40 * 8), (customentities[i].y * 8) - (ed.levy * 30 * 8), customentities[i].p1 * 8, customentities[i].p2 * 8, graphics.getRGB(164, 164, 255)); fillboxabs((customentities[i].x * 8) - (ed.levx * 40 * 8), (customentities[i].y * 8) - (ed.levy * 30 * 8), 8, 8, graphics.getRGB(255, 255, 255));