Skip to content

Commit

Permalink
Modify rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
AllyTally committed Jan 16, 2023
1 parent c46bf70 commit ab70fb5
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions desktop_version/src/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit ab70fb5

Please sign in to comment.