pike.git / lib / modules / Graphics.pmod / Graph.pmod / polyline.pike

version» Context lines:

pike.git/lib/modules/Graphics.pmod/Graph.pmod/polyline.pike:1:   //! Graph sub-module providing draw functions.   //! - //! $Id: polyline.pike,v 1.6 2003/11/22 15:00:54 grubba Exp $ + //! $Id: polyline.pike,v 1.7 2008/06/28 16:36:55 nilsson Exp $      #pike __REAL_VERSION__      #define CAP_BUTT 0   #define CAP_ROUND 1   #define CAP_PROJECTING 2      #define JOIN_MITER 0   #define JOIN_ROUND 1   #define JOIN_BEVEL 2
pike.git/lib/modules/Graphics.pmod/Graph.pmod/polyline.pike:18:         constant PI = 3.1415926535897932384626433832795080;      /*    * Some optimizations for the cappings.    *    * /grubba (who got tired of BG being so slow)    */    - static array(float) init_cap_sin_table() + protected array(float) init_cap_sin_table()   {    array(float) s_t = allocate(CAPSTEPS);       for (int i = 0; i < CAPSTEPS; i++) {    s_t[i] = sin(PI*i/(CAPSTEPS-1));    }    return s_t;   }    - static array(float) cap_sin_table = init_cap_sin_table(); + protected array(float) cap_sin_table = init_cap_sin_table();    - static array(float) init_cap_cos_table() + protected array(float) init_cap_cos_table()   {    array(float) c_t = allocate(CAPSTEPS);       for (int i = 0; i < CAPSTEPS; i++) {    c_t[i] = cos(PI*i/(CAPSTEPS-1));    }    return c_t;   }    - static array(float) cap_cos_table = init_cap_cos_table(); + protected array(float) cap_cos_table = init_cap_cos_table();          - static private array(float) xyreverse(array(float) a) + protected private array(float) xyreverse(array(float) a)   {    array(float) r = reverse(a);    int n = sizeof(r)/2;    while(n--) {    float t = r[n<<1];    r[n<<1] = r[(n<<1)+1];    r[(n<<1)+1] = t;    }    return r;   }