#include "library.hh"
#include "graphics.hh"
#include "output.hh"
+#include "parameter.hh"
static int checkneededline(Onscreen a, Onscreen b) {
double xd= a.x - b.x;
return n>0 ? n : 1;
}
+static Parameter<double>
+sotextpit("sotextpit", "Pitch of solid texture (0: grid mode)",
+ 0., 1., 0., 1000.);
+
void Cell::display(Output& o) {
int nn[4];
int totalnn= 0;
}
Point *array= new Point[totalnn];
Point *inarrayp= array;
+ Point mean(0,0,0);
for (i=0; i<4; i++) {
for (int a=0; a<nn[i]; a++) {
double fp= (double)a / nn[i];
double fn= (double)(nn[i]-a) / nn[i];
*inarrayp++= p[i]*fn + p[(i+1)&3]*fp;
}
+ mean = mean + p[i];
+ }
+ mean = mean * 0.25;
+ Output::Colour colour= Output::grid;
+ if (sotextpit > 0) {
+ bool white= false;
+ for (i=0; i<3; i++) {
+ double intpartdummy;
+ double remainder= modf(mean[i] / sotextpit, &intpartdummy);
+ if (remainder >= 0.5 || (remainder >= -0.5 && remainder < 0.0))
+ white= !white;
+ }
+ colour= white ? Output::solidwhite : Output::solidblack;
}
- o.drawcell(array,totalnn);
+ o.drawcell(array,totalnn,colour);
delete[] array;
}