summaryrefslogtreecommitdiff
path: root/parsecalldata.pde
diff options
context:
space:
mode:
authorgit@eclectronics.org <git@eclectronics.org@eclectronics.org>2012-02-14 14:55:47 +0000
committergit@eclectronics.org <git@eclectronics.org@eclectronics.org>2012-02-14 14:55:47 +0000
commit89020cfbbec0fe8d0e15aa326174cb5af3d03ce6 (patch)
tree32064ad7bad8be0b54e7a8b88d660e6266f947e0 /parsecalldata.pde
parent4401d19c9d14b15bdd58743c99c9d1cc13a1ed8a (diff)
test white on blue
Diffstat (limited to 'parsecalldata.pde')
-rw-r--r--parsecalldata.pde21
1 files changed, 12 insertions, 9 deletions
diff --git a/parsecalldata.pde b/parsecalldata.pde
index 80361c0..38bcd1e 100644
--- a/parsecalldata.pde
+++ b/parsecalldata.pde
@@ -72,7 +72,7 @@ class bitmapcountry extends country {
super(n,c,m,shp);
}
void analyse(float _xo,float _xs,float _yo,float _ys) {
- int step=5; //speedup
+ int step=1; //speedup
xo=_xo;
xs=_xs;
yo=_yo;
@@ -120,13 +120,16 @@ class bitmapcountry extends country {
return new RPoint(px,py);
}
- RPoint getpoint(){
- float index=random(0.999);
- int i=0;
- while (points.get(i).index<index) {
- i++;
- }
- return new RPoint(points.get(i).pt.x+random(1),points.get(i).pt.y+random(1));
+ RPoint getpoint(){
+ if (points.size()>0) {
+ float index=random(0.999);
+ int i=0;
+ while (points.get(i).index<index&&i<points.size()) {
+ i++;
+ }
+ return new RPoint(points.get(i).pt.x+random(1),points.get(i).pt.y+random(1));
+ }
+ else return new RPoint(0,0);
}
}
@@ -164,7 +167,7 @@ class calldata {
for (int i=0; i < countries.size(); i++) {
//if (DEBUG) countries.get(i).printOut();
- countries.get(i).analyse(18.279,746.302,129.314,374.293);
+ countries.get(i).analyse(18.279,746.302,109,374.293); //129.314
}
}