Clipboard export / Conditional jumps / Saving of state
@@ -172,30 +172,28 @@ public class Fill{
public static void poly(float x, float y, int sides, float radius, float rotation){
float space = 360f / sides;
- for(int i = 0; i < sides - 2; i += 3){
+ for(int i = 0; i < sides; i += 2){
float px = Angles.trnsx(space * i + rotation, radius);
float py = Angles.trnsy(space * i + rotation, radius);
float px2 = Angles.trnsx(space * (i + 1) + rotation, radius);
float py2 = Angles.trnsy(space * (i + 1) + rotation, radius);
float px3 = Angles.trnsx(space * (i + 2) + rotation, radius);
float py3 = Angles.trnsy(space * (i + 2) + rotation, radius);
- float px4 = Angles.trnsx(space * (i + 3) + rotation, radius);
- float py4 = Angles.trnsy(space * (i + 3) + rotation, radius);
- quad(x + px, y + py, x + px2, y + py2, x + px3, y + py3, x + px4, y + py4);
+ quad(x, y, x + px, y + py, x + px2, y + py2, x + px3, y + py3);
}
- int mod = sides % 3;
+ int mod = sides % 2;
+
+ if(mod == 0 || sides < 4) return;
- if(mod == 0) return;
+ int i = sides - 2;
- for(int i = sides - mod - 1; i < sides; i++){
float px = Angles.trnsx(space * i + rotation, radius);
float py = Angles.trnsy(space * i + rotation, radius);
float px2 = Angles.trnsx(space * (i + 1) + rotation, radius);
float py2 = Angles.trnsy(space * (i + 1) + rotation, radius);
tri(x, y, x + px, y + py, x + px2, y + py2);
}
- }
public static void circle(float x, float y, float radius){
if(circleRegion == null || circleRegion.getTexture().isDisposed()){
