33 |
|
int ac; |
34 |
|
char **av; |
35 |
|
{ |
36 |
+ |
#define randshift(x,n) ((long)(x) << shifttab[(n)&63]) |
37 |
+ |
static char shifttab[64] = { 15, 5, 11, 5, 6, 3, |
38 |
+ |
9, 15, 13, 2, 13, 5, 2, 12, 14, 11, |
39 |
+ |
11, 12, 12, 3, 2, 11, 8, 12, 1, 12, |
40 |
+ |
5, 4, 15, 9, 14, 5, 13, 14, 2, 10, |
41 |
+ |
10, 14, 12, 3, 5, 5, 14, 6, 12, 11, |
42 |
+ |
13, 9, 12, 8, 1, 6, 5, 12, 7, 13, |
43 |
+ |
15, 8, 9, 2, 6, 11, 9, 11 }; |
44 |
|
register int i; |
45 |
|
register XF_SPEC *spec; |
46 |
|
XF thisxf; |
88 |
|
spec->xf.sca = xf_context->xf.sca * thisxf.sca; |
89 |
|
} else |
90 |
|
spec->xf = thisxf; |
91 |
+ |
spec->xid = 0; /* compute unique transform id */ |
92 |
+ |
for (i = 0; i < sizeof(MAT4)/sizeof(unsigned short); i++) |
93 |
+ |
spec->xid ^= randshift(((unsigned short *)&spec->xf.xfm)[i],i); |
94 |
+ |
|
95 |
|
spec->prev = xf_context; /* push new transform onto stack */ |
96 |
|
xf_context = spec; |
97 |
|
return(MG_OK); |
98 |
+ |
#undef randshift |
99 |
|
} |
100 |
|
|
101 |
|
|