Test Devlog for HTML code syntax


Here's the test

(via Tim Mathias' Copy As HTML plugin)


Code Snippet
  1. if (y1 > y2)
  2.             {
  3.                 int tx = x1, ty = y1;
  4.                 x1 = x2;
  5.                 y1 = y2;
  6.                 x2 = tx;
  7.                 y2 = ty;
  8.  
  9.                 deltax *= -1;
  10.                 deltay *= -1;
  11.             }
  12.  
  13.             int error = deltay / 2;
  14.             int x = x1;
  15.  
  16.             int adjustment = 1;
  17.             if (deltax < 0)
  18.             {
  19.                 adjustment = -1;
  20.                 deltax *= -1;
  21.             }
  22.  
  23.             for (int y = y1; y <= y2; y++)
  24.             {
  25.                 texture.SetPixel(x, y, c);
  26.                 error = error - deltax;
  27.                 if (error < 0)
  28.                 {
  29.                     x += adjustment;
  30.                     error += deltay;
  31.                 }
  32.             }

Leave a comment

Log in with itch.io to leave a comment.