Skip to content

Commit

Permalink
Draw destination line for teleporters
Browse files Browse the repository at this point in the history
  • Loading branch information
AllyTally committed Jan 29, 2023
1 parent bce3c46 commit 3845b72
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions desktop_version/src/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#include "VFormat.h"
#include "Vlogging.h"

///#define LERP(a, b, t) ((a) + (t) * ((b) - (a)))

editorclass::editorclass(void)
{
reset();
Expand Down Expand Up @@ -747,24 +745,25 @@ void editorrender(void)
graphics.drawtele(ex, ey, 1, graphics.getcol(100));
fillboxabs(ex, ey, 8 * 12, 8 * 12, graphics.getRGB(164, 164, 255));

// Originally intended for debugging.
// When the game is moved to use SDL_Renderer,
// this can be drawn a lot better, and can be uncommented.
std::vector<SDL_Point> points;

#define LERP(a, b, t) ((a) + (t) * ((b) - (a)))

/*
for (int j = 0; j <= 100; j++)
for (int j = 0; j <= 255; j++)
{
float progress = (float)j / 100;
float progress = (float)j / 255;
float left_line_x = LERP(ex + 44, customentities[i].p1, progress);
float left_line_y = LERP(ey + 44, customentities[i].p2, progress);
float right_line_x = LERP(customentities[i].p1, customentities[i].p3, progress);
float right_line_y = LERP(customentities[i].p2, customentities[i].p4, progress);

int lx = LERP(left_line_x, right_line_x, progress);
int ly = LERP(left_line_y, right_line_y, progress);
fillbox(lx, ly, lx+1, ly+1, graphics.getRGB(0, 255, 0));

points.push_back({ lx, ly });
}
*/
#undef LERP
SDL_RenderDrawLines(gameScreen.m_renderer, points.data(), points.size());
}
break;
case 15: //Crewmates
Expand Down

0 comments on commit 3845b72

Please sign in to comment.