Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.12 KB | None | 0 0
  1. stock Test(Float:start_pos_x, Float:start_pos_y, Float:radius, Float:roundness = 1.0)
  2. {
  3.     new Float:x = 0.0,
  4.         Float:y = radius,
  5.         Float:delta = 1.0-2.0*radius,
  6.         Float:error = 0.0,
  7.         Float:x1, Float:y1;
  8.  
  9.     new Text:TD_line;
  10.     while (y >= 0.0)
  11.     {
  12.         x1 = start_pos_x + x;
  13.         y1 = start_pos_y + y;
  14.  
  15.  
  16.         TD_line = TextDrawCreate(x1, y1, "LD_SPAC:white");
  17.         TextDrawFont(TD_line, 4);
  18.         TextDrawTextSize(TD_line, (start_pos_x-x1)*2.0, 1.0);//start_pos_y-y1);
  19.         TextDrawColor(TD_line, -1);
  20.         TextDrawShowForAll(TD_line);
  21.  
  22.         x1 = start_pos_x - x;
  23.         y1 = start_pos_y - y;
  24.  
  25.         TD_line = TextDrawCreate(x1, y1, "LD_SPAC:white");
  26.         TextDrawFont(TD_line, 4);
  27.         TextDrawTextSize(TD_line, (start_pos_x-x1)*2.0, 1.0);//start_pos_y-y2);
  28.         TextDrawColor(TD_line, -1);
  29.         TextDrawShowForAll(TD_line);
  30.  
  31.  
  32.         error = 2.0 * (delta + y) - 1.0;
  33.         if((delta < 0.0) && (error <= 0.0))
  34.         {
  35.             x+=roundness;
  36.             delta += 2.0 * x + 1.0;
  37.         }
  38.         else if((delta > 0.0) && (error > 0.0))
  39.         {
  40.             y-=roundness;
  41.             delta -= 2.0 * y + 1.0;
  42.         }
  43.         else
  44.         {
  45.             x+=roundness;
  46.             y-=roundness;
  47.             delta += 2.0*(x-y);
  48.         }
  49.     }
  50.     return;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement