ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/protate.c
(Generate patch)

Comparing ray/src/px/protate.c (file contents):
Revision 2.9 by schorsch, Sun Mar 28 20:33:14 2004 UTC vs.
Revision 2.10 by greg, Fri Apr 30 20:29:24 2004 UTC

# Line 34 | Line 34 | int    nrows;                          /* number of rows output at once */
34   char    *progname;
35  
36   short   ordertab[4][2] = {
37 <        {0,XDECR}, {XDECR,XDECR|YDECR}, {XDECR|YDECR,YDECR}, {YDECR,0}
37 >        {0,0}, {XDECR,XDECR|YDECR}, {XDECR|YDECR,YDECR}, {YDECR,XDECR}
38   };
39  
40 +
41   static int neworder(void);
42   static void rotatecw(FILE *fp);
43   static void rotateccw(FILE *fp);
# Line 46 | Line 47 | static void rotateccw(FILE *fp);
47   static int
48   neworder(void)          /* return corrected order */
49   {
50 +        static short    ordercw[8];
51          register int    i;
52  
53          if (correctorder)
54                  return(order);
55 <        for (i = 4; i--; )
56 <                if ((order&~YMAJOR) == ordertab[i][ccw])
57 <                        return(ordertab[i][1-ccw] | ((order&YMAJOR)^YMAJOR));
55 >        if (!ordercw[0]) {
56 >                ordercw[YMAJOR|YDECR] = 0;
57 >                ordercw[0] = YMAJOR|XDECR;
58 >                ordercw[YMAJOR|XDECR] = XDECR|YDECR;
59 >                ordercw[XDECR|YDECR] = YMAJOR|YDECR;
60 >                ordercw[YMAJOR|XDECR|YDECR] = XDECR;
61 >                ordercw[XDECR] = YMAJOR;
62 >                ordercw[YMAJOR] = YDECR;
63 >                ordercw[YDECR] = YMAJOR|XDECR|YDECR;
64 >        }
65 >        if (!ccw)
66 >                return(ordercw[order]);
67 >        for (i = 8; i--; )
68 >                if (ordercw[i] == order)
69 >                        return(i);
70          fputs("Order botch!\n", stderr);
71          exit(2);
72   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines