Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock Test(Float:start_pos_x, Float:start_pos_y, Float:radius, Float:roundness = 1.0)
- {
- new Float:x = 0.0,
- Float:y = radius,
- Float:delta = 1.0-2.0*radius,
- Float:error = 0.0,
- Float:x1, Float:y1;
- new Text:TD_line;
- while (y >= 0.0)
- {
- x1 = start_pos_x + x;
- y1 = start_pos_y + y;
- TD_line = TextDrawCreate(x1, y1, "LD_SPAC:white");
- TextDrawFont(TD_line, 4);
- TextDrawTextSize(TD_line, (start_pos_x-x1)*2.0, 1.0);//start_pos_y-y1);
- TextDrawColor(TD_line, -1);
- TextDrawShowForAll(TD_line);
- x1 = start_pos_x - x;
- y1 = start_pos_y - y;
- TD_line = TextDrawCreate(x1, y1, "LD_SPAC:white");
- TextDrawFont(TD_line, 4);
- TextDrawTextSize(TD_line, (start_pos_x-x1)*2.0, 1.0);//start_pos_y-y2);
- TextDrawColor(TD_line, -1);
- TextDrawShowForAll(TD_line);
- error = 2.0 * (delta + y) - 1.0;
- if((delta < 0.0) && (error <= 0.0))
- {
- x+=roundness;
- delta += 2.0 * x + 1.0;
- }
- else if((delta > 0.0) && (error > 0.0))
- {
- y-=roundness;
- delta -= 2.0 * y + 1.0;
- }
- else
- {
- x+=roundness;
- y-=roundness;
- delta += 2.0*(x-y);
- }
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement