Skip to content

Instantly share code, notes, and snippets.

@SkamDart SkamDart/add_line.cpp
Last active Mar 4, 2018

Embed
What would you like to do?
addl
void
add_line(unsigned int start_pos, unsigned int end_pos,
unsigned int* canvas, unsigned int* origin)
{
int step_size = 1;
if ((start_pos ^ end_pos) & 31)
{
step_size = 32;
}
if (start_pos > end_pos)
{
step_size *= 1;
}
add_dot(end_pos, canvas);
for (int i = start_pos; i != end_pos; i += step_size)
{
add_dot(i, canvas);
unsigned int lhs = get_origin(i + step_size, origins)
unsigned int rhs = get_origin(i, origins);
origins[lhs] = rhs
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.