| 33 |
|
#include "view.h" |
| 34 |
|
#include "random.h" |
| 35 |
|
#include "paths.h" |
| 36 |
< |
#include "rtmisc.h" /* myhostname() */ |
| 36 |
> |
#include "hilbert.h" |
| 37 |
|
|
| 38 |
|
|
| 39 |
|
#define RFTEMPLATE "rfXXXXXX" |
| 802 |
|
} |
| 803 |
|
|
| 804 |
|
static int |
| 805 |
< |
pixnumber( /* compute pixel index (brushed) */ |
| 805 |
> |
pixnumber( /* compute pixel index (screen door) */ |
| 806 |
|
int x, |
| 807 |
|
int y, |
| 808 |
|
int xres, |
| 809 |
|
int yres |
| 810 |
|
) |
| 811 |
|
{ |
| 812 |
< |
x -= y; |
| 813 |
< |
while (x < 0) |
| 814 |
< |
x += xres; |
| 815 |
< |
return((((x>>2)*yres + y) << 2) + (x & 3)); |
| 812 |
> |
unsigned nbits = 0; |
| 813 |
> |
bitmask_t coord[2]; |
| 814 |
> |
|
| 815 |
> |
if (xres < yres) xres = yres; |
| 816 |
> |
while (xres > 0) { |
| 817 |
> |
xres >>= 1; |
| 818 |
> |
++nbits; |
| 819 |
> |
} |
| 820 |
> |
coord[0] = x; coord[1] = y; |
| 821 |
> |
return ((int)hilbert_c2i(2, nbits, coord)); |
| 822 |
|
} |